Registers and holds individual PlanetGravity instances. Also provides the main function for calculating the gravity vector at a specified position in a stage's space.
More...
#include <PlanetGravityManager.hpp>
|
| void | sortGravities () |
| | Sorts all PlanetGravity instances by their priority in reverse order. The higher the priority is, the lower it gets positioned in the array.
|
| |
| void | bubbleDown (int i) |
| | Swaps the PlanetGravity instance at the specified index with the one instance right before it.
|
| |
Registers and holds individual PlanetGravity instances. Also provides the main function for calculating the gravity vector at a specified position in a stage's space.
Definition at line 9 of file PlanetGravityManager.hpp.
◆ PlanetGravityManager()
| PlanetGravityManager::PlanetGravityManager |
( |
const char * | pName | ) |
|
◆ ~PlanetGravityManager()
| virtual PlanetGravityManager::~PlanetGravityManager |
( |
| ) |
|
|
inlinevirtual |
◆ init()
| void PlanetGravityManager::init |
( |
const JMapInfoIter & | rIter | ) |
|
|
virtual |
◆ calcTotalGravityVector()
| bool PlanetGravityManager::calcTotalGravityVector |
( |
TVec3f * | pGravity, |
|
|
GravityInfo * | pInfo, |
|
|
const TVec3f & | rPosition, |
|
|
u32 | gravityType, |
|
|
u32 | requester ) const |
Calculates the total gravity vector at the specified position in space. If the object that requests gravity matches the host of one or more gravity instances, these instances won't be taken into account when calculating the total gravity vector. Furthermore, gravity instances that do not affect the specified gravity contexts will be ignored as well.
- Parameters
-
| pGravity | The 3D vector to store the total gravity vector in. |
| pInfo | Holder to be filled with information about highest priority gravity affecting the position. |
| rPosition | The position in space to calculate the gravity at. |
| gravityType | The affected gravity context (normal, shadow, magnet, etc.) |
| requester | The pointer of the object requesting the gravity vector. |
Definition at line 11 of file PlanetGravityManager.cpp.
◆ registerGravity()
| void PlanetGravityManager::registerGravity |
( |
PlanetGravity * | pGravity | ) |
|
Registers a PlanetGravity instance to the array of gravities. The higher the gravity's priority is, the closer it will be placed towards the array's beginning.
- Parameters
-
Definition at line 90 of file PlanetGravityManager.cpp.
◆ sortGravities()
| void PlanetGravityManager::sortGravities |
( |
| ) |
|
|
inlineprivate |
Sorts all PlanetGravity instances by their priority in reverse order. The higher the priority is, the lower it gets positioned in the array.
Definition at line 98 of file PlanetGravityManager.cpp.
◆ bubbleDown()
| void PlanetGravityManager::bubbleDown |
( |
int | i | ) |
|
|
inlineprivate |
Swaps the PlanetGravity instance at the specified index with the one instance right before it.
- Parameters
-
| i | The index of the instance to be bubbled down. |
Definition at line 109 of file PlanetGravityManager.cpp.
◆ mGravities
◆ mNumGravities
| s32 PlanetGravityManager::mNumGravities |
|
private |