Skip to content
modkitv0.2

box3d.h

#include <modkit/box3d.h>7 functions · 1 structs · 2 typedefs

Experimental Box3D v0.1 interpolation and draw3d bridge.

Functions

mk_box3d_debug_drawfunction

bool mk_box3d_debug_draw(mk_box3d_debug_draw_t adapter, b3WorldId world, mk_draw3d_ctx_t draw3d, const mk_box3d_debug_draw_desc *desc)

Draw authoritative Box3D state into an active draw3d context.

Destroy the Box3D world before destroying its adapter.

ParameterTypeDescription
adaptermk_box3d_debug_draw_tValue for adapter.
worldb3WorldIdValue for world.
draw3dmk_draw3d_ctx_tValue for draw3d.
descconst mk_box3d_debug_draw_desc *Configuration descriptor.

Returns True when the operation succeeds.

mk_box3d_debug_draw_attachfunction

bool mk_box3d_debug_draw_attach(mk_box3d_debug_draw_t adapter, b3WorldDef *world_def)

Install the adapter callbacks on a world definition before b3CreateWorld.

Existing debug-shape callbacks are rejected. An adapter may be attached once.

ParameterTypeDescription
adaptermk_box3d_debug_draw_tValue for adapter.
world_defb3WorldDef *Value for world def.

Returns True when the operation succeeds.

mk_box3d_debug_draw_createfunction

mk_box3d_debug_draw_t mk_box3d_debug_draw_create(void)

Draw create for the box3d debug.

Returns The resulting handle or value.

mk_box3d_debug_draw_desc_defaultfunction

mk_box3d_debug_draw_desc mk_box3d_debug_draw_desc_default(void)

Draw desc default for the box3d debug.

Returns The resulting value.

mk_box3d_debug_draw_destroyfunction

void mk_box3d_debug_draw_destroy(mk_box3d_debug_draw_t adapter)

Draw destroy for the box3d debug.

ParameterTypeDescription
adaptermk_box3d_debug_draw_tValue for adapter.

mk_box3d_transform_lerpfunction

b3WorldTransform mk_box3d_transform_lerp(b3WorldTransform previous, b3WorldTransform current, float alpha)

Interpolate a Box3D world transform for rendering.

ParameterTypeDescription
previousb3WorldTransformValue for previous.
currentb3WorldTransformValue for current.
alphafloatValue for alpha.

Returns The resulting value.

mk_box3d_transform_to_mkfunction

mk_transform mk_box3d_transform_to_mk(b3WorldTransform transform, b3Pos render_origin)

Convert a Box3D transform after shifting by render_origin.

ParameterTypeDescription
transformb3WorldTransformValue for transform.
render_originb3PosValue for render origin.

Returns The resulting value.

Structs

mk_box3d_debug_draw_descstruct

Data for box3d debug draw desc.

FieldTypeDescription
render_originb3PosThe render origin.
drawing_boundsb3AABBThe drawing bounds.
mask_bitsuint64_tThe mask bits.
force_scalefloatThe force scale.
joint_scalefloatThe joint scale.
draw_shapesboolThe draw shapes.
draw_jointsboolThe draw joints.
draw_joint_extrasboolThe draw joint extras.
draw_boundsboolThe draw bounds.
draw_massboolThe draw mass.
draw_body_namesboolThe draw body names.
draw_contactsboolThe draw contacts.
draw_anchor_aintThe draw anchor a.
draw_graph_colorsboolThe draw graph colors.
draw_contact_featuresboolThe draw contact features.
draw_contact_normalsboolThe draw contact normals.
draw_contact_forcesboolThe draw contact forces.
draw_friction_forcesboolThe draw friction forces.
draw_islandsboolThe draw islands.

Typedefs

mk_box3d_debug_draw_desctypedef

typedef struct mk_box3d_debug_draw_desc mk_box3d_debug_draw_desc

Data for box3d debug draw desc.

mk_box3d_debug_draw_ttypedef

typedef struct mk_box3d_debug_draw* mk_box3d_debug_draw_t

Type used for box3d debug draw.