C4 Engine
C4 Engine API Documentation

RigidBodyController::SetExternalLinearResistance

Defined in:  C4Physics.h
Sets the external resistive force acting on the linear velocity of a rigid body.
Prototype

void SetExternalLinearResistance(const Vector2D& resistance);

void SetExternalLinearResistance(const Vector3D& resistance);

Parameters
resistance The new external resistive force, in world-space coordinates.
Description
The SetExternalLinearResistance function sets the external resistive force, in world-space coordinates, acting on the linear velocity of a rigid body to the resistance specified by the resistance parameter. The resistive force is measured in kilonewtons per meter-per-second (kN⋅s⋅m−1). If a 2D vector is specified, then the z coordinate of the resistance is zero.

Once an external resistance is established, it is applied continuously until it is removed. The force due to the resistance is calculated by multiplying the current linear velocity by the external linear resistance componentwise. This force is then subtracted from the total force applied to a rigid body.

The initial value of the external resistive force is (0,0,0).
See Also

RigidBodyController::GetExternalLinearResistance

RigidBodyController::GetExternalForce

RigidBodyController::SetExternalForce