Open 3D Engine LmbrCentral Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
LmbrCentral::IntersectionTestDataCache< ShapeConfiguration > Class Template Referenceabstract

Wrapper for cache of data used for intersection tests. More...

#include <ShapeComponentBus.h>

Public Member Functions

void UpdateIntersectionParams (const AZ::Transform &currentTransform, const ShapeConfiguration &configuration, AZStd::shared_mutex *sharedMutex, const AZ::Vector3 &currentNonUniformScale=AZ::Vector3::CreateOne())
 Updates the intersection data cache to reflect the current state of the shape.
 
void InvalidateCache (const InvalidateShapeCacheReason reason)
 Mark the cache as needing to be updated.
 

Protected Types

enum class  ShapeCacheStatus { Current , ObsoleteTransformChange , ObsoleteShapeChange }
 State of shape cache - should the internal shape cache be recalculated, or is it up to date. More...
 

Protected Member Functions

virtual void UpdateIntersectionParamsImpl (const AZ::Transform &currentTransform, const ShapeConfiguration &configuration, const AZ::Vector3 &nonUniformScale=AZ::Vector3::CreateOne())=0
 Derived shape specific implementation of cache update (called from UpdateIntersectionParams).
 
ShapeCacheStatus CacheStatus () const
 

Detailed Description

template<typename ShapeConfiguration>
class LmbrCentral::IntersectionTestDataCache< ShapeConfiguration >

Wrapper for cache of data used for intersection tests.

Member Enumeration Documentation

◆ ShapeCacheStatus

template<typename ShapeConfiguration >
enum class LmbrCentral::IntersectionTestDataCache::ShapeCacheStatus
strongprotected

State of shape cache - should the internal shape cache be recalculated, or is it up to date.

Enumerator
Current 

Cache is up to date.

ObsoleteTransformChange 

The cache is invalid because the transform of the entity changed.

ObsoleteShapeChange 

The cache is invalid because the shape configuration/properties changed.

Member Function Documentation

◆ CacheStatus()

template<typename ShapeConfiguration >
ShapeCacheStatus LmbrCentral::IntersectionTestDataCache< ShapeConfiguration >::CacheStatus ( ) const
inlineprotected

Expose read only cache status to derived IntersectionTestDataCache if different logic want to hapoen based on the cache status (shape/transform).

◆ UpdateIntersectionParams()

template<typename ShapeConfiguration >
void LmbrCentral::IntersectionTestDataCache< ShapeConfiguration >::UpdateIntersectionParams ( const AZ::Transform &  currentTransform,
const ShapeConfiguration &  configuration,
AZStd::shared_mutex *  sharedMutex,
const AZ::Vector3 &  currentNonUniformScale = AZ::Vector3::CreateOne() 
)
inline

Updates the intersection data cache to reflect the current state of the shape.

Parameters
currentTransformThe current Transform of the entity.
configurationThe specific configuration of a shape.
sharedMutexOptional pointer to a shared_mutex for the shape that is expected to be lock_shared on both entry and exit. It will be promoted to a unique lock temporarily if the cache currently needs to be updated.
currentNonUniformScale(Optional) The current non-uniform scale of the entity (if supported by the shape).

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