forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodeSpace.I
More file actions
120 lines (101 loc) · 2.83 KB
/
odeSpace.I
File metadata and controls
120 lines (101 loc) · 2.83 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Filename: odeSpace.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."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: OdeSpace::is_empty
// Access: Published
// Description: Returns true if the ID is 0, meaning the OdeSpace
// does not point to a valid space. It is an error to
// call a method on an empty space.
// Note that an empty OdeSpace also evaluates to False.
////////////////////////////////////////////////////////////////////
INLINE bool OdeSpace::
is_empty() const {
return (_id == 0);
}
////////////////////////////////////////////////////////////////////
// Function: OdeSpace::get_id
// Access: Published
// Description: Returns the underlying dSpaceID.
////////////////////////////////////////////////////////////////////
INLINE dSpaceID OdeSpace::
get_id() const {
return _id;
}
INLINE void OdeSpace::
set_cleanup(int mode) {
dSpaceSetCleanup(_id, mode);
}
INLINE int OdeSpace::
get_cleanup() const {
return dSpaceGetCleanup(_id);
}
INLINE int OdeSpace::
get_num_geoms() const {
return dSpaceGetNumGeoms(_id);
}
INLINE OdeSpace OdeSpace::
get_space() const {
return OdeSpace(dGeomGetSpace((dGeomID)_id));
}
INLINE void OdeSpace::
get_AABB(LVecBase3f &min, LVecBase3f &max) const {
dReal result[6];
dGeomGetAABB((dGeomID)_id, result);
min.set(result[0], result[2], result[4]);
max.set(result[1], result[3], result[5]);
}
INLINE int OdeSpace::
is_space() {
return dGeomIsSpace((dGeomID)_id);
}
INLINE int OdeSpace::
get_class() const {
return dGeomGetClass((dGeomID)_id);
}
INLINE void OdeSpace::
set_category_bits(const BitMask32 &bits) {
dGeomSetCategoryBits((dGeomID)_id, bits.get_word());
}
INLINE void OdeSpace::
set_collide_bits(const BitMask32 &bits) {
dGeomSetCollideBits((dGeomID)_id, bits.get_word());
}
INLINE BitMask32 OdeSpace::
get_category_bits() {
return BitMask32(dGeomGetCategoryBits((dGeomID)_id));
}
INLINE BitMask32 OdeSpace::
get_collide_bits() {
return BitMask32(dGeomGetCollideBits((dGeomID)_id));
}
INLINE void OdeSpace::
enable() {
dGeomEnable((dGeomID)_id);
}
INLINE void OdeSpace::
disable() {
dGeomDisable((dGeomID)_id);
}
INLINE int OdeSpace::
is_enabled() {
return dGeomIsEnabled((dGeomID)_id);
}
INLINE void OdeSpace::
set_collision_event(const string &event_name) {
_collision_event = event_name;
}
INLINE string OdeSpace::
get_collision_event() {
return _collision_event;
}