#include <RigidBody.hpp>
|
static void | addObserver (shared_ptr< Observer > observer) |
|
static void | removeObserver (shared_ptr< Observer > observer) |
|
void | setCopyMode (bool initWithData) |
|
static void | notify (ComponentEventType type, shared_ptr< Component > component, bool isEditor) |
|
static void | notify (ActorEventType type, shared_ptr< Actor > actor, bool isEditor) |
|
bool | initWithData |
|
bool | isActive |
|
RigidBody is the component that adds real physics simulation to an Actor. It's dynamic and directly influences in the Transform of the Actor due to physics simulation
RigidBody::~RigidBody |
( |
| ) |
|
|
virtual |
void RigidBody::addForce |
( |
glm::vec3 |
axis | ) |
|
Add force to the RigidBody
- Parameters
-
[in] | the | force that will be added (direction and magnitude) |
void RigidBody::destroy |
( |
| ) |
|
|
overridevirtual |
int RigidBody::getConstraintsFlags |
( |
| ) |
|
Set the translation/rotation constraints of the rigidbody.
- Returns
- current constraints of the rigidbody s
bool RigidBody::getGravity |
( |
| ) |
|
gravity getter
- Returns
- true if gravity is enabled, false otherwise
bool RigidBody::getKinematic |
( |
| ) |
|
isKinematic getter
- Returns
- true if physics is being simulated, false if it's not
PxRigidBody * RigidBody::getRigidbody |
( |
| ) |
|
physxRigidBody getter
- Returns
- pointer to PhysX RigidBody
Component init override. Creates a RigidDynamic body in the PhysX scene
Reimplemented from Component.
void RigidBody::setActive |
( |
bool |
isActive | ) |
|
|
overridevirtual |
Component setActive override. Disables visualization and physics simulation in the PhysX scene
Reimplemented from Component.
void RigidBody::setConstraintsFlags |
( |
int |
constraintFlags | ) |
|
Set the translation/rotation constraints of the rigidbody.
- Parameters
-
void RigidBody::setGravity |
( |
bool |
enabled | ) |
|
gravity setter
- Parameters
-
[in] | enabled | true if gravity is enabled, false otherwise |
void RigidBody::setKinematic |
( |
bool |
isKinematic | ) |
|
isKinematic setter
- Parameters
-
true | if physics should be not be simulated, false if it should |
void RigidBody::tick |
( |
float |
deltaSeconds | ) |
|
|
overridevirtual |
Component tick override. Updates the PhysX scene with the Actor transform
- Parameters
-
[in] | deltaSeconds | last frame duration |
Component tick override. Updates the PhysX scene with the Actor transform
Reimplemented from Component.
void RigidBody::updateTransform |
( |
const PxTransform & |
newTransform | ) |
|
Update the transform based on the PhysX physics simulation and current constraints
- Parameters
-
The documentation for this class was generated from the following files:
- /Users/guilherme_cunha/Dev/GITHUB/GUInity/Source/RigidBody.hpp
- /Users/guilherme_cunha/Dev/GITHUB/GUInity/Source/RigidBody.cpp