Directional force represented by direction and magnitude.
More...
#include <spk_force_2d.hpp>
|
|
| Force2D ()=default |
| | Creates a zero force.
|
| | Force2D (const spk::Vector2 &p_direction, const float &p_magnitude) |
| | Creates a force from direction and magnitude.
|
| spk::Vector2 | vector () const |
| | Returns the force vector.
|
|
|
spk::Vector2 | direction = {0.0f, 0.0f} |
| | Normalized direction of the force.
|
|
float | magnitude = 0.0f |
| | Force magnitude.
|
Directional force represented by direction and magnitude.
◆ Force2D()
| spk::Force2D::Force2D |
( |
const spk::Vector2 & | p_direction, |
|
|
const float & | p_magnitude ) |
|
inline |
Creates a force from direction and magnitude.
- Parameters
-
| p_direction | Unit direction of the force. |
| p_magnitude | Magnitude of the force. |
◆ fromVector()
Builds a force from a vector.
- Parameters
-
| p_vector | Vector whose length becomes magnitude. |
- Returns
- Force representing the same vector.
◆ vector()
Returns the force vector.
- Returns
- Direction multiplied by magnitude.
The documentation for this struct was generated from the following file: