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