ezEngine Release 26.3
Loading...
Searching...
No Matches
ezDynamicMeshBufferResource Class Reference
Inheritance diagram for ezDynamicMeshBufferResource:

Public Member Functions

EZ_ALWAYS_INLINE const ezDynamicMeshBufferResourceDescriptorGetDescriptor () const
 
EZ_ALWAYS_INLINE ezArrayPtr< const ezGALBufferHandleGetVertexBuffers () const
 
EZ_ALWAYS_INLINE ezGALBufferHandle GetIndexBuffer () const
 
ezArrayPtr< ezVec3AccessPositionData (ezUInt32 uiFirstVertex=0, ezUInt32 uiNumVertices=ezInvalidIndex)
 Grants write access to the position data, and flags the data as 'dirty'.
 
ezArrayPtr< ezDynamicMeshVertexNTTAccessNormalTangentTexCoord0Data (ezUInt32 uiFirstVertex=0, ezUInt32 uiNumVertices=ezInvalidIndex)
 Grants write access to the normal, tangent and texcoord0 data, and flags the data as 'dirty'.
 
ezArrayPtr< ezColorLinear16fAccessColorData (ezUInt32 uiFirstVertex=0, ezUInt32 uiNumVertices=ezInvalidIndex)
 Grants write access to the color data, and flags the data as 'dirty'.
 
ezArrayPtr< ezUInt16 > AccessIndex16Data (ezUInt32 uiFirstIndex=0, ezUInt32 uiNumIndices=ezInvalidIndex)
 Grants write access to the 16 bit index data, and flags the data as 'dirty'.
 
ezArrayPtr< ezUInt32 > AccessIndex32Data (ezUInt32 uiFirstIndex=0, ezUInt32 uiNumIndices=ezInvalidIndex)
 Grants write access to the 32 bit index data, and flags the data as 'dirty'.
 
EZ_ALWAYS_INLINE ezArrayPtr< const ezGALVertexAttributeGetVertexAttributes () const
 Returns the vertex attributes that describes the data layout of the vertex buffers.
 
- Public Member Functions inherited from ezResource
EZ_ALWAYS_INLINE ezStringView GetResourceID () const
 Returns the unique ID that identifies this resource. On a file resource this might be a path. Can also be a GUID or any other scheme that uniquely identifies the resource.
 
EZ_ALWAYS_INLINE ezUInt64 GetResourceIDHash () const
 Returns the hash of the unique ID.
 
void SetResourceDescription (ezStringView sDescription)
 The resource description allows to store an additional string that might be more descriptive during debugging, than the unique ID.
 
const ezStringGetResourceDescription () const
 The resource description allows to store an additional string that might be more descriptive during debugging, than the unique ID.
 
const ezStringGetResourceIdOrDescription () const
 The returns the resource description, if available, otherwise the resource ID.
 
EZ_ALWAYS_INLINE ezResourceState GetLoadingState () const
 Returns the current state in which this resource is in.
 
EZ_ALWAYS_INLINE ezUInt8 GetNumQualityLevelsDiscardable () const
 Returns the current maximum quality level that the resource could have.
 
EZ_ALWAYS_INLINE ezUInt8 GetNumQualityLevelsLoadable () const
 Returns how many quality levels the resource may additionally load.
 
float GetLoadingPriority (ezTime now) const
 Returns the priority that is used by the resource manager to determine which resource to load next.
 
ezResourcePriority GetPriority () const
 Returns the current resource priority.
 
void SetPriority (ezResourcePriority priority)
 Changes the current resource priority.
 
EZ_ALWAYS_INLINE const ezBitflags< ezResourceFlags > & GetBaseResourceFlags () const
 Returns the basic flags for the resource type. Mostly used the resource manager.
 
EZ_ALWAYS_INLINE const MemoryUsageGetMemoryUsage () const
 Returns the information about the current memory usage of the resource.
 
EZ_ALWAYS_INLINE ezTime GetLastAcquireTime () const
 Returns the time at which the resource was (tried to be) acquired last. If a resource is acquired using ezResourceAcquireMode::PointerOnly, this does not update the last acquired time, since the resource is not acquired for full use.
 
EZ_ALWAYS_INLINE ezInt32 GetReferenceCount () const
 Returns the reference count of this resource.
 
EZ_ALWAYS_INLINE const ezTimestampGetLoadedFileModificationTime () const
 Returns the modification date of the file from which this resource was loaded.
 
EZ_ALWAYS_INLINE ezUInt32 GetCurrentResourceChangeCounter () const
 Returns the current value of the resource change counter. Can be used to detect whether the resource has changed since using it last time.
 
EZ_ALWAYS_INLINE void IncResourceChangeCounter ()
 Allows to manually increase the resource change counter to signal that dependent code might need to update.
 
virtual void ResetResource ()
 If the resource has modifications from the original state, it should reset itself to that state now (or force a reload on itself).
 
void PrintHandleStackTraces ()
 Prints the stack-traces for all handles that currently reference this resource.
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Static Public Member Functions

static void CreateGridXY (ezDynamicMeshBufferResource *pDynamicMeshBuffer, const ezVec2 &vSize, const ezVec2U32 &vNumVertices, const ezVec2 &vTextureScale=ezVec2(1))
 Helper function to create a grid aligned to the XY plane with the given size and number of vertices. The mesh buffer must already have the right number of vertices.
 
static void CalculateGridNormalAndTangents (ezDynamicMeshBufferResource *pDynamicMeshBuffer, const ezVec2U32 &vNumVertices)
 Helper function to calculate smooth normals and tangents for a grid mesh created with the function above after its positions have been updated.
 
- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 

Private Member Functions

virtual ezResourceLoadDesc UnloadData (Unload WhatToUnload) override
 Requests the resource to unload another quality level. If bFullUnload is true, the resource should unload all data, because it is going to be deleted afterwards.
 
virtual ezResourceLoadDesc UpdateContent (ezStreamReader *Stream) override
 Called whenever more data for the resource is available. The resource must read the stream to update it's data.
 
virtual void UpdateMemoryUsage (MemoryUsage &out_NewMemoryUsage) override
 This function must be overridden by all resource types.
 

Friends

struct ezDynamicMeshBufferManager
 

Additional Inherited Members

- Public Types inherited from ezResource
enum class  DoUpdate { OnMainThread , OnAnyThread , OnGraphicsResourceThreads }
 
- Public Attributes inherited from ezResource
ezEvent< const ezResourceEvent &, ezMutexm_ResourceEvents
 
- Static Public Attributes inherited from ezResource
static DoUpdate UpdateGraphicsResource = ezResource::DoUpdate::OnAnyThread
 
- Protected Types inherited from ezResource
enum class  Unload { AllQualityLevels , OneQualityLevel }
 
- Protected Member Functions inherited from ezResource
 ezResource (DoUpdate ResourceUpdateThread, ezUInt8 uiQualityLevelsLoadable)
 Default constructor.
 
virtual ~ezResource ()
 virtual destructor.
 
MemoryUsageModifyMemoryUsage ()
 Non-const version for resources that want to write this variable directly.
 
void SetIsReloadable (bool bIsReloadable)
 Call this to specify whether a resource is reloadable.
 
void SetHasLoadingFallback (bool bHasLoadingFallback)
 Used internally by the code injection macros.
 

Member Function Documentation

◆ AccessColorData()

ezArrayPtr< ezColorLinear16f > ezDynamicMeshBufferResource::AccessColorData ( ezUInt32  uiFirstVertex = 0,
ezUInt32  uiNumVertices = ezInvalidIndex 
)
inline

Grants write access to the color data, and flags the data as 'dirty'.

Accessing this data is only valid, if creation of the color buffer was enabled.

◆ AccessIndex16Data()

ezArrayPtr< ezUInt16 > ezDynamicMeshBufferResource::AccessIndex16Data ( ezUInt32  uiFirstIndex = 0,
ezUInt32  uiNumIndices = ezInvalidIndex 
)
inline

Grants write access to the 16 bit index data, and flags the data as 'dirty'.

Accessing this data is only valid, if the buffer was created with 16 bit indices.

◆ AccessIndex32Data()

ezArrayPtr< ezUInt32 > ezDynamicMeshBufferResource::AccessIndex32Data ( ezUInt32  uiFirstIndex = 0,
ezUInt32  uiNumIndices = ezInvalidIndex 
)
inline

Grants write access to the 32 bit index data, and flags the data as 'dirty'.

Accessing this data is only valid, if the buffer was created with 32 bit indices.

◆ UnloadData()

ezResourceLoadDesc ezDynamicMeshBufferResource::UnloadData ( Unload  WhatToUnload)
overrideprivatevirtual

Requests the resource to unload another quality level. If bFullUnload is true, the resource should unload all data, because it is going to be deleted afterwards.

Implements ezResource.

◆ UpdateContent()

ezResourceLoadDesc ezDynamicMeshBufferResource::UpdateContent ( ezStreamReader pStream)
overrideprivatevirtual

Called whenever more data for the resource is available. The resource must read the stream to update it's data.

pStream may be nullptr in case the resource data could not be found.

Implements ezResource.

◆ UpdateMemoryUsage()

void ezDynamicMeshBufferResource::UpdateMemoryUsage ( MemoryUsage out_NewMemoryUsage)
overrideprivatevirtual

This function must be overridden by all resource types.

It has to compute the memory used by this resource. It is called by the resource manager whenever the resource's data has been loaded or unloaded.

Implements ezResource.


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