template<class T>
esp::physics::AbstractManagedPhysicsObject class

Base class template for wrapper for physics objects of all kinds to enable Managed Container access.

Base classes

class esp::core::managedContainers::AbstractManagedObject
This abstract base class provides the interface of expected functionality for an object to be manageable by esp::core::managedContainers::ManagedContainer class template specializations. Any class that inherits from this class properly can be managed by a esp::core::managedContainers::ManagedContainer specilization.

Derived classes

template<class T>
class AbstractManagedRigidBase
Class template describing wrapper for RigidBase constructions. Provides bindings for all RigidBase functionality.
template<class T>
class AbstractManagedRigidBase
Class template describing wrapper for RigidBase constructions. Provides bindings for all RigidBase functionality.

Public types

using WeakObjRef = std::weak_ptr<T>

Constructors, destructors, conversion operators

AbstractManagedPhysicsObject(const std::string& classKey) explicit
~AbstractManagedPhysicsObject() defaulted override

Public functions

void setObjectRef(const std::shared_ptr<T>& objRef)
auto isAlive() -> bool
Test whether this wrapper's object still exists.
auto getClassKey() const -> std::string override
Get this managed object's class. Should only be set from constructor. Used as key in constructor function pointer maps in Managed Container.
auto getHandle() const -> std::string override
void setHandle(const std::string& name) override
Managed Physics objects manage their own handles, so this is currently unsettable.
auto getID() const -> int override
return the object's ID or nullptr if doesn't exist.
void setID(int ID) override
Managed Physics objects manage their own IDs, so this is unsettable.
auto getMotionType() const -> MotionType
void setMotionType(MotionType mt)
auto isActive() const -> bool
void setActive(const bool active)
void setLightSetup(const std::string& lightSetupKey)
auto contactTest() -> bool
void overrideCollisionGroup(CollisionGroup group)
auto getSceneNode() -> scene::SceneNode*
auto getUserAttributes() const -> core::config::Configuration::ptr
auto getTransformation() const -> Magnum::Matrix4
void setTransformation(const Magnum::Matrix4& transformation)
auto getTranslation() const -> Magnum::Vector3
void setTranslation(const Magnum::Vector3& vector)
auto getRotation() const -> Magnum::Quaternion
void setRotation(const Magnum::Quaternion& quaternion)
auto getRigidState() -> core::RigidState
void setRigidState(const core::RigidState& rigidState)
void resetTransformation()
void translate(const Magnum::Vector3& vector)
void translateLocal(const Magnum::Vector3& vector)
void rotate(const Magnum::Rad angleInRad, const Magnum::Vector3& normalizedAxis)
void rotateLocal(const Magnum::Rad angleInRad, const Magnum::Vector3& normalizedAxis)
void rotateX(const Magnum::Rad angleInRad)
void rotateY(const Magnum::Rad angleInRad)
void rotateZ(const Magnum::Rad angleInRad)
void rotateXLocal(const Magnum::Rad angleInRad)
void rotateYLocal(const Magnum::Rad angleInRad)
void rotateZLocal(const Magnum::Rad angleInRad)
auto getVisualSceneNodes() const -> std::vector<scene::SceneNode*>
auto getObjectInfoHeader() const -> std::string override
Retrieve a comma-separated string holding the header values for the info returned for this managed object.
auto getObjectInfo() const -> std::string override
Retrieve a comma-separated informational string about the contents of this managed object.

Protected functions

auto getPhyObjInfoHeaderInternal() const -> std::string pure virtual
Retrieve a comma-separated string holding the header values for the info returned for this managed object, type-specific. TODO : once Magnum supports retrieving key-values of configurations, use that to build this data.
auto getPhysObjInfoInternal(std::shared_ptr<T>& sp) const -> std::string pure virtual
Specialization-specific extension of getObjectInfo, comma separated info ideal for saving to csv.
auto getObjectReference() const -> std::shared_ptr<T>
This function accesses the underlying shared pointer of this object's weakObjRef_ if it exists; if not, it provides a message.
void setClassKey(const std::string& classKey) override
Set this managed object's class. Should only be set from constructor. Used as key in constructor function pointer maps in Managed Container.

Protected variables

WeakObjRef weakObjRef_
Weak ref to object. If user has copy of this wrapper but object has been deleted, this will be nullptr.
std::string classKey_
Name of instancing class responsible for this managed object.

Function documentation

template<class T>
std::shared_ptr<T> esp::physics::AbstractManagedPhysicsObject<T>::getObjectReference() const protected

This function accesses the underlying shared pointer of this object's weakObjRef_ if it exists; if not, it provides a message.

Returns Either a shared pointer of this wrapper's object, or nullptr if dne.

template<class T>
void esp::physics::AbstractManagedPhysicsObject<T>::setClassKey(const std::string& classKey) override protected

Set this managed object's class. Should only be set from constructor. Used as key in constructor function pointer maps in Managed Container.

Parameters
classKey the string handle corresponding to the constructors used to make copies of this object in copy constructor map.