DetPhysDocs日本語

detphys_body.hbodies, shapes, readback for drawing (version 2)

FunctionDescription
detphys_body_abi_versionThis header's version
detphys_shape_desc_defaultDefault shape settings (friction 600, density 1000, restitution 0, × 1000)
detphys_body_desc_defaultDefault body settings (dynamic body)
detphys_world_add_meshCopies and registers a .dnshape. Returns its number (from 0)Usage: Concepts › Concave shapes and the baker
detphys_world_mesh_countNumber of registered shapes
detphys_world_mesh_infoShape information (convex polygons, vertices, radius, checksum)
detphys_world_mesh_readReads the convex polygons' vertices [m] for drawing
detphys_world_add_bodyCreates a body. Returns its ID (creation-order serial number)
detphys_world_add_shapeAdds a shape to a body
detphys_world_remove_bodyRemoves a body (IDs are not compacted)
detphys_world_set_transformSets position and angle directly (mm, mrad)
detphys_world_set_velocitySets velocity (mm/s, mrad/s)
detphys_world_apply_forceApplies a force (mN, for the next tick only)
detphys_world_apply_impulseApplies an impulse (mN·s, changes velocity at once)
detphys_world_body_countBodies created (including removed ones)
detphys_world_awake_countAwake dynamic bodies (0 = settled)
detphys_world_get_bodyReads one body's current state
detphys_world_read_bodiesReads all bodies into an array (fine every frame; does not affect the simulation)
detphys_world_body_shapesReads the shapes attached to a body
StructDescription
detphys_shape_descOne shape (DETPHYS_SHAPE_MESH / BOX / CIRCLE, size, offset, material)
detphys_body_descBody settings (type DETPHYS_BODY_STATIC / KINEMATIC / DYNAMIC, position, velocity, damping, flags [DETPHYS_BODY_FLAG_BULLET], tag, first shape)
detphys_body_viewRead-back state (ID, type, flags, tag, shape, integer pose x_mm/y_mm/angle_mrad, floats for drawing)Usage: Determinism rules › 2. Never put floats into the simulation
detphys_mesh_infoInformation about a registered shape

↑↓ to choose, Enter to open, Esc to close