class
#include <esp/physics/RigidObject.h>
RigidObject A RigidBase representing an individual rigid object instance attached to a SceneNode, updating its state through simulation. This may be a esp::
Base classes
- class RigidBase
- This class specifies the functionality expected of rigid objects and stages, particularly with regard to dynamic simulation, if such a library, such as bullet, is available.
Derived classes
- class BulletRigidObject
- An individual rigid object instance implementing an interface with Bullet physics to enable dynamic objects. See btRigidBody for esp::physics::RigidObjectType::OBJECT.
Constructors, destructors, conversion operators
-
RigidObject(scene::
SceneNode* rigidBodyNode, int objectId, const assets:: ResourceManager& resMgr) - Constructor for a esp::
physics:: RigidObject. - ~RigidObject() defaulted override
- Virtual destructor for a esp::
physics:: RigidObject.
Public functions
- auto initialize(metadata::attributes::AbstractObjectAttributes::ptr initAttributes) -> bool override
- Initializes the esp::
physics:: RigidObject that inherits from this class. - auto finalizeObject() -> bool override
- Finalize the creation of the RigidObject.
-
auto getInitializationAttributes() const -> std::
shared_ptr<metadata:: attributes:: ObjectAttributes> - Get a copy of the template used to initialize this object.
- void setIsCOMCorrected(bool _isCOMCorrected)
- Set whether this object is COM corrected, which determines how the intial transformation is applied when placing the object.
-
auto getUncorrectedTranslation() const -> Magnum::
Vector3 override - Reverses the COM correction transformation for objects that require it. Currently a simple passthrough for stages and Articulated Objects.
- void setMotionType(MotionType mt) override
- Set the MotionType of the object. If the object is ObjectType::SCENE it can only be esp::
physics:: MotionType:: STATIC. If the object is ObjectType::OBJECT is can also be set to esp:: physics:: MotionType:: KINEMATIC. Only if a dervied PhysicsManager implementing dynamics is in use can the object be set to esp:: physics:: MotionType:: DYNAMIC. - auto getVelocityControl() -> VelocityControl::ptr
- Retrieves a reference to the VelocityControl struct for this object.
- void resetStateFromSceneInstanceAttr() override
- Set the object's state from a esp::
metadata:: attributes:: SceneObjectInstanceAttributes.
Protected variables
- bool isCOMCorrected_
- Whether or not this object's placement should be COM corrected.
- VelocityControl::ptr velControl_
- Convenience variable: specifies a constant control velocity (linear | angular) applied to the rigid body before each step.
Private functions
- auto initialization_LibSpecific() -> bool override
- Finalize the initialization of this esp::
physics:: RigidObject's geometry. This is overridden by inheriting class specific to certain physics libraries. Necessary to support kinematic objects without any dynamics support. - auto finalizeObject_LibSpecific() -> bool override
- any physics-lib-specific finalization code that needs to be run after RigidObject is created. Overridden by inheriting class specific to certain physics libraries. Necessary to support kinematic objects without any dynamics support.
Function documentation
esp:: physics:: RigidObject:: RigidObject(scene:: SceneNode* rigidBodyNode,
int objectId,
const assets:: ResourceManager& resMgr)
Constructor for a esp::
Parameters | |
---|---|
rigidBodyNode | The scene:: |
objectId | |
resMgr |
bool esp:: physics:: RigidObject:: initialize(metadata::attributes::AbstractObjectAttributes::ptr initAttributes) override
Initializes the esp::
Parameters | |
---|---|
initAttributes | The template structure defining relevant physical parameters for this object |
Returns | true if initialized successfully, false otherwise. |
bool esp:: physics:: RigidObject:: finalizeObject() override
Finalize the creation of the RigidObject.
Returns | whether successful finalization. |
---|
std:: shared_ptr<metadata:: attributes:: ObjectAttributes> esp:: physics:: RigidObject:: getInitializationAttributes() const
Get a copy of the template used to initialize this object.
Returns | A copy of the esp:: |
---|
void esp:: physics:: RigidObject:: setMotionType(MotionType mt) override
Set the MotionType of the object. If the object is ObjectType::SCENE it can only be esp::
Parameters | |
---|---|
mt | The desirved MotionType. |
Returns | true if successfully set, false otherwise. |
bool esp:: physics:: RigidObject:: initialization_LibSpecific() override private
Finalize the initialization of this esp::
Returns | true if initialized successfully, false otherwise. |
---|
bool esp:: physics:: RigidObject:: finalizeObject_LibSpecific() override private
any physics-lib-specific finalization code that needs to be run after RigidObject is created. Overridden by inheriting class specific to certain physics libraries. Necessary to support kinematic objects without any dynamics support.
Returns | whether successful finalization. |
---|