esp::metadata::attributes::AbstractObjectAttributes class

base attributes object holding attributes shared by all esp::metadata::attributes::ObjectAttributes and esp::metadata::attributes::StageAttributes objects; Should be treated as abstract - should never be instanced directly

Base classes

class AbstractAttributes
Base class for all implemented attributes. Inherits from esp::core::managedContainers::AbstractFileBasedManagedObject so the attributes can be managed by a esp::core::managedContainers::ManagedContainer.

Derived classes

class ObjectAttributes
Specific Attributes instance describing a rigid object, constructed with a default set of object-specific required attributes.
class StageAttributes
Specific Attributes instance describing a rigid stage, constructed with a default set of stage-specific required attributes.

Constructors, destructors, conversion operators

AbstractObjectAttributes(const std::string& classKey, const std::string& handle)
~AbstractObjectAttributes() defaulted override

Public functions

void setScale(const Magnum::Vector3& scale)
Scale of the ojbect.
auto getScale() const -> Magnum::Vector3
void setMargin(double margin)
collision shape inflation margin
auto getMargin() const -> double
void setIsCollidable(bool isCollidable)
auto getIsCollidable() const -> bool
void setOrientUp(const Magnum::Vector3& orientUp)
Set default up orientation for object/stage mesh.
auto getOrientUp() const -> Magnum::Vector3
get default up orientation for object/stage mesh
void setOrientFront(const Magnum::Vector3& orientFront)
Set default forward orientation for object/stage mesh.
auto getOrientFront() const -> Magnum::Vector3
get default forward orientation for object/stage mesh
void setUnitsToMeters(double unitsToMeters)
Sets how many units map to a meter.
auto getUnitsToMeters() const -> double
Gets how many units map to a meter.
void setIsVisible(bool isVisible)
If not visible can add dynamic non-rendered object into a scene. If is not visible then should not add object to drawables.
auto getIsVisible() const -> bool
void setFrictionCoefficient(double frictionCoefficient)
auto getFrictionCoefficient() const -> double
void setRollingFrictionCoefficient(double rollingFrictionCoefficient)
auto getRollingFrictionCoefficient() const -> double
void setSpinningFrictionCoefficient(double spinningFrictionCoefficient)
auto getSpinningFrictionCoefficient() const -> double
void setRestitutionCoefficient(double restitutionCoefficient)
auto getRestitutionCoefficient() const -> double
void setRenderAssetHandle(const std::string& renderAssetHandle)
Sets the relative path/filename for the render asset to be used to render the construct this attributes describes. This is relative to the on-disk location of the file responsible for this configuration.
auto getRenderAssetHandle() const -> std::string
Gets the relative path/filename for the render asset to be used to render the construct this attributes describes. This is relative to the on-disk location of the file responsible for this configuration.
void setRenderAssetFullPath(const std::string& renderAssetHandle)
Sets the fully-qualified filepath for the render asset to be used to render the construct this attributes describes. This is only used internally and should not be saved to disk.
auto getRenderAssetFullPath() const -> std::string
Gets the fully-qualified filepath for the render asset to be used to render the construct this attributes describes. This is only used internally and should not be saved to disk.
void setRenderAssetType(const std::string& renderAssetType)
Sets the render asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void initRenderAssetType(const std::string& renderAssetType)
Initialize the render asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void setRenderAssetTypeEnum(AssetType assetTypeEnum)
Sets the render asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void initRenderAssetTypeEnum(AssetType assetTypeEnum)
Initialize the render asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
auto getRenderAssetType() -> AssetType
Gets the render asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void setRenderAssetIsPrimitive(bool renderAssetIsPrimitive)
Sets whether this object uses file-based mesh render object or primitive render shapes.
auto getRenderAssetIsPrimitive() const -> bool
Get whether this object uses file-based mesh render object or primitive render shapes.
void setCollisionAssetHandle(const std::string& collisionAssetHandle)
Sets the relative path/filename for the collision asset to be used for mesh collision detection for the construct this attributes describes. This is relative to the on-disk location of the file responsible for this configuration.
auto getCollisionAssetHandle() const -> std::string
Gets the relative path/filename for the collision asset to be used for mesh collision detection for the construct this attributes describes. This is relative to the on-disk location of the file responsible for this configuration.
void setCollisionAssetFullPath(const std::string& collisionAssetHandle)
Sets the fully-qualified filepath for the collision asset to be used for mesh collision detection for the construct this attributes describes. This is only used internally and should not be saved to disk.
auto getCollisionAssetFullPath() const -> std::string
Gets the fully-qualified filepath for the collision asset to be used for mesh collision detection for the construct this attributes describes. This is only used internally and should not be saved to disk.
void setCollisionAssetType(const std::string& collisionAssetType)
Sets the collision asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void initCollisionAssetType(const std::string& collisionAssetType)
Initialize the collision asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void setCollisionAssetTypeEnum(AssetType assetTypeEnum)
Sets the collision asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void initCollisionAssetTypeEnum(AssetType assetTypeEnum)
Initialize the collision asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
auto getCollisionAssetType() const -> AssetType
Gets the collision asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void setCollisionAssetSize(const Magnum::Vector3& collisionAssetSize)
Sets the size/scale of the collision asset compared to the render asset so that the final constructs align.
auto getCollisionAssetSize() const -> Magnum::Vector3
Gets the size/scale of the collision asset compared to the render asset so that the final constructs align.
void setCollisionAssetIsPrimitive(bool collisionAssetIsPrimitive)
Sets whether this object uses file-based mesh collision object or primitive(implicit) collision shapes.
auto getCollisionAssetIsPrimitive() const -> bool
Gets whether this object uses file-based mesh collision object or primitive(implicit) collision shapes.
void setUseMeshCollision(bool useMeshCollision)
Sets whether this object uses mesh collision or primitive(implicit) collision calculation.
auto getUseMeshCollision() const -> bool
Gets whether this object uses mesh collision or primitive(implicit) collision calculation.
void setShaderType(const std::string& shader_type)
Set the default shader to use for an object or stage. This may be overridden by a scene instance specification.
auto getShaderType() const -> ObjectInstanceShaderType
Get the default shader to use for an object or stage. This may be overridden by a scene instance specification.
void setForceFlatShading(bool force_flat_shading)
If true then use flat shading regardless of what shader-type is specified by materials or other configs.
auto getForceFlatShading() const -> bool
if true use flat shading instead of phong or pbr shader
auto getIsDirty() const -> bool
void setIsClean()
void writeValuesToJson(io::JsonGenericValue& jsonObj, io::JsonAllocator& allocator) const override
Populate a json object with all the first-level values held in this configuration. Default is overridden to handle special cases for AbstractObjectAttributes and deriving (ObjectAttributes and StageAttributes) classes.
auto getUseFrameForAllOrientation() const -> bool
Whether to use the specified orientation frame for all orientation tasks for this asset. This will always be true, except if an overriding semantic mesh-specific frame is specified for stages.
auto getMarkerSetsConfiguration() const -> std::shared_ptr<MarkerSets>
Gets a smart pointer reference to a copy of the marker_sets configuration data from config file.
auto editMarkerSetsConfiguration() -> std::shared_ptr<MarkerSets>
Gets a smart pointer reference to the actual marker_sets configuration data from config file. This method is for editing the configuration.
auto rekeyAllMarkerSets() -> int
Rekey all the markers in the marker_sets subconfiguration such that each point is keyed by a sequential numeric string that preserves the natural ordering of the key strings.

Protected functions

void setUseFrameForAllOrientation(bool useFrameForAllOrientation)
Whether to use the specified orientation frame for all orientation tasks for this asset. This will always be true, except if an overriding semantic mesh-specific frame is specified for stages.
void writeValuesToJsonInternal(io::JsonGenericValue& jsonObj, io::JsonAllocator& allocator) const virtual
Write child-class-specific values to json object.
auto getObjectInfoHeaderInternal() const -> std::string override
Retrieve a comma-separated string holding the header values for the info returned for this managed object, type-specific.
auto getAbstractObjectInfoHeaderInternal() const -> std::string virtual
get AbstractObject specific info header
auto getObjectInfoInternal() const -> std::string override
Retrieve a comma-separated informational string about the contents of this managed object.
auto getAbstractObjectInfoInternal() const -> std::string virtual
get AbstractObject specific info for csv string
void setIsDirty()

Function documentation

void esp::metadata::attributes::AbstractObjectAttributes::setRenderAssetIsPrimitive(bool renderAssetIsPrimitive)

Sets whether this object uses file-based mesh render object or primitive render shapes.

Parameters
renderAssetIsPrimitive whether this object's render asset is a primitive or not

bool esp::metadata::attributes::AbstractObjectAttributes::getRenderAssetIsPrimitive() const

Get whether this object uses file-based mesh render object or primitive render shapes.

Returns whether this object's render asset is a primitive or not

void esp::metadata::attributes::AbstractObjectAttributes::setCollisionAssetIsPrimitive(bool collisionAssetIsPrimitive)

Sets whether this object uses file-based mesh collision object or primitive(implicit) collision shapes.

Parameters
collisionAssetIsPrimitive whether this object's collision asset is a primitive (implicitly calculated) or a mesh

bool esp::metadata::attributes::AbstractObjectAttributes::getCollisionAssetIsPrimitive() const

Gets whether this object uses file-based mesh collision object or primitive(implicit) collision shapes.

Returns whether this object's collision asset is a primitive (implicitly calculated) or a mesh

bool esp::metadata::attributes::AbstractObjectAttributes::getUseMeshCollision() const

Gets whether this object uses mesh collision or primitive(implicit) collision calculation.

Returns Whether this object uses mesh collision or primitive(implicit) collision calculation.