Panda3D
 All Classes Functions Variables Enumerations
odeRayGeom.I
1 // Filename: odeRayGeom.I
2 // Created by: joswilso (27Dec06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 INLINE void OdeRayGeom::
17 set_length(dReal length) {
18  dGeomRaySetLength(_id, length);
19 }
20 
21 INLINE dReal OdeRayGeom::
22 get_length() {
23  return dGeomRayGetLength(_id);
24 }
25 
26 INLINE void OdeRayGeom::
27 set(dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz) {
28  dGeomRaySet(_id, px, py, pz, dx, dy, dz);
29 }
30 
31 INLINE void OdeRayGeom::
32 set(const LVecBase3f &start, const LVecBase3f &dir) {
33  set(start[0], start[1], start[2], dir[0], dir[1], dir[2]);
34 }
35 
36 INLINE void OdeRayGeom::
37 get(LVecBase3f &start, LVecBase3f &dir) const {
38  dVector3 s, d;
39  dGeomRayGet(_id, s, d);
40  start.set(s[0], s[1], s[2]);
41  dir.set(d[0], d[1], d[2]);
42 }
43 
44 INLINE LVecBase3f OdeRayGeom::
45 get_start() const {
46  dVector3 start, dir;
47  dGeomRayGet(_id, start, dir);
48  return LVecBase3f(start[0], start[1], start[2]);
49 }
50 
51 INLINE LVecBase3f OdeRayGeom::
52 get_direction() const {
53  dVector3 start, dir;
54  dGeomRayGet(_id, start, dir);
55  return LVecBase3f(dir[0], dir[1], dir[2]);
56 }
57 
58 INLINE void OdeRayGeom::
59 set_params(int first_contact, int backface_cull) {
60  dGeomRaySetParams(_id, first_contact, backface_cull);
61 }
62 
63 INLINE void OdeRayGeom::
64 get_params(int &first_contact, int &backface_cull) const {
65  dGeomRayGetParams(_id, &first_contact, &backface_cull);
66 }
67 
68 INLINE int OdeRayGeom::
69 get_first_contact() const {
70  int fc, bc;
71  dGeomRayGetParams(_id, &fc, &bc);
72  return fc;
73 }
74 
75 INLINE int OdeRayGeom::
76 get_backface_cull() const {
77  int fc, bc;
78  dGeomRayGetParams(_id, &fc, &bc);
79  return bc;
80 }
81 
82 INLINE void OdeRayGeom::
83 set_closest_hit(int closest_hit) {
84  dGeomRaySetClosestHit(_id, closest_hit);
85 }
86 
87 INLINE int OdeRayGeom::
88 get_closest_hit() {
89  return dGeomRayGetClosestHit(_id);
90 }
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105