Blender  V2.93
RBI_api.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2013 Blender Foundation,
17  * All rights reserved.
18  */
19 
25 #ifndef __RB_API_H__
26 #define __RB_API_H__
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* API Notes:
33  * Currently, this API is optimised for Bullet RigidBodies, and doesn't
34  * take into account other Physics Engines. Some tweaking may be necessary
35  * to allow other systems to be used, in particular there may be references
36  * to datatypes that aren't used here...
37  *
38  * -- Joshua Leung (22 June 2010)
39  */
40 
41 /* ********************************** */
42 /* Partial Type Defines - Aliases for the type of data we store */
43 
44 // ----------
45 
46 /* Dynamics World */
47 typedef struct rbDynamicsWorld rbDynamicsWorld;
48 
49 /* Rigid Body */
50 typedef struct rbRigidBody rbRigidBody;
51 
52 /* Collision Shape */
53 typedef struct rbCollisionShape rbCollisionShape;
54 
55 /* Mesh Data (for Collision Shapes of Meshes) */
56 typedef struct rbMeshData rbMeshData;
57 
58 /* Constraint */
59 typedef struct rbConstraint rbConstraint;
60 
61 /* ********************************** */
62 /* Dynamics World Methods */
63 
64 /* Setup ---------------------------- */
65 
66 /* Create a new dynamics world instance */
67 // TODO: add args to set the type of constraint solvers, etc.
68 rbDynamicsWorld *RB_dworld_new(const float gravity[3]);
69 
70 /* Delete the given dynamics world, and free any extra data it may require */
72 
73 /* Settings ------------------------- */
74 
75 /* Gravity */
76 void RB_dworld_get_gravity(rbDynamicsWorld *world, float g_out[3]);
77 void RB_dworld_set_gravity(rbDynamicsWorld *world, const float g_in[3]);
78 
79 /* Constraint Solver */
80 void RB_dworld_set_solver_iterations(rbDynamicsWorld *world, int num_solver_iterations);
81 /* Split Impulse */
82 void RB_dworld_set_split_impulse(rbDynamicsWorld *world, int split_impulse);
83 
84 /* Simulation ----------------------- */
85 
86 /* Step the simulation by the desired amount (in seconds) with extra controls on substep sizes and
87  * maximum substeps */
89  float timeStep,
90  int maxSubSteps,
91  float timeSubStep);
92 
93 /* Export -------------------------- */
94 
95 /* Exports the dynamics world to physics simulator's serialisation format */
96 void RB_dworld_export(rbDynamicsWorld *world, const char *filename);
97 
98 /* ********************************** */
99 /* Rigid Body Methods */
100 
101 /* Setup ---------------------------- */
102 
103 /* Add RigidBody to dynamics world */
104 void RB_dworld_add_body(rbDynamicsWorld *world, rbRigidBody *body, int col_groups);
105 
106 /* Remove RigidBody from dynamics world */
108 
109 /* Collision detection */
110 
112  rbRigidBody *object,
113  const float loc_start[3],
114  const float loc_end[3],
115  float v_location[3],
116  float v_hitpoint[3],
117  float v_normal[3],
118  int *r_hit);
119 
120 /* ............ */
121 
122 /* Create new RigidBody instance */
123 rbRigidBody *RB_body_new(rbCollisionShape *shape, const float loc[3], const float rot[4]);
124 
125 /* Delete the given RigidBody instance */
126 void RB_body_delete(rbRigidBody *body);
127 
128 /* Settings ------------------------- */
129 
130 /* 'Type' */
131 void RB_body_set_type(rbRigidBody *body, int type, float mass);
132 
133 /* ............ */
134 
135 /* Collision Shape */
137 
138 /* ............ */
139 
140 /* Mass */
141 float RB_body_get_mass(rbRigidBody *body);
142 void RB_body_set_mass(rbRigidBody *body, float value);
143 
144 /* Friction */
145 float RB_body_get_friction(rbRigidBody *body);
146 void RB_body_set_friction(rbRigidBody *body, float value);
147 
148 /* Restitution */
150 void RB_body_set_restitution(rbRigidBody *body, float value);
151 
152 /* Damping */
154 void RB_body_set_linear_damping(rbRigidBody *body, float value);
155 
157 void RB_body_set_angular_damping(rbRigidBody *body, float value);
158 
159 void RB_body_set_damping(rbRigidBody *object, float linear, float angular);
160 
161 /* Sleeping Thresholds */
163 void RB_body_set_linear_sleep_thresh(rbRigidBody *body, float value);
164 
166 void RB_body_set_angular_sleep_thresh(rbRigidBody *body, float value);
167 
168 void RB_body_set_sleep_thresh(rbRigidBody *body, float linear, float angular);
169 
170 /* Linear Velocity */
171 void RB_body_get_linear_velocity(rbRigidBody *body, float v_out[3]);
172 void RB_body_set_linear_velocity(rbRigidBody *body, const float v_in[3]);
173 
174 /* Angular Velocity */
175 void RB_body_get_angular_velocity(rbRigidBody *body, float v_out[3]);
176 void RB_body_set_angular_velocity(rbRigidBody *body, const float v_in[3]);
177 
178 /* Linear/Angular Factor, used to lock translation/rotation axes */
179 void RB_body_set_linear_factor(rbRigidBody *object, float x, float y, float z);
180 void RB_body_set_angular_factor(rbRigidBody *object, float x, float y, float z);
181 
182 /* Kinematic State */
183 void RB_body_set_kinematic_state(rbRigidBody *body, int kinematic);
184 
185 /* RigidBody Interface - Rigid Body Activation States */
187 void RB_body_set_activation_state(rbRigidBody *body, int use_deactivation);
188 void RB_body_activate(rbRigidBody *body);
189 void RB_body_deactivate(rbRigidBody *body);
190 
191 /* Simulation ----------------------- */
192 
193 /* Get current transform matrix of RigidBody to use in Blender (OpenGL format) */
194 void RB_body_get_transform_matrix(rbRigidBody *body, float m_out[4][4]);
195 
196 /* Set RigidBody's location and rotation */
197 void RB_body_set_loc_rot(rbRigidBody *body, const float loc[3], const float rot[4]);
198 /* Set RigidBody's local scaling */
199 void RB_body_set_scale(rbRigidBody *body, const float scale[3]);
200 
201 /* ............ */
202 
203 /* Get RigidBody's position as a vector */
204 void RB_body_get_position(rbRigidBody *body, float v_out[3]);
205 /* Get RigidBody's orientation as a quaternion */
206 void RB_body_get_orientation(rbRigidBody *body, float v_out[4]);
207 /* Get RigidBody's local scale as a vector */
208 void RB_body_get_scale(rbRigidBody *object, float v_out[3]);
209 
210 /* ............ */
211 
212 void RB_body_apply_central_force(rbRigidBody *body, const float v_in[3]);
213 
214 /* ********************************** */
215 /* Collision Shape Methods */
216 
217 /* Setup (Standard Shapes) ----------- */
218 
219 rbCollisionShape *RB_shape_new_box(float x, float y, float z);
221 rbCollisionShape *RB_shape_new_capsule(float radius, float height);
222 rbCollisionShape *RB_shape_new_cone(float radius, float height);
223 rbCollisionShape *RB_shape_new_cylinder(float radius, float height);
224 
225 /* Setup (Convex Hull) ------------ */
226 
228  float *verts, int stride, int count, float margin, bool *can_embed);
229 
230 /* Setup (Triangle Mesh) ---------- */
231 
232 /* 1 */
233 rbMeshData *RB_trimesh_data_new(int num_tris, int num_verts);
234 void RB_trimesh_add_vertices(rbMeshData *mesh, float *vertices, int num_verts, int vert_stride);
236  rbMeshData *mesh, int num, int index0, int index1, int index2);
238 /* 2a - Triangle Meshes */
240 /* 2b - GImpact Meshes */
242 
243 /* Compound Shape ---------------- */
244 
246 void RB_compound_add_child_shape(rbCollisionShape *collisionShape,
247  rbCollisionShape *shape,
248  const float loc[3],
249  const float rot[4]);
250 
251 /* Cleanup --------------------------- */
252 
253 void RB_shape_delete(rbCollisionShape *shape);
254 
255 /* Settings --------------------------- */
256 
257 /* Collision Margin */
259 void RB_shape_set_margin(rbCollisionShape *shape, float value);
260 
262  float *vertices,
263  int num_verts,
264  int vert_stride,
265  float min[3],
266  float max[3]);
267 
268 /* ********************************** */
269 /* Constraints */
270 
271 /* Setup ----------------------------- */
272 
273 /* Add Rigid Body Constraint to simulation world */
274 void RB_dworld_add_constraint(rbDynamicsWorld *world, rbConstraint *con, int disable_collisions);
275 
276 /* Remove Rigid Body Constraint from simulation world */
278 
279 rbConstraint *RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2);
280 rbConstraint *RB_constraint_new_fixed(float pivot[3],
281  float orn[4],
282  rbRigidBody *rb1,
283  rbRigidBody *rb2);
284 rbConstraint *RB_constraint_new_hinge(float pivot[3],
285  float orn[4],
286  rbRigidBody *rb1,
287  rbRigidBody *rb2);
288 rbConstraint *RB_constraint_new_slider(float pivot[3],
289  float orn[4],
290  rbRigidBody *rb1,
291  rbRigidBody *rb2);
292 rbConstraint *RB_constraint_new_piston(float pivot[3],
293  float orn[4],
294  rbRigidBody *rb1,
295  rbRigidBody *rb2);
296 rbConstraint *RB_constraint_new_6dof(float pivot[3],
297  float orn[4],
298  rbRigidBody *rb1,
299  rbRigidBody *rb2);
301  float orn[4],
302  rbRigidBody *rb1,
303  rbRigidBody *rb2);
305  float orn[4],
306  rbRigidBody *rb1,
307  rbRigidBody *rb2);
308 rbConstraint *RB_constraint_new_motor(float pivot[3],
309  float orn[4],
310  rbRigidBody *rb1,
311  rbRigidBody *rb2);
312 
313 /* ............ */
314 
315 /* Cleanup --------------------------- */
316 
318 
319 /* Settings --------------------------- */
320 
321 /* Enable or disable constraint */
323 
324 /* Limits */
325 #define RB_LIMIT_LIN_X 0
326 #define RB_LIMIT_LIN_Y 1
327 #define RB_LIMIT_LIN_Z 2
328 #define RB_LIMIT_ANG_X 3
329 #define RB_LIMIT_ANG_Y 4
330 #define RB_LIMIT_ANG_Z 5
331 /* Bullet uses the following convention:
332  * - lower limit == upper limit -> axis is locked
333  * - lower limit > upper limit -> axis is free
334  * - lower limit < upper limit -> axis is limited in given range
335  */
336 void RB_constraint_set_limits_hinge(rbConstraint *con, float lower, float upper);
337 void RB_constraint_set_limits_slider(rbConstraint *con, float lower, float upper);
339  rbConstraint *con, float lin_lower, float lin_upper, float ang_lower, float ang_upper);
340 void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, float upper);
341 
342 /* 6dof spring specific */
343 void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness);
344 void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping);
345 void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable);
347 
348 /* 6dof spring 2 specific */
349 void RB_constraint_set_limits_6dof_spring2(rbConstraint *con, int axis, float lower, float upper);
350 void RB_constraint_set_stiffness_6dof_spring2(rbConstraint *con, int axis, float stiffness);
351 void RB_constraint_set_damping_6dof_spring2(rbConstraint *con, int axis, float damping);
352 void RB_constraint_set_spring_6dof_spring2(rbConstraint *con, int axis, int enable);
354 
355 /* motors */
356 void RB_constraint_set_enable_motor(rbConstraint *con, int enable_lin, int enable_ang);
358  float max_impulse_lin,
359  float max_impulse_ang);
361  float velocity_lin,
362  float velocity_ang);
363 
364 /* Set number of constraint solver iterations made per step, this overrided world setting
365  * To use default set it to -1 */
366 void RB_constraint_set_solver_iterations(rbConstraint *con, int num_solver_iterations);
367 
368 /* Set breaking impulse threshold, if constraint shouldn't break it can be set to FLT_MAX */
369 void RB_constraint_set_breaking_threshold(rbConstraint *con, float threshold);
370 
371 /* ********************************** */
372 
373 #ifdef __cplusplus
374 }
375 #endif
376 
377 #endif /* __RB_API_H__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
void RB_constraint_set_max_impulse_motor(rbConstraint *con, float max_impulse_lin, float max_impulse_ang)
rbConstraint * RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2)
void RB_dworld_set_solver_iterations(rbDynamicsWorld *world, int num_solver_iterations)
void RB_dworld_set_split_impulse(rbDynamicsWorld *world, int split_impulse)
rbCollisionShape * RB_shape_new_convex_hull(float *verts, int stride, int count, float margin, bool *can_embed)
void RB_dworld_delete(rbDynamicsWorld *world)
rbCollisionShape * RB_shape_new_cone(float radius, float height)
void RB_body_set_collision_shape(rbRigidBody *body, rbCollisionShape *shape)
void RB_body_set_sleep_thresh(rbRigidBody *body, float linear, float angular)
void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness)
void RB_body_set_linear_velocity(rbRigidBody *body, const float v_in[3])
rbCollisionShape * RB_shape_new_box(float x, float y, float z)
void RB_dworld_add_constraint(rbDynamicsWorld *world, rbConstraint *con, int disable_collisions)
void RB_body_set_friction(rbRigidBody *body, float value)
void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping)
rbConstraint * RB_constraint_new_motor(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
int RB_body_get_activation_state(rbRigidBody *body)
void RB_shape_delete(rbCollisionShape *shape)
rbConstraint * RB_constraint_new_piston(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
void RB_body_get_angular_velocity(rbRigidBody *body, float v_out[3])
float RB_body_get_angular_damping(rbRigidBody *body)
void RB_constraint_set_enabled(rbConstraint *con, int enabled)
rbConstraint * RB_constraint_new_6dof_spring(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
void RB_constraint_set_stiffness_6dof_spring2(rbConstraint *con, int axis, float stiffness)
void RB_body_deactivate(rbRigidBody *body)
void RB_constraint_set_equilibrium_6dof_spring(rbConstraint *con)
float RB_body_get_linear_sleep_thresh(rbRigidBody *body)
void RB_constraint_set_limits_slider(rbConstraint *con, float lower, float upper)
rbCollisionShape * RB_shape_new_sphere(float radius)
float RB_body_get_restitution(rbRigidBody *body)
void RB_body_set_kinematic_state(rbRigidBody *body, int kinematic)
void RB_constraint_set_breaking_threshold(rbConstraint *con, float threshold)
void RB_dworld_remove_constraint(rbDynamicsWorld *world, rbConstraint *con)
rbConstraint * RB_constraint_new_hinge(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
rbConstraint * RB_constraint_new_fixed(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
rbDynamicsWorld * RB_dworld_new(const float gravity[3])
void RB_world_convex_sweep_test(rbDynamicsWorld *world, rbRigidBody *object, const float loc_start[3], const float loc_end[3], float v_location[3], float v_hitpoint[3], float v_normal[3], int *r_hit)
void RB_body_set_activation_state(rbRigidBody *body, int use_deactivation)
void RB_constraint_set_enable_motor(rbConstraint *con, int enable_lin, int enable_ang)
void RB_body_get_linear_velocity(rbRigidBody *body, float v_out[3])
void RB_dworld_set_gravity(rbDynamicsWorld *world, const float g_in[3])
rbCollisionShape * RB_shape_new_gimpact_mesh(rbMeshData *mesh)
void RB_trimesh_add_triangle_indices(rbMeshData *mesh, int num, int index0, int index1, int index2)
void RB_trimesh_add_vertices(rbMeshData *mesh, float *vertices, int num_verts, int vert_stride)
void RB_constraint_set_limits_6dof_spring2(rbConstraint *con, int axis, float lower, float upper)
void RB_body_set_loc_rot(rbRigidBody *body, const float loc[3], const float rot[4])
float RB_body_get_angular_sleep_thresh(rbRigidBody *body)
void RB_constraint_set_solver_iterations(rbConstraint *con, int num_solver_iterations)
void RB_shape_trimesh_update(rbCollisionShape *shape, float *vertices, int num_verts, int vert_stride, float min[3], float max[3])
void RB_dworld_add_body(rbDynamicsWorld *world, rbRigidBody *body, int col_groups)
void RB_constraint_set_damping_6dof_spring2(rbConstraint *con, int axis, float damping)
void RB_constraint_delete(rbConstraint *con)
void RB_body_apply_central_force(rbRigidBody *body, const float v_in[3])
void RB_body_set_damping(rbRigidBody *object, float linear, float angular)
rbCollisionShape * RB_shape_new_compound(void)
void RB_dworld_remove_body(rbDynamicsWorld *world, rbRigidBody *body)
void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable)
void RB_shape_set_margin(rbCollisionShape *shape, float value)
void RB_body_activate(rbRigidBody *body)
rbRigidBody * RB_body_new(rbCollisionShape *shape, const float loc[3], const float rot[4])
float RB_body_get_linear_damping(rbRigidBody *body)
void RB_body_get_position(rbRigidBody *body, float v_out[3])
void RB_trimesh_finish(rbMeshData *mesh)
void RB_body_delete(rbRigidBody *body)
void RB_dworld_export(rbDynamicsWorld *world, const char *filename)
void RB_body_set_type(rbRigidBody *body, int type, float mass)
float RB_shape_get_margin(rbCollisionShape *shape)
rbCollisionShape * RB_shape_new_cylinder(float radius, float height)
rbConstraint * RB_constraint_new_6dof_spring2(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
void RB_body_set_mass(rbRigidBody *body, float value)
void RB_constraint_set_limits_piston(rbConstraint *con, float lin_lower, float lin_upper, float ang_lower, float ang_upper)
void RB_dworld_get_gravity(rbDynamicsWorld *world, float g_out[3])
void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, float upper)
void RB_body_set_restitution(rbRigidBody *body, float value)
void RB_compound_add_child_shape(rbCollisionShape *collisionShape, rbCollisionShape *shape, const float loc[3], const float rot[4])
void RB_body_get_orientation(rbRigidBody *body, float v_out[4])
void RB_constraint_set_limits_hinge(rbConstraint *con, float lower, float upper)
rbMeshData * RB_trimesh_data_new(int num_tris, int num_verts)
void RB_constraint_set_target_velocity_motor(rbConstraint *con, float velocity_lin, float velocity_ang)
rbCollisionShape * RB_shape_new_trimesh(rbMeshData *mesh)
float RB_body_get_friction(rbRigidBody *body)
void RB_body_set_angular_velocity(rbRigidBody *body, const float v_in[3])
void RB_body_set_angular_damping(rbRigidBody *body, float value)
void RB_body_set_linear_sleep_thresh(rbRigidBody *body, float value)
float RB_body_get_mass(rbRigidBody *body)
void RB_body_get_transform_matrix(rbRigidBody *body, float m_out[4][4])
void RB_body_set_linear_factor(rbRigidBody *object, float x, float y, float z)
rbConstraint * RB_constraint_new_slider(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
void RB_dworld_step_simulation(rbDynamicsWorld *world, float timeStep, int maxSubSteps, float timeSubStep)
void RB_constraint_set_equilibrium_6dof_spring2(rbConstraint *con)
void RB_body_set_scale(rbRigidBody *body, const float scale[3])
void RB_body_get_scale(rbRigidBody *object, float v_out[3])
rbConstraint * RB_constraint_new_6dof(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
void RB_constraint_set_spring_6dof_spring2(rbConstraint *con, int axis, int enable)
rbCollisionShape * RB_shape_new_capsule(float radius, float height)
void RB_body_set_angular_sleep_thresh(rbRigidBody *body, float value)
void RB_body_set_angular_factor(rbRigidBody *object, float x, float y, float z)
void RB_body_set_linear_damping(rbRigidBody *body, float value)
struct rbConstraint rbConstraint
Definition: RBI_api.h:59
World world
#define rot(x, k)
static float verts[][3]
bool enabled
int count
#define min(a, b)
Definition: sort.c:51
float max