esp::physics::RigidStage class

A RigidBase representing an individual rigid stage instance attached to a SceneNode. This construction currently may only be esp::physics::MotionType::STATIC.

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 BulletRigidStage
An individual rigid stage instance implementing an interface with Bullet physics to enable dynamics. See btCollisionObject.

Constructors, destructors, conversion operators

RigidStage(scene::SceneNode* rigidBodyNode, const assets::ResourceManager& resMgr)
~RigidStage() defaulted override
Virtual destructor for a RigidStage.

Public functions

auto initialize(metadata::attributes::AbstractObjectAttributes::ptr initAttributes) -> bool override
Initializes the RigidStage that inherits from this class.
auto getInitializationAttributes() const -> std::shared_ptr<metadata::attributes::StageAttributes>
Get a copy of the template used to initialize this stage object.
auto finalizeObject() -> bool override
Finalize the creation of this RigidStage.
void resetStateFromSceneInstanceAttr() override
Currently not supported. Set or reset the stages's state using the object's specified sceneInstanceAttributes_.
void setMotionType(MotionType mt) override
Currently ignored for stage objects.

Private functions

auto initialization_LibSpecific() -> bool override
Finalize the initialization of this RigidStage 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 afterRigidStage is created. Called from finalizeObject. Overridden by inheriting class specific to certain physics libraries. Necessary to support kinematic objects without any dynamics support.

Function documentation

bool esp::physics::RigidStage::initialize(metadata::attributes::AbstractObjectAttributes::ptr initAttributes) override

Initializes the RigidStage that inherits from this class.

Parameters
initAttributes The template structure defining relevant physical parameters for this object
Returns true if initialized successfully, false otherwise.

std::shared_ptr<metadata::attributes::StageAttributes> esp::physics::RigidStage::getInitializationAttributes() const

Get a copy of the template used to initialize this stage object.

Returns A copy of the esp::metadata::attributes::StageAttributes template used to create this stage object.

bool esp::physics::RigidStage::finalizeObject() override

Finalize the creation of this RigidStage.

Returns whether successful finalization.

void esp::physics::RigidStage::setMotionType(MotionType mt) override

Currently ignored for stage objects.

Parameters
mt The desirved MotionType.

bool esp::physics::RigidStage::initialization_LibSpecific() override private

Finalize the initialization of this RigidStage geometry. This is overridden by inheriting class specific to certain physics libraries.Necessary to support kinematic objects without any dynamics support.

Returns true if initialized successfully, false otherwise.

bool esp::physics::RigidStage::finalizeObject_LibSpecific() override private

any physics-lib-specific finalization code that needs to be run afterRigidStage is created. Called from finalizeObject. Overridden by inheriting class specific to certain physics libraries. Necessary to support kinematic objects without any dynamics support.

Returns whether successful finalization.