|
hx3d
1
2D/3D Simple Game Framework
|
Zone attractor. More...
#include <zone_attractor.hpp>
Classes | |
| struct | Definition |
| Zone attractor definition. More... | |
Public Member Functions | |
| ZoneAttractor () | |
| Create an empty zone attractor. | |
| ZoneAttractor (const Definition &def) | |
| Create a zone attractor using a definition. More... | |
| void | useDefinition (const Definition &def) |
| Use a definition on the zone attractor. More... | |
| virtual bool | overlaps (const Ptr< Collider > &collider) override |
| Check if a collider overlaps the attractor. More... | |
| virtual void | computeForce (const Ptr< Collider > &collider, const float dt) override |
| Compute the gravity force on a collider. More... | |
Public Member Functions inherited from hx3d::physics2d::Attractor | |
| Attractor (Type type) | |
| Create an attractor. More... | |
Public Attributes | |
| glm::vec2 | position |
| Zone position. | |
| glm::vec2 | velocity |
| Zone velocity. | |
| float | width |
| Zone width. | |
| float | height |
| Zone height. | |
Public Attributes inherited from hx3d::physics2d::Attractor | |
| Type | type |
| Attractor type. | |
| unsigned int | priority |
| Attractor priority. | |
Additional Inherited Members | |
Public Types inherited from hx3d::physics2d::Attractor | |
Static Public Member Functions inherited from hx3d::physics2d::Attractor | |
| static void | setCurrentAttractor (const Ptr< Collider > &collider, const Ptr< Attractor > &attractor, const float dt) |
| Defines the current attractor on a collider. More... | |
| static void | applyForce (const Ptr< Collider > &collider, const Ptr< Attractor > &attractor, const float dt) |
| Apply an attractor force on a collider. More... | |
Zone attractor.
Definition at line 32 of file zone_attractor.hpp.
|
explicit |
Create a zone attractor using a definition.
| def | Definition |
Definition at line 18 of file zone_attractor.cpp.
|
overridevirtual |
Compute the gravity force on a collider.
| collider | Collider (Ptr) |
| dt | Delta time |
Implements hx3d::physics2d::Attractor.
Definition at line 44 of file zone_attractor.cpp.
Check if a collider overlaps the attractor.
| collider | Collider (Ptr) |
Implements hx3d::physics2d::Attractor.
Definition at line 32 of file zone_attractor.cpp.
| void hx3d::physics2d::ZoneAttractor::useDefinition | ( | const Definition & | def | ) |
Use a definition on the zone attractor.
| def | Definition |
Definition at line 24 of file zone_attractor.cpp.
1.8.11