EPOK RUNTIME
epok::RigidBody2DComponent
Class
Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.
Class
---- RigidBody2D ---------------------------------------------------------------------------
Basic usage
This generated sketch illustrates syntax for reaching the type; adapt it to the actual API contract. Open a member below for an operation-specific example.
C++ example
#include "world2d_physics.hpp"
epok::RigidBody2DComponent& value = /* obtain a valid instance from your game */;Fields and constants
angular_velocityExposes `angular_velocity` on `epok::RigidBody2DComponent` for the world2d physics module.FieldbounceAuthored.Fieldcan_sleepExposes `can_sleep` on `epok::RigidBody2DComponent` for the world2d physics module.Fieldcollision_maskExposes `collision_mask` on `epok::RigidBody2DComponent` for the world2d physics module.FieldcontactExposes `contact` on `epok::RigidBody2DComponent` for the world2d physics module.FieldforceExposes `force` on `epok::RigidBody2DComponent` for the world2d physics module.FieldfrictionAuthored.FieldfrozenExposes `frozen` on `epok::RigidBody2DComponent` for the world2d physics module.FieldgravityExposes `gravity` on `epok::RigidBody2DComponent` for the world2d physics module.FieldimpactExposes `impact` on `epok::RigidBody2DComponent` for the world2d physics module.Fieldlinear_dampingAuthored.Fieldlink2dExposes `link2d` on `epok::RigidBody2DComponent` for the world2d physics module.FieldmassAuthored.FieldpushableExposes `pushable` on `epok::RigidBody2DComponent` for the world2d physics module.Fieldrest_clockExposes `rest_clock` on `epok::RigidBody2DComponent` for the world2d physics module.FieldrollsExposes `rolls` on `epok::RigidBody2DComponent` for the world2d physics module.FieldsleepingExposes `sleeping` on `epok::RigidBody2DComponent` for the world2d physics module.Fieldstatic_class_idExposes `static_class_id` on `epok::RigidBody2DComponent` for the world2d physics module.VariabletouchingExposes `touching` on `epok::RigidBody2DComponent` for the world2d physics module.FieldvelocityState.FieldPublic methods
~RigidBody2DComponentReleases the resources owned by `epok::RigidBody2DComponent`.destructorapply_forceA force for the next simulation step only (call it every tick to keep pushing).Methodapply_impulsePerforms `apply impulse` as part of the world2d physics module.Methodclass_idPerforms `class id` as part of the world2d physics module.Methodget_angular_velocityReturns angular velocity as part of the world2d physics module.Methodget_impactReturns impact as part of the world2d physics module.Methodget_velocity_xReturns velocity x as part of the world2d physics module.Methodget_velocity_yReturns velocity y as part of the world2d physics module.Methodinverse_massInverse mass in Q12 per unit: 0 for a frozen (immovable) body.Methodis_frozenReports whether frozen as part of the world2d physics module.Methodis_sleepingReports whether sleeping as part of the world2d physics module.Methodis_touchingReports whether touching as part of the world2d physics module.Methodlevel_attachedPerforms `level attached` as part of the world2d physics module.Methodset_frozenA frozen body stays where it is and blocks like a static one.Methodset_velocitySets velocity as part of the world2d physics module.Methodtake_contactTrue once when the body starts touching something; `get_impact` is how hard (px/s).MethodwakePerforms `wake` as part of the world2d physics module.Method