| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
- // All rights reserved.
- // Code licensed under the BSD License.
- // http://www.anki3d.org/LICENSE
- #pragma once
- #include <AnKi/Resource/ResourceObject.h>
- #include <AnKi/Math.h>
- #include <AnKi/Util/WeakArray.h>
- #include <AnKi/Physics2/PhysicsCollisionShape.h>
- namespace anki {
- /// @addtogroup resource
- /// @{
- /// CPU Mesh Resource. It contains the geometry packed in CPU buffers.
- class CpuMeshResource : public ResourceObject
- {
- public:
- /// Default constructor
- CpuMeshResource() = default;
- ~CpuMeshResource() = default;
- /// Load from a mesh file
- Error load(const ResourceFilename& filename, Bool async);
- const v2::PhysicsCollisionShapePtr& getOrCreateCollisionShape(Bool isStatic, U32 lod = kMaxLodCount - 1) const;
- private:
- ResourceDynamicArray<Vec3> m_positionsMaxLod;
- ResourceDynamicArray<U32> m_indicesMaxLod;
- mutable v2::PhysicsCollisionShapePtr m_collisionShape;
- mutable SpinLock m_shapeMtx;
- Bool m_isConvex = false;
- U8 m_maxLod = 0;
- };
- /// @}
- } // namespace anki
|