Epok Engine

EPOK RUNTIME

World2D Physics

world2d_physics.hpp · the world2d physics module

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.

Module

the world2d physics module.

Header
world2d_physics.hpp
Include
#include "world2d_physics.hpp"
Stability
Epok runtime API

Include this module

C++ include
#include "world2d_physics.hpp"

Types

Functions and methods

~Joint2DComponentReleases the resources owned by `epok::Joint2DComponent`.destructor~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.Methodbreak_jointCuts the joint for good: the rope snaps.Methodclass_idPerforms `class id` 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_lengthReturns length 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_enabledReports whether enabled as part of the world2d physics module.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.Methodlevel_attachedPerforms `level attached` as part of the world2d physics module.Methodset_enabledSets enabled as part of the world2d physics module.Methodset_frozenA frozen body stays where it is and blocks like a static one.Methodset_lengthSets length as part of the world2d physics module.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

Fields, variables and values

angular_velocityExposes `angular_velocity` on `epok::RigidBody2DComponent` for the world2d physics module.Fieldbody_a`body_a` empty: the joint node's own position is the fixed end.Fieldbody_b`body_a` empty: the joint node's own position is the fixed end.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.FielddampingExposes `damping` on `epok::Joint2DComponent` for the world2d physics module.FieldenabledExposes `enabled` on `epok::Joint2DComponent` 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.FieldjointsExposes `joints` on the `epok::world2d` namespace for the world2d physics module.VariablekindExposes `kind` on `epok::Joint2DComponent` for the world2d physics module.FieldlengthExposes `length` on `epok::Joint2DComponent` for the world2d physics module.Fieldlinear_dampingAuthored.Fieldlink2dExposes `link2d` on `epok::Joint2DComponent` for the world2d physics module.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.Fieldrigid_bodiesExposes `rigid_bodies` on the `epok::world2d` namespace for the world2d physics module.VariableRodNamed value `Rod` in `epok::JointKind2D`.Enum valuerollsExposes `rolls` on `epok::RigidBody2DComponent` for the world2d physics module.FieldRopeNamed value `Rope` in `epok::JointKind2D`.Enum valuesleepingExposes `sleeping` on `epok::RigidBody2DComponent` for the world2d physics module.FieldSpringNamed value `Spring` in `epok::JointKind2D`.Enum valuestatic_class_idExposes `static_class_id` on `epok::Joint2DComponent` for the world2d physics module.Variablestatic_class_idExposes `static_class_id` on `epok::RigidBody2DComponent` for the world2d physics module.VariablestiffnessExposes `stiffness` on `epok::Joint2DComponent` for the world2d physics module.FieldtouchingExposes `touching` on `epok::RigidBody2DComponent` for the world2d physics module.FieldvelocityState.Field