Panda3D
Loading...
Searching...
No Matches
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 */
19INLINE bool OdeWorld::
20is_empty() const {
21 return (_id == 0);
22}
23
24/**
25 * Returns the underlying dWorldID.
26 */
27INLINE dWorldID OdeWorld::
28get_id() const {
29 return _id;
30}
31
32INLINE void OdeWorld::
33set_gravity(dReal x, dReal y, dReal z) {
34 dWorldSetGravity(_id, x, y, z);
35}
36
37INLINE void OdeWorld::
38set_gravity(const LVecBase3f &vec) {
39 dWorldSetGravity(_id, vec[0], vec[1], vec[2]);
40}
41
42INLINE LVecBase3f OdeWorld::
43get_gravity() const {
44 dVector3 gravity;
45 dWorldGetGravity(_id, gravity);
46
47 return LVecBase3f(gravity[0],gravity[1],gravity[2]);
48}
49
50INLINE void OdeWorld::
51set_erp(dReal erp) {
52 dWorldSetERP(_id, erp);
53}
54
55INLINE dReal OdeWorld::
56get_erp() const {
57 return dWorldGetERP(_id);
58}
59
60INLINE void OdeWorld::
61set_cfm(dReal cfm) {
62 dWorldSetCFM(_id, cfm);
63}
64
65INLINE dReal OdeWorld::
66get_cfm() const {
67 return dWorldGetCFM(_id);
68}
69
70INLINE void OdeWorld::
71step(dReal stepsize) {
72 dWorldStep(_id, stepsize);
73}
74
75INLINE LVecBase3f OdeWorld::
76impulse_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
86INLINE LVecBase3f OdeWorld::
87impulse_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
97INLINE void OdeWorld::
98quick_step(dReal stepsize) {
99 dWorldQuickStep(_id, stepsize);
100}
101
102INLINE void OdeWorld::
103set_quick_step_num_iterations(int num) {
104 dWorldSetQuickStepNumIterations(_id, num);
105}
106
107INLINE int OdeWorld::
108get_quick_step_num_iterations() const {
109 return dWorldGetQuickStepNumIterations(_id);
110}
111
112INLINE void OdeWorld::
113set_quick_step_w(dReal over_relaxation) {
114 dWorldSetQuickStepW(_id, over_relaxation);
115}
116
117INLINE dReal OdeWorld::
118get_quick_step_w() const {
119 return dWorldGetQuickStepW(_id);
120}
121
122INLINE void OdeWorld::
123set_contact_max_correcting_vel(dReal vel) {
124 dWorldSetContactMaxCorrectingVel(_id, vel);
125}
126
127INLINE dReal OdeWorld::
128get_contact_max_correcting_vel() const {
129 return dWorldGetContactMaxCorrectingVel(_id);
130}
131
132INLINE void OdeWorld::
133set_contact_surface_layer(dReal depth) {
134 dWorldSetContactSurfaceLayer(_id, depth);
135}
136
137INLINE dReal OdeWorld::
138get_contact_surface_layer() const {
139 return dWorldGetContactSurfaceLayer(_id);
140}
141
142INLINE dReal OdeWorld::
143get_auto_disable_linear_threshold() const {
144 return dWorldGetAutoDisableLinearThreshold(_id);
145}
146
147INLINE void OdeWorld::
148set_auto_disable_linear_threshold(dReal linear_threshold) {
149 dWorldSetAutoDisableLinearThreshold(_id, linear_threshold);
150}
151
152INLINE dReal OdeWorld::
153get_auto_disable_angular_threshold() const {
154 return dWorldGetAutoDisableAngularThreshold(_id);
155}
156
157INLINE void OdeWorld::
158set_auto_disable_angular_threshold(dReal angular_threshold) {
159 dWorldSetAutoDisableAngularThreshold(_id, angular_threshold);
160}
161
162INLINE int OdeWorld::
163get_auto_disable_steps() const {
164 return dWorldGetAutoDisableSteps(_id);
165}
166
167INLINE void OdeWorld::
168set_auto_disable_steps(int steps) {
169 dWorldSetAutoDisableSteps(_id, steps);
170}
171
172INLINE dReal OdeWorld::
173get_auto_disable_time() const {
174 return dWorldGetAutoDisableTime(_id);
175}
176
177INLINE void OdeWorld::
178set_auto_disable_time(dReal time) {
179 dWorldSetAutoDisableTime(_id, time);
180}
181
182INLINE int OdeWorld::
183get_auto_disable_flag() const {
184 return dWorldGetAutoDisableFlag(_id);
185}
186
187INLINE void OdeWorld::
188set_auto_disable_flag(int do_auto_disable) {
189 dWorldSetAutoDisableFlag(_id, do_auto_disable);
190}
191
192INLINE int OdeWorld::
193compare_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