Panda3D
odeSpace.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 odeSpace.I
10  * @author joswilso
11  * @date 2006-12-27
12  */
13 
14 /**
15  * Returns true if the ID is 0, meaning the OdeSpace does not point to a valid
16  * space. It is an error to call a method on an empty space. Note that an
17  * empty OdeSpace also evaluates to False.
18  */
19 INLINE bool OdeSpace::
20 is_empty() const {
21  return (_id == 0);
22 }
23 
24 /**
25  * Returns the underlying dSpaceID.
26  */
27 INLINE dSpaceID OdeSpace::
28 get_id() const {
29  return _id;
30 }
31 
32 INLINE void OdeSpace::
33 set_cleanup(int mode) {
34  dSpaceSetCleanup(_id, mode);
35 }
36 
37 INLINE int OdeSpace::
38 get_cleanup() const {
39  return dSpaceGetCleanup(_id);
40 }
41 
42 INLINE int OdeSpace::
43 get_num_geoms() const {
44  return dSpaceGetNumGeoms(_id);
45 }
46 
47 INLINE OdeSpace OdeSpace::
48 get_space() const {
49  return OdeSpace(dGeomGetSpace((dGeomID)_id));
50 }
51 
52 INLINE void OdeSpace::
53 get_AABB(LVecBase3f &min, LVecBase3f &max) const {
54  dReal result[6];
55  dGeomGetAABB((dGeomID)_id, result);
56  min.set(result[0], result[2], result[4]);
57  max.set(result[1], result[3], result[5]);
58 }
59 
60 INLINE int OdeSpace::
61 is_space() {
62  return dGeomIsSpace((dGeomID)_id);
63 }
64 
65 INLINE int OdeSpace::
66 get_class() const {
67  return dGeomGetClass((dGeomID)_id);
68 }
69 
70 INLINE void OdeSpace::
71 set_category_bits(const BitMask32 &bits) {
72  dGeomSetCategoryBits((dGeomID)_id, bits.get_word());
73 }
74 
75 INLINE void OdeSpace::
76 set_collide_bits(const BitMask32 &bits) {
77  dGeomSetCollideBits((dGeomID)_id, bits.get_word());
78 }
79 
80 INLINE BitMask32 OdeSpace::
81 get_category_bits() {
82  return BitMask32(dGeomGetCategoryBits((dGeomID)_id));
83 }
84 
85 INLINE BitMask32 OdeSpace::
86 get_collide_bits() {
87  return BitMask32(dGeomGetCollideBits((dGeomID)_id));
88 }
89 
90 INLINE void OdeSpace::
91 enable() {
92  dGeomEnable((dGeomID)_id);
93 }
94 
95 INLINE void OdeSpace::
96 disable() {
97  dGeomDisable((dGeomID)_id);
98 }
99 
100 INLINE int OdeSpace::
101 is_enabled() {
102  return dGeomIsEnabled((dGeomID)_id);
103 }
104 
105 INLINE void OdeSpace::
106 set_collision_event(const std::string &event_name) {
107  _collision_event = event_name;
108 }
109 
110 INLINE std::string OdeSpace::
111 get_collision_event() {
112  return _collision_event;
113 }
dSpaceID get_id() const
Returns the underlying dSpaceID.
Definition: odeSpace.I:28
bool is_empty() const
Returns true if the ID is 0, meaning the OdeSpace does not point to a valid space.
Definition: odeSpace.I:20
WordType get_word() const
Returns the entire BitMask as a single word.
Definition: bitMask.I:246