Open 3D Engine ROS2 Gem API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Common utils for Prefab Maker classes. More...
Functions | |
void | AddRequiredComponentsToEntity (AZ::EntityId entityId) |
AZ::IO::Path | GetAzModelAssetPathFromModelPath (const AZ::IO::Path &modelPath) |
void | SetEntityTransformLocal (const gz::math::Pose3d &origin, AZ::EntityId entityId) |
AzToolsFramework::Prefab::PrefabEntityResult | CreateEntity (AZ::EntityId parentEntityId, const AZStd::string &name) |
void | SetEntityParent (AZ::EntityId entityId, AZ::EntityId parentEntityId) |
void | SetEntityParentRelative (AZ::EntityId entityId, AZ::EntityId parentEntityId) |
AZStd::string | MakeEntityName (const AZStd::string &rootName, const AZStd::string &type, size_t index=0) |
AZStd::optional< Utils::AvailableAsset > | GetAssetFromPath (const Utils::UrdfAssetMap &sdfAssetsMapping, const AZStd::string &sdfMeshPath) |
AZStd::optional< Utils::AvailableAsset > | GetAssetFromPath (const Utils::UrdfAssetMap &sdfAssetsMapping, const std::string &sdfMeshPath) |
Common utils for Prefab Maker classes.
void ROS2::PrefabMakerUtils::AddRequiredComponentsToEntity | ( | AZ::EntityId | entityId | ) |
Add required components to the entity. Calling this will ensure all the required (default) components are added.
entityId | entity to modify. |
AzToolsFramework::Prefab::PrefabEntityResult ROS2::PrefabMakerUtils::CreateEntity | ( | AZ::EntityId | parentEntityId, |
const AZStd::string & | name | ||
) |
Create a prefab entity in a hierarchy. The new entity will not yet be active.
parentEntityId | id of parent entity for this new entity. Passing an invalid id would get the entity in the current context (for example, an entity which is currently open in the Editor). |
name | name for the new entity. |
AZStd::optional<Utils::AvailableAsset> ROS2::PrefabMakerUtils::GetAssetFromPath | ( | const Utils::UrdfAssetMap & | sdfAssetsMapping, |
const AZStd::string & | sdfMeshPath | ||
) |
Get an Asset for a specified mesh given its path and mapping.
sdfAssetsMapping | mapping of SDF assets. |
sdfMeshPath | a path to the mesh for which the Asset is requested. |
AZStd::optional<Utils::AvailableAsset> ROS2::PrefabMakerUtils::GetAssetFromPath | ( | const Utils::UrdfAssetMap & | sdfAssetsMapping, |
const std::string & | sdfMeshPath | ||
) |
Get Asset from path. Version for std::string.
AZ::IO::Path ROS2::PrefabMakerUtils::GetAzModelAssetPathFromModelPath | ( | const AZ::IO::Path & | modelPath | ) |
For a given model, return path to its Assets.
modelPath | path to the model. |
AZStd::string ROS2::PrefabMakerUtils::MakeEntityName | ( | const AZStd::string & | rootName, |
const AZStd::string & | type, | ||
size_t | index = 0 |
||
) |
Create an entity name from arguments.
rootName | root of entity's name. |
type | type of entity, depending on corresponding SDF tag. For example, "visual". |
index | index of entity, useful when multiple visuals or colliders are present for a single link. |
void ROS2::PrefabMakerUtils::SetEntityParent | ( | AZ::EntityId | entityId, |
AZ::EntityId | parentEntityId | ||
) |
Set the parent entity for an entity. The entity being attached to the parent entity is expected to be inactive. NOTE: This uses the world transform of the entity when updating the transform The world location of the entity will not change
entityId | the id for entity that needs a parent. |
parentEntityId | the id for the parent entity. |
void ROS2::PrefabMakerUtils::SetEntityParentRelative | ( | AZ::EntityId | entityId, |
AZ::EntityId | parentEntityId | ||
) |
Set the parent entity for an entity. The entity being attached to the parent is expected to be inactive. NOTE: This uses the local transform of the entity when updating the transform and therefore allows the entity to relocate based on the parent world transform
entityId | the id for entity that needs a parent. |
parentEntityId | the id for the parent entity. |
void ROS2::PrefabMakerUtils::SetEntityTransformLocal | ( | const gz::math::Pose3d & | origin, |
AZ::EntityId | entityId | ||
) |
Set the transform for an entity.
origin | pose for the entity to set. |
entityId | entity which will be modified. |