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