| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsRTTIType.h"
- #include "BsPhysicsMesh.h"
- #include "BsPhysics.h"
- namespace BansheeEngine
- {
- /** @cond RTTI */
- /** @addtogroup RTTI-Impl-Core
- * @{
- */
- class BS_CORE_EXPORT PhysicsMeshRTTI : public RTTIType<PhysicsMesh, Resource, PhysicsMeshRTTI>
- {
- private:
- BS_REFLPTR_MEMBER(mInternal)
- public:
- PhysicsMeshRTTI()
- {
- BS_ADD_REFLPTR_FIELD(mInternal, 0)
- }
- void onDeserializationEnded(IReflectable* obj) override
- {
- PhysicsMesh* mesh = static_cast<PhysicsMesh*>(obj);
- mesh->initialize();
- }
- const String& getRTTIName() override
- {
- static String name = "PhysicsMesh";
- return name;
- }
- UINT32 getRTTIId() override
- {
- return TID_PhysicsMesh;
- }
- SPtr<IReflectable> newRTTIObject() override
- {
- SPtr<PhysicsMesh> mesh = gPhysics().createMesh(nullptr, PhysicsMeshType::Convex);
- mesh->_setThisPtr(mesh);
- return mesh;
- }
- };
- class BS_CORE_EXPORT FPhysicsMeshRTTI : public RTTIType<FPhysicsMesh, IReflectable, FPhysicsMeshRTTI>
- {
- private:
- BS_PLAIN_MEMBER(mType)
- public:
- FPhysicsMeshRTTI()
- {
- BS_ADD_PLAIN_FIELD(mType, 0)
- }
- const String& getRTTIName() override
- {
- static String name = "FPhysicsMesh";
- return name;
- }
- UINT32 getRTTIId() override
- {
- return TID_FPhysicsMesh;
- }
- SPtr<IReflectable> newRTTIObject() override
- {
- BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
- return nullptr;
- }
- };
- /** @} */
- /** @endcond */
- }
|