Panda3D

Loading...
Searching...
No Matches
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 */
19INLINE bool OdeSpace::
20 is_empty() const {
21 return (_id == 0);
22}
23
24/**
25 * Returns the underlying dSpaceID.
26 */
27INLINE dSpaceID OdeSpace::
28 get_id() const {
29 return _id;
30}
31
32INLINE void OdeSpace::
33set_cleanup(int mode) {
34 dSpaceSetCleanup(_id, mode);
35}
36
37INLINE int OdeSpace::
38get_cleanup() const {
39 return dSpaceGetCleanup(_id);
40}
41
42INLINE int OdeSpace::
43get_num_geoms() const {
44 return dSpaceGetNumGeoms(_id);
45}
46
47INLINE OdeSpace OdeSpace::
48get_space() const {
49 return OdeSpace(dGeomGetSpace((dGeomID)_id));
50}
51
52INLINE void OdeSpace::
53get_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
60INLINE int OdeSpace::
61is_space() {
62 return dGeomIsSpace((dGeomID)_id);
63}
64
65INLINE int OdeSpace::
66get_class() const {
67 return dGeomGetClass((dGeomID)_id);
68}
69
70INLINE void OdeSpace::
71set_category_bits(const BitMask32 &bits) {
72 dGeomSetCategoryBits((dGeomID)_id, bits.get_word());
73}
74
75INLINE void OdeSpace::
76set_collide_bits(const BitMask32 &bits) {
77 dGeomSetCollideBits((dGeomID)_id, bits.get_word());
78}
79
80INLINE BitMask32 OdeSpace::
81get_category_bits() {
82 return BitMask32(dGeomGetCategoryBits((dGeomID)_id));
83}
84
85INLINE BitMask32 OdeSpace::
86get_collide_bits() {
87 return BitMask32(dGeomGetCollideBits((dGeomID)_id));
88}
89
90INLINE void OdeSpace::
91enable() {
92 dGeomEnable((dGeomID)_id);
93}
94
95INLINE void OdeSpace::
96disable() {
97 dGeomDisable((dGeomID)_id);
98}
99
100INLINE int OdeSpace::
101is_enabled() {
102 return dGeomIsEnabled((dGeomID)_id);
103}
104
105INLINE void OdeSpace::
106set_collision_event(const std::string &event_name) {
107 _collision_event = event_name;
108}
109
110INLINE std::string OdeSpace::
111get_collision_event() {
112 return _collision_event;
113}
BitMask::get_word
WordType get_word() const
Returns the entire BitMask as a single word.
Definition bitMask.I:246
OdeSpace
Definition odeSpace.h:37
OdeSpace::is_empty
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
OdeSpace::get_id
dSpaceID get_id() const
Returns the underlying dSpaceID.
Definition odeSpace.I:28