C4 Engine
C4 Engine API Documentation

class Force

Defined in:  C4Forces.h
The Force class exerts a force on rigid bodies inside a field.

class Force : public ListElement<Force>, public Packable, public Configurable, public Registrable<Force, ForceRegistration>

Member Functions
Force::GetForceType Returns the force type.
Force::GetTargetField Returns the field to which a force is assigned.
Force::ValidField Returns a boolean value indicating whether the force can be assigned to a particular field node.
Force::ApplyForce Calculates the force to exert on a rigid body or deformable body.

Force(ForceType type);

type The force type.
The Force class represents a generic force that is exerted on rigid bodies inside a field. A subclass of the Force class implements the Force::ApplyForce function in order to define the force that acts upon rigid bodies.

A Force object is assigned to a Field node by calling the Field::SetForce function. The field to which a force is assigned can be retrieved by calling the Force::GetTargetField function.
Base Classes
ListElement<Force> Used internally by the World Manager.
Packable Forces can be packed for storage in resources.
Configurable Forces can define configurable parameters that are exposed as user interface widgets in the World Editor.
Registrable<Force, ForceRegistration> Custom force types can be registered with the engine.
See Also