Panda3D

Loading...
Searching...
No Matches
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
14INLINE void OdeRayGeom::
15set_length(dReal length) {
16 dGeomRaySetLength(_id, length);
17}
18
19INLINE dReal OdeRayGeom::
20get_length() {
21 return dGeomRayGetLength(_id);
22}
23
24INLINE void OdeRayGeom::
25set(dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz) {
26 dGeomRaySet(_id, px, py, pz, dx, dy, dz);
27}
28
29INLINE void OdeRayGeom::
30set(const LVecBase3f &start, const LVecBase3f &dir) {
31 set(start[0], start[1], start[2], dir[0], dir[1], dir[2]);
32}
33
34INLINE void OdeRayGeom::
35get(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
42INLINE LVecBase3f OdeRayGeom::
43get_start() const {
44 dVector3 start, dir;
45 dGeomRayGet(_id, start, dir);
46 return LVecBase3f(start[0], start[1], start[2]);
47}
48
49INLINE LVecBase3f OdeRayGeom::
50get_direction() const {
51 dVector3 start, dir;
52 dGeomRayGet(_id, start, dir);
53 return LVecBase3f(dir[0], dir[1], dir[2]);
54}
55
56INLINE void OdeRayGeom::
57set_params(int first_contact, int backface_cull) {
58 dGeomRaySetParams(_id, first_contact, backface_cull);
59}
60
61INLINE void OdeRayGeom::
62get_params(int &first_contact, int &backface_cull) const {
63 dGeomRayGetParams(_id, &first_contact, &backface_cull);
64}
65
66INLINE int OdeRayGeom::
67get_first_contact() const {
68 int fc, bc;
69 dGeomRayGetParams(_id, &fc, &bc);
70 return fc;
71}
72
73INLINE int OdeRayGeom::
74get_backface_cull() const {
75 int fc, bc;
76 dGeomRayGetParams(_id, &fc, &bc);
77 return bc;
78}
79
80INLINE void OdeRayGeom::
81set_closest_hit(int closest_hit) {
82 dGeomRaySetClosestHit(_id, closest_hit);
83}
84
85INLINE int OdeRayGeom::
86get_closest_hit() {
87 return dGeomRayGetClosestHit(_id);
88}