Open 3D Engine Atom Gem API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
AZ::RPI::ModelAsset Class Reference

#include <ModelAsset.h>

Inherits AssetData.

Public Member Functions

 AZ_RTTI (ModelAsset, "{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}", AZ::Data::AssetData)
 
 AZ_CLASS_ALLOCATOR (ModelAsset, AZ::SystemAllocator, 0)
 
const Name & GetName () const
 Returns the human readable name of the model.
 
const AZ::Aabb & GetAabb () const
 Returns the model-space axis aligned bounding box.
 
const ModelMaterialSlotMap & GetMaterialSlots () const
 Returns the list of all ModelMaterialSlot's for the model, across all LODs.
 
const ModelMaterialSlotFindMaterialSlot (uint32_t stableId) const
 Find a material slot with the given stableId, or returns an invalid slot if it isn't found.
 
size_t GetLodCount () const
 Returns the number of Lods in the model.
 
AZStd::span< const Data::Asset< ModelLodAsset > > GetLodAssets () const
 
virtual bool LocalRayIntersectionAgainstModel (const AZ::Vector3 &rayStart, const AZ::Vector3 &rayDir, bool allowBruteForce, float &distanceNormalized, AZ::Vector3 &normal) const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Static Public Attributes

static const char * DisplayName
 
static const char * Extension
 
static const char * Group
 

Friends

class ModelAssetCreator
 

Detailed Description

Contains a set of RPI::ModelLodAsset objects. Serialized to a .azmodel file. Actual model data is stored in the BufferAssets referenced by ModelLodAssets.

Member Function Documentation

◆ LocalRayIntersectionAgainstModel()

virtual bool AZ::RPI::ModelAsset::LocalRayIntersectionAgainstModel ( const AZ::Vector3 &  rayStart,
const AZ::Vector3 &  rayDir,
bool  allowBruteForce,
float &  distanceNormalized,
AZ::Vector3 &  normal 
) const
virtual

Checks a ray for intersection against this model. The ray must be in the same coordinate space as the model. Important: only to be used in the Editor, it may kick off a job to calculate spatial information. [GFX TODO][ATOM-4343 Bake mesh spatial information during AP processing]

Parameters
rayStartThe starting point of the ray.
rayDirThe direction and length of the ray (magnitude is encoded in the direction).
allowBruteForceAllow for brute force queries while the mesh is baking (remove when ATOM-4343 is complete)
[out]distanceNormalizedIf an intersection is found, will be set to the normalized distance of the intersection (in the range 0.0-1.0) - to calculate the actual distance, multiply distanceNormalized by the magnitude of rayDir.
[out]normalIf an intersection is found, will be set to the normal at the point of collision.
Returns
True if the ray intersects the mesh.

The documentation for this class was generated from the following file: