Trade-offs and warnings
Consult the linked header for this operation’s ownership, lifetime and failure behavior.
EPOK RUNTIME
Method · 1 overload
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.
True once when the body starts touching something; `get_impact` is how hard (px/s).
bool take_contact()True once when the body starts touching something; `get_impact` is how hard (px/s).
This overload takes no parameters.
Returns: bool. Consult the linked header for its meaning.
#include "world2d_physics.hpp"
epok::RigidBody2DComponent& object = /* obtain a valid instance */;
auto result = object.take_contact();Consult the linked header for this operation’s ownership, lifetime and failure behavior.
Declared in runtime/world2d_physics.hpp:82
apply_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.Method