vOOlkan
An object oriented approach to Vulkan
Vulkan::Physics::Field Class Reference

A force Field is an object which can interact with other objects with a force, defined by its calculateForce function. More...

#include <Field.h>

Public Member Functions

 Field (Position position, Force(*calculateForce)(const Position &, const Cinematicable &))
 A force Field is identified by its position and a function. More...
 
Position getPosition () const
 
void setPosition (Position position)
 
Force calculateAppliedForce (const Cinematicable &body)
 Returns the force applied by the field to a body. More...
 

Detailed Description

A force Field is an object which can interact with other objects with a force, defined by its calculateForce function.

Constructor & Destructor Documentation

◆ Field()

Vulkan::Physics::Field::Field ( Position  position,
Force(*)(const Position &, const Cinematicable &)  calculateForce 
)
inline

A force Field is identified by its position and a function.

Parameters
positionThe position of che "center" of the field.
calculateForceA function which returns the force applied by the field to the object. Such force can be based on all of the characteristics of the object inside the field, such as its position, mass or speed. Therefore a field can also be used to compute forces like friction.

Member Function Documentation

◆ calculateAppliedForce()

Force Vulkan::Physics::Field::calculateAppliedForce ( const Cinematicable body)
inline

Returns the force applied by the field to a body.

Parameters
bodyAn object under the influx of this force field.
Returns
The Force applied by the force field to the body.

◆ getPosition()

Position Vulkan::Physics::Field::getPosition ( ) const
inline

◆ setPosition()

void Vulkan::Physics::Field::setPosition ( Position  position)
inline

The documentation for this class was generated from the following file: