Panda3D
odeWorld.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 odeWorld.I
10  * @author joswilso
11  * @date 2006-12-27
12  */
13 
14 /**
15  * Returns true if the ID is 0, meaning the OdeWorld does not point to a valid
16  * world. It is an error to call a method on an empty world. Note that an
17  * empty OdeWorld also evaluates to False.
18  */
19 INLINE bool OdeWorld::
20 is_empty() const {
21  return (_id == 0);
22 }
23 
24 /**
25  * Returns the underlying dWorldID.
26  */
27 INLINE dWorldID OdeWorld::
28 get_id() const {
29  return _id;
30 }
31 
32 INLINE void OdeWorld::
33 set_gravity(dReal x, dReal y, dReal z) {
34  dWorldSetGravity(_id, x, y, z);
35 }
36 
37 INLINE void OdeWorld::
38 set_gravity(const LVecBase3f &vec) {
39  dWorldSetGravity(_id, vec[0], vec[1], vec[2]);
40 }
41 
42 INLINE LVecBase3f OdeWorld::
43 get_gravity() const {
44  dVector3 gravity;
45  dWorldGetGravity(_id, gravity);
46 
47  return LVecBase3f(gravity[0],gravity[1],gravity[2]);
48 }
49 
50 INLINE void OdeWorld::
51 set_erp(dReal erp) {
52  dWorldSetERP(_id, erp);
53 }
54 
55 INLINE dReal OdeWorld::
56 get_erp() const {
57  return dWorldGetERP(_id);
58 }
59 
60 INLINE void OdeWorld::
61 set_cfm(dReal cfm) {
62  dWorldSetCFM(_id, cfm);
63 }
64 
65 INLINE dReal OdeWorld::
66 get_cfm() const {
67  return dWorldGetCFM(_id);
68 }
69 
70 INLINE void OdeWorld::
71 step(dReal stepsize) {
72  dWorldStep(_id, stepsize);
73 }
74 
75 INLINE LVecBase3f OdeWorld::
76 impulse_to_force(dReal stepsize, \
77  dReal ix, dReal iy, dReal iz){
78  dVector3 force;
79  dWorldImpulseToForce(_id,
80  stepsize,
81  ix, iy, iz,
82  force);
83  return LVecBase3f(force[0], force[1], force[2]);
84 }
85 
86 INLINE LVecBase3f OdeWorld::
87 impulse_to_force(dReal stepsize, \
88  const LVecBase3f &impulse){
89  dVector3 force;
90  dWorldImpulseToForce(_id,
91  stepsize,
92  impulse[0], impulse[1], impulse[2],
93  force);
94  return LVecBase3f(force[0], force[1], force[2]);
95 }
96 
97 INLINE void OdeWorld::
98 quick_step(dReal stepsize) {
99  dWorldQuickStep(_id, stepsize);
100 }
101 
102 INLINE void OdeWorld::
103 set_quick_step_num_iterations(int num) {
104  dWorldSetQuickStepNumIterations(_id, num);
105 }
106 
107 INLINE int OdeWorld::
108 get_quick_step_num_iterations() const {
109  return dWorldGetQuickStepNumIterations(_id);
110 }
111 
112 INLINE void OdeWorld::
113 set_quick_step_w(dReal over_relaxation) {
114  dWorldSetQuickStepW(_id, over_relaxation);
115 }
116 
117 INLINE dReal OdeWorld::
118 get_quick_step_w() const {
119  return dWorldGetQuickStepW(_id);
120 }
121 
122 INLINE void OdeWorld::
123 set_contact_max_correcting_vel(dReal vel) {
124  dWorldSetContactMaxCorrectingVel(_id, vel);
125 }
126 
127 INLINE dReal OdeWorld::
128 get_contact_max_correcting_vel() const {
129  return dWorldGetContactMaxCorrectingVel(_id);
130 }
131 
132 INLINE void OdeWorld::
133 set_contact_surface_layer(dReal depth) {
134  dWorldSetContactSurfaceLayer(_id, depth);
135 }
136 
137 INLINE dReal OdeWorld::
138 get_contact_surface_layer() const {
139  return dWorldGetContactSurfaceLayer(_id);
140 }
141 
142 INLINE dReal OdeWorld::
143 get_auto_disable_linear_threshold() const {
144  return dWorldGetAutoDisableLinearThreshold(_id);
145 }
146 
147 INLINE void OdeWorld::
148 set_auto_disable_linear_threshold(dReal linear_threshold) {
149  dWorldSetAutoDisableLinearThreshold(_id, linear_threshold);
150 }
151 
152 INLINE dReal OdeWorld::
153 get_auto_disable_angular_threshold() const {
154  return dWorldGetAutoDisableAngularThreshold(_id);
155 }
156 
157 INLINE void OdeWorld::
158 set_auto_disable_angular_threshold(dReal angular_threshold) {
159  dWorldSetAutoDisableAngularThreshold(_id, angular_threshold);
160 }
161 
162 INLINE int OdeWorld::
163 get_auto_disable_steps() const {
164  return dWorldGetAutoDisableSteps(_id);
165 }
166 
167 INLINE void OdeWorld::
168 set_auto_disable_steps(int steps) {
169  dWorldSetAutoDisableSteps(_id, steps);
170 }
171 
172 INLINE dReal OdeWorld::
173 get_auto_disable_time() const {
174  return dWorldGetAutoDisableTime(_id);
175 }
176 
177 INLINE void OdeWorld::
178 set_auto_disable_time(dReal time) {
179  dWorldSetAutoDisableTime(_id, time);
180 }
181 
182 INLINE int OdeWorld::
183 get_auto_disable_flag() const {
184  return dWorldGetAutoDisableFlag(_id);
185 }
186 
187 INLINE void OdeWorld::
188 set_auto_disable_flag(int do_auto_disable) {
189  dWorldSetAutoDisableFlag(_id, do_auto_disable);
190 }
191 
192 INLINE int OdeWorld::
193 compare_to(const OdeWorld &other) const {
194  if (_id != other._id) {
195  return _id < other._id ? -1 : 1;
196  }
197  return 0;
198 }
dWorldID get_id() const
Returns the underlying dWorldID.
Definition: odeWorld.I:28
bool is_empty() const
Returns true if the ID is 0, meaning the OdeWorld does not point to a valid world.
Definition: odeWorld.I:20