Plasma Engine  2.0
Loading...
Searching...
No Matches
MeshResource.h
1#pragma once
2
3#include <RendererCore/Meshes/MeshBufferResource.h>
4#include <RendererCore/Meshes/MeshResourceDescriptor.h>
5
7
8class PL_RENDERERCORE_DLL plMeshResource : public plResource
9{
10 PL_ADD_DYNAMIC_REFLECTION(plMeshResource, plResource);
11 PL_RESOURCE_DECLARE_COMMON_CODE(plMeshResource);
12 PL_RESOURCE_DECLARE_CREATEABLE(plMeshResource, plMeshResourceDescriptor);
13
14public:
16
19
21 const plMeshBufferResourceHandle& GetMeshBuffer() const { return m_hMeshBuffer; }
22
25
27 const plBoundingBoxSphere& GetBounds() const { return m_Bounds; }
28
29 // TODO: clean up
30 plSkeletonResourceHandle m_hDefaultSkeleton;
32 float m_fMaxBoneVertexOffset = 0.0f; // the maximum distance between any vertex and its influencing bones, can be used for adjusting the bounding box of a pose
33
34private:
35 virtual plResourceLoadDesc UnloadData(Unload WhatToUnload) override;
36 virtual plResourceLoadDesc UpdateContent(plStreamReader* Stream) override;
37 virtual void UpdateMemoryUsage(MemoryUsage& out_NewMemoryUsage) override;
38
40 plMeshBufferResourceHandle m_hMeshBuffer;
42
43 plBoundingBoxSphere m_Bounds;
44
45 static plUInt32 s_uiMeshBufferNameSuffix;
46};
47
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition DynamicArray.h:81
Definition HashTable.h:333
Definition MeshResourceDescriptor.h:9
Definition MeshResource.h:9
plArrayPtr< const plMeshResourceDescriptor::SubMesh > GetSubMeshes() const
Returns the array of sub-meshes in this mesh.
Definition MeshResource.h:18
const plMeshBufferResourceHandle & GetMeshBuffer() const
Returns the mesh buffer that is used by this resource.
Definition MeshResource.h:21
plArrayPtr< const plMaterialResourceHandle > GetMaterials() const
Returns the default materials for this mesh.
Definition MeshResource.h:24
const plBoundingBoxSphere & GetBounds() const
Returns the bounds of this mesh.
Definition MeshResource.h:27
The base class for all resources.
Definition Resource.h:10
virtual plResourceLoadDesc UnloadData(Unload WhatToUnload)=0
Requests the resource to unload another quality level. If bFullUnload is true, the resource should un...
virtual plResourceLoadDesc UpdateContent(plStreamReader *pStream)=0
Called whenever more data for the resource is available. The resource must read the stream to update ...
virtual void UpdateMemoryUsage(MemoryUsage &out_NewMemoryUsage)=0
This function must be overridden by all resource types.
Interface for binary in (read) streams.
Definition Stream.h:22
Describes in which loading state a resource currently is, and how many different quality levels there...
Definition Declarations.h:102