esp::physics::VelocityControl struct

Convenience struct for applying constant velocity control to a rigid body.

Constructors, destructors, conversion operators

~VelocityControl() defaulted virtual

Public functions

auto integrateTransform(float dt, const core::RigidState& rigidState) -> core::RigidState virtual
Compute the result of applying constant control velocities to the provided object transform.

Public variables

Magnum::Vector3 linVel
Constant linear velocity.
Magnum::Vector3 angVel
Constant angular velocity.
bool controllingLinVel
Whether or not to set linear control velocity before stepping.
bool linVelIsLocal
Whether or not to set linear control velocity in local space. Useful for commanding actions such as "forward", or "strafe".
bool controllingAngVel
Whether or not to set angular control velocity before stepping.
bool angVelIsLocal
Whether or not to set angular control velocity in local space. Useful for commanding actions such as "roll" and "yaw".

Function documentation

core::RigidState esp::physics::VelocityControl::integrateTransform(float dt, const core::RigidState& rigidState) virtual

Compute the result of applying constant control velocities to the provided object transform.

Parameters
dt The discrete timestep over which to integrate.
rigidState The initial state of the object before applying velocity control.
Returns The new state of the object after applying velocity control over dt.

For efficiency this function does not support transforms with scaling.

Default implementation uses explicit Euler integration.