Blender  V3.3
RBI_api.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2013 Blender Foundation. All rights reserved. */
3 
9 #ifndef __RB_API_H__
10 #define __RB_API_H__
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /* API Notes:
17  * Currently, this API is optimized for Bullet RigidBodies, and doesn't
18  * take into account other Physics Engines. Some tweaking may be necessary
19  * to allow other systems to be used, in particular there may be references
20  * to datatypes that aren't used here...
21  *
22  * -- Joshua Leung (22 June 2010)
23  */
24 
25 /* ********************************** */
26 /* Partial Type Defines - Aliases for the type of data we store */
27 
28 // ----------
29 
30 /* Dynamics World */
31 typedef struct rbDynamicsWorld rbDynamicsWorld;
32 
33 /* Rigid Body */
34 typedef struct rbRigidBody rbRigidBody;
35 
36 /* Collision Shape */
37 typedef struct rbCollisionShape rbCollisionShape;
38 
39 /* Mesh Data (for Collision Shapes of Meshes) */
40 typedef struct rbMeshData rbMeshData;
41 
42 /* Constraint */
43 typedef struct rbConstraint rbConstraint;
44 
45 /* ********************************** */
46 /* Dynamics World Methods */
47 
48 /* Setup ---------------------------- */
49 
50 /* Create a new dynamics world instance */
51 /* TODO: add args to set the type of constraint solvers, etc. */
52 rbDynamicsWorld *RB_dworld_new(const float gravity[3]);
53 
54 /* Delete the given dynamics world, and free any extra data it may require */
56 
57 /* Settings ------------------------- */
58 
59 /* Gravity */
60 void RB_dworld_get_gravity(rbDynamicsWorld *world, float g_out[3]);
61 void RB_dworld_set_gravity(rbDynamicsWorld *world, const float g_in[3]);
62 
63 /* Constraint Solver */
64 void RB_dworld_set_solver_iterations(rbDynamicsWorld *world, int num_solver_iterations);
65 /* Split Impulse */
66 void RB_dworld_set_split_impulse(rbDynamicsWorld *world, int split_impulse);
67 
68 /* Simulation ----------------------- */
69 
70 /* Step the simulation by the desired amount (in seconds) with extra controls on substep sizes and
71  * maximum substeps */
73  float timeStep,
74  int maxSubSteps,
75  float timeSubStep);
76 
77 /* Export -------------------------- */
78 
79 /* Exports the dynamics world to physics simulator's serialisation format */
80 void RB_dworld_export(rbDynamicsWorld *world, const char *filename);
81 
82 /* ********************************** */
83 /* Rigid Body Methods */
84 
85 /* Setup ---------------------------- */
86 
87 /* Add RigidBody to dynamics world */
88 void RB_dworld_add_body(rbDynamicsWorld *world, rbRigidBody *body, int col_groups);
89 
90 /* Remove RigidBody from dynamics world */
92 
93 /* Collision detection */
94 
96  rbRigidBody *object,
97  const float loc_start[3],
98  const float loc_end[3],
99  float v_location[3],
100  float v_hitpoint[3],
101  float v_normal[3],
102  int *r_hit);
103 
104 /* ............ */
105 
106 /* Create new RigidBody instance */
107 rbRigidBody *RB_body_new(rbCollisionShape *shape, const float loc[3], const float rot[4]);
108 
109 /* Delete the given RigidBody instance */
110 void RB_body_delete(rbRigidBody *body);
111 
112 /* Settings ------------------------- */
113 
114 /* 'Type' */
115 void RB_body_set_type(rbRigidBody *body, int type, float mass);
116 
117 /* ............ */
118 
119 /* Collision Shape */
121 
122 /* ............ */
123 
124 /* Mass */
125 float RB_body_get_mass(rbRigidBody *body);
126 void RB_body_set_mass(rbRigidBody *body, float value);
127 
128 /* Friction */
129 float RB_body_get_friction(rbRigidBody *body);
130 void RB_body_set_friction(rbRigidBody *body, float value);
131 
132 /* Restitution */
134 void RB_body_set_restitution(rbRigidBody *body, float value);
135 
136 /* Damping */
138 void RB_body_set_linear_damping(rbRigidBody *body, float value);
139 
141 void RB_body_set_angular_damping(rbRigidBody *body, float value);
142 
143 void RB_body_set_damping(rbRigidBody *object, float linear, float angular);
144 
145 /* Sleeping Thresholds */
147 void RB_body_set_linear_sleep_thresh(rbRigidBody *body, float value);
148 
150 void RB_body_set_angular_sleep_thresh(rbRigidBody *body, float value);
151 
152 void RB_body_set_sleep_thresh(rbRigidBody *body, float linear, float angular);
153 
154 /* Linear Velocity */
155 void RB_body_get_linear_velocity(rbRigidBody *body, float v_out[3]);
156 void RB_body_set_linear_velocity(rbRigidBody *body, const float v_in[3]);
157 
158 /* Angular Velocity */
159 void RB_body_get_angular_velocity(rbRigidBody *body, float v_out[3]);
160 void RB_body_set_angular_velocity(rbRigidBody *body, const float v_in[3]);
161 
162 /* Linear/Angular Factor, used to lock translation/rotation axes */
163 void RB_body_set_linear_factor(rbRigidBody *object, float x, float y, float z);
164 void RB_body_set_angular_factor(rbRigidBody *object, float x, float y, float z);
165 
166 /* Kinematic State */
167 void RB_body_set_kinematic_state(rbRigidBody *body, int kinematic);
168 
169 /* RigidBody Interface - Rigid Body Activation States */
171 void RB_body_set_activation_state(rbRigidBody *body, int use_deactivation);
172 void RB_body_activate(rbRigidBody *body);
173 void RB_body_deactivate(rbRigidBody *body);
174 
175 /* Simulation ----------------------- */
176 
177 /* Get current transform matrix of RigidBody to use in Blender (OpenGL format) */
178 void RB_body_get_transform_matrix(rbRigidBody *body, float m_out[4][4]);
179 
180 /* Set RigidBody's location and rotation */
181 void RB_body_set_loc_rot(rbRigidBody *body, const float loc[3], const float rot[4]);
182 /* Set RigidBody's local scaling */
183 void RB_body_set_scale(rbRigidBody *body, const float scale[3]);
184 
185 /* ............ */
186 
187 /* Get RigidBody's position as a vector */
188 void RB_body_get_position(rbRigidBody *body, float v_out[3]);
189 /* Get RigidBody's orientation as a quaternion */
190 void RB_body_get_orientation(rbRigidBody *body, float v_out[4]);
191 /* Get RigidBody's local scale as a vector */
192 void RB_body_get_scale(rbRigidBody *object, float v_out[3]);
193 
194 /* ............ */
195 
196 void RB_body_apply_central_force(rbRigidBody *body, const float v_in[3]);
197 
198 /* ********************************** */
199 /* Collision Shape Methods */
200 
201 /* Setup (Standard Shapes) ----------- */
202 
203 rbCollisionShape *RB_shape_new_box(float x, float y, float z);
205 rbCollisionShape *RB_shape_new_capsule(float radius, float height);
206 rbCollisionShape *RB_shape_new_cone(float radius, float height);
207 rbCollisionShape *RB_shape_new_cylinder(float radius, float height);
208 
209 /* Setup (Convex Hull) ------------ */
210 
212  float *verts, int stride, int count, float margin, bool *can_embed);
213 
214 /* Setup (Triangle Mesh) ---------- */
215 
216 /* 1 */
217 rbMeshData *RB_trimesh_data_new(int num_tris, int num_verts);
218 void RB_trimesh_add_vertices(rbMeshData *mesh, float *vertices, int num_verts, int vert_stride);
220  rbMeshData *mesh, int num, int index0, int index1, int index2);
222 /* 2a - Triangle Meshes */
224 /* 2b - GImpact Meshes */
226 
227 /* Compound Shape ---------------- */
228 
230 void RB_compound_add_child_shape(rbCollisionShape *collisionShape,
231  rbCollisionShape *shape,
232  const float loc[3],
233  const float rot[4]);
234 
235 /* Cleanup --------------------------- */
236 
237 void RB_shape_delete(rbCollisionShape *shape);
238 
239 /* Settings --------------------------- */
240 
241 /* Collision Margin */
243 void RB_shape_set_margin(rbCollisionShape *shape, float value);
244 
246  float *vertices,
247  int num_verts,
248  int vert_stride,
249  const float min[3],
250  const float max[3]);
251 
252 /* ********************************** */
253 /* Constraints */
254 
255 /* Setup ----------------------------- */
256 
257 /* Add Rigid Body Constraint to simulation world */
258 void RB_dworld_add_constraint(rbDynamicsWorld *world, rbConstraint *con, int disable_collisions);
259 
260 /* Remove Rigid Body Constraint from simulation world */
262 
263 rbConstraint *RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2);
264 rbConstraint *RB_constraint_new_fixed(float pivot[3],
265  float orn[4],
266  rbRigidBody *rb1,
267  rbRigidBody *rb2);
268 rbConstraint *RB_constraint_new_hinge(float pivot[3],
269  float orn[4],
270  rbRigidBody *rb1,
271  rbRigidBody *rb2);
272 rbConstraint *RB_constraint_new_slider(float pivot[3],
273  float orn[4],
274  rbRigidBody *rb1,
275  rbRigidBody *rb2);
276 rbConstraint *RB_constraint_new_piston(float pivot[3],
277  float orn[4],
278  rbRigidBody *rb1,
279  rbRigidBody *rb2);
280 rbConstraint *RB_constraint_new_6dof(float pivot[3],
281  float orn[4],
282  rbRigidBody *rb1,
283  rbRigidBody *rb2);
285  float orn[4],
286  rbRigidBody *rb1,
287  rbRigidBody *rb2);
289  float orn[4],
290  rbRigidBody *rb1,
291  rbRigidBody *rb2);
292 rbConstraint *RB_constraint_new_motor(float pivot[3],
293  float orn[4],
294  rbRigidBody *rb1,
295  rbRigidBody *rb2);
296 
297 /* ............ */
298 
299 /* Cleanup --------------------------- */
300 
302 
303 /* Settings --------------------------- */
304 
305 /* Enable or disable constraint */
307 
308 /* Limits */
309 #define RB_LIMIT_LIN_X 0
310 #define RB_LIMIT_LIN_Y 1
311 #define RB_LIMIT_LIN_Z 2
312 #define RB_LIMIT_ANG_X 3
313 #define RB_LIMIT_ANG_Y 4
314 #define RB_LIMIT_ANG_Z 5
315 /* Bullet uses the following convention:
316  * - lower limit == upper limit -> axis is locked
317  * - lower limit > upper limit -> axis is free
318  * - lower limit < upper limit -> axis is limited in given range
319  */
320 void RB_constraint_set_limits_hinge(rbConstraint *con, float lower, float upper);
321 void RB_constraint_set_limits_slider(rbConstraint *con, float lower, float upper);
323  rbConstraint *con, float lin_lower, float lin_upper, float ang_lower, float ang_upper);
324 void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, float upper);
325 
326 /* 6dof spring specific */
327 void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness);
328 void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping);
329 void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable);
331 
332 /* 6dof spring 2 specific */
333 void RB_constraint_set_limits_6dof_spring2(rbConstraint *con, int axis, float lower, float upper);
334 void RB_constraint_set_stiffness_6dof_spring2(rbConstraint *con, int axis, float stiffness);
335 void RB_constraint_set_damping_6dof_spring2(rbConstraint *con, int axis, float damping);
336 void RB_constraint_set_spring_6dof_spring2(rbConstraint *con, int axis, int enable);
338 
339 /* motors */
340 void RB_constraint_set_enable_motor(rbConstraint *con, int enable_lin, int enable_ang);
342  float max_impulse_lin,
343  float max_impulse_ang);
345  float velocity_lin,
346  float velocity_ang);
347 
348 /* Set number of constraint solver iterations made per step, this overrided world setting
349  * To use default set it to -1 */
350 void RB_constraint_set_solver_iterations(rbConstraint *con, int num_solver_iterations);
351 
352 /* Set breaking impulse threshold, if constraint shouldn't break it can be set to FLT_MAX */
354 
355 /* ********************************** */
356 
357 #ifdef __cplusplus
358 }
359 #endif
360 
361 #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 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 type
_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_shape_trimesh_update(rbCollisionShape *shape, float *vertices, int num_verts, int vert_stride, const float min[3], const float max[3])
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_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:43
World world
#define rot(x, k)
static float verts[][3]
bool enabled
int count
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
#define min(a, b)
Definition: sort.c:35
float max