Panda3D
|
00001 // Filename: odeRayGeom.I 00002 // Created by: joswilso (27Dec06) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 INLINE void OdeRayGeom:: 00015 set_length(dReal length) { 00016 dGeomRaySetLength(_id, length); 00017 } 00018 00019 INLINE dReal OdeRayGeom:: 00020 get_length() { 00021 return dGeomRayGetLength(_id); 00022 } 00023 00024 INLINE void OdeRayGeom:: 00025 set(dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz) { 00026 dGeomRaySet(_id, px, py, pz, dx, dy, dz); 00027 } 00028 00029 INLINE void OdeRayGeom:: 00030 set(const LVecBase3f &start, const LVecBase3f &dir) { 00031 set(start[0], start[1], start[2], dir[0], dir[1], dir[2]); 00032 } 00033 00034 INLINE void OdeRayGeom:: 00035 get(LVecBase3f &start, LVecBase3f &dir) const { 00036 dVector3 s, d; 00037 dGeomRayGet(_id, s, d); 00038 start.set(s[0], s[1], s[2]); 00039 dir.set(d[0], d[1], d[2]); 00040 } 00041 00042 INLINE LVecBase3f OdeRayGeom:: 00043 get_start() const { 00044 dVector3 start, dir; 00045 dGeomRayGet(_id, start, dir); 00046 return LVecBase3f(start[0], start[1], start[2]); 00047 } 00048 00049 INLINE LVecBase3f OdeRayGeom:: 00050 get_direction() const { 00051 dVector3 start, dir; 00052 dGeomRayGet(_id, start, dir); 00053 return LVecBase3f(dir[0], dir[1], dir[2]); 00054 } 00055 00056 INLINE void OdeRayGeom:: 00057 set_params(int first_contact, int backface_cull) { 00058 dGeomRaySetParams(_id, first_contact, backface_cull); 00059 } 00060 00061 INLINE void OdeRayGeom:: 00062 get_params(int &first_contact, int &backface_cull) const { 00063 dGeomRayGetParams(_id, &first_contact, &backface_cull); 00064 } 00065 00066 INLINE int OdeRayGeom:: 00067 get_first_contact() const { 00068 int fc, bc; 00069 dGeomRayGetParams(_id, &fc, &bc); 00070 return fc; 00071 } 00072 00073 INLINE int OdeRayGeom:: 00074 get_backface_cull() const { 00075 int fc, bc; 00076 dGeomRayGetParams(_id, &fc, &bc); 00077 return bc; 00078 } 00079 00080 INLINE void OdeRayGeom:: 00081 set_closest_hit(int closest_hit) { 00082 dGeomRaySetClosestHit(_id, closest_hit); 00083 } 00084 00085 INLINE int OdeRayGeom:: 00086 get_closest_hit() { 00087 return dGeomRayGetClosestHit(_id); 00088 }