Static class with helper methods to predict the expected position and velocity of a dynamic body on a given tick in the future.
More...
|
| static Vector2 | PredictPosition (float dt, float ticksAhead, Vector2 initPos, Vector2 initVel, Vector2 gravity, float drag) |
| | Predicts the expected position of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
|
| static Vector3 | PredictPosition (float dt, float ticksAhead, Vector3 initPos, Vector3 initVel, Vector3 gravity, float drag) |
| | Predicts the expected position of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
|
| static Vector2 | PredictVelocity (float dt, float ticksAhead, Vector2 initVel, Vector2 gravity, float drag) |
| | Predicts the expected velocity of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
|
| static Vector3 | PredictVelocity (float dt, float ticksAhead, Vector3 initVel, Vector3 gravity, float drag) |
| | Predicts the expected velocity of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
|
Static class with helper methods to predict the expected position and velocity of a dynamic body on a given tick in the future.
◆ PredictPosition() [1/2]
| Vector2 PredictPosition |
( |
float | dt, |
|
|
float | ticksAhead, |
|
|
Vector2 | initPos, |
|
|
Vector2 | initVel, |
|
|
Vector2 | gravity, |
|
|
float | drag ) |
|
static |
Predicts the expected position of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
- Parameters
-
| dt | Delta time of each integration step. |
| ticksAhead | How many ticks ahead the prediction will be, where each tick is dt long. |
| initPos | The initial position of the object, before the prediction. |
| initVel | The initial velocity of the object, before the prediction. |
| gravity | The gravity force which the object is subject to. |
| drag | Drag factor of the dynamic body. |
- Returns
- The predicted position.
- Exceptions
-
| InvalidOperationException | if ticksAhead is smaller than 0. |
◆ PredictPosition() [2/2]
| Vector3 PredictPosition |
( |
float | dt, |
|
|
float | ticksAhead, |
|
|
Vector3 | initPos, |
|
|
Vector3 | initVel, |
|
|
Vector3 | gravity, |
|
|
float | drag ) |
|
static |
Predicts the expected position of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
- Parameters
-
| dt | Delta time of each integration step. |
| ticksAhead | How many ticks ahead the prediction will be, where each tick is dt long. |
| initPos | The initial position of the object, before the prediction. |
| initVel | The initial velocity of the object, before the prediction. |
| gravity | The gravity force which the object is subject to. |
| drag | Drag factor of the dynamic body. |
- Returns
- The predicted position.
- Exceptions
-
| InvalidOperationException | if ticksAhead is smaller than 0. |
◆ PredictVelocity() [1/2]
| Vector2 PredictVelocity |
( |
float | dt, |
|
|
float | ticksAhead, |
|
|
Vector2 | initVel, |
|
|
Vector2 | gravity, |
|
|
float | drag ) |
|
static |
Predicts the expected velocity of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
- Parameters
-
| dt | Delta time of each integration step. |
| ticksAhead | How many ticks ahead the prediction will be, where each tick is dt long. |
| initVel | The initial velocity of the object, before the prediction. |
| gravity | The gravity force which the object is subject to. |
| drag | Drag factor of the dynamic body. |
- Returns
- The predicted velocity.
- Exceptions
-
| InvalidOperationException | if ticksAhead is smaller than 0. |
◆ PredictVelocity() [2/2]
| Vector3 PredictVelocity |
( |
float | dt, |
|
|
float | ticksAhead, |
|
|
Vector3 | initVel, |
|
|
Vector3 | gravity, |
|
|
float | drag ) |
|
static |
Predicts the expected velocity of a dynamic physics body on a given tick in the future, taking into consideration gravity and the drag force.
- Parameters
-
| dt | Delta time of each integration step. |
| ticksAhead | How many ticks ahead the prediction will be, where each tick is dt long. |
| initVel | The initial velocity of the object, before the prediction. |
| gravity | The gravity force which the object is subject to. |
| drag | Drag factor of the dynamic body. |
- Returns
- The predicted velocity.
- Exceptions
-
| InvalidOperationException | if ticksAhead is smaller than 0. |