CollisionResource.h 894 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <anki/resource/ResourceObject.h>
  7. #include <anki/physics/PhysicsCollisionShape.h>
  8. namespace anki
  9. {
  10. /// @addtogroup resource
  11. /// @{
  12. /// Load a collision shape.
  13. ///
  14. /// XML file format:
  15. /// <collisionShape>
  16. /// <type>sphere | box | mesh</type>
  17. /// <value>radius | extend | path/to/mesh</value>
  18. /// </collisionShape>
  19. class CollisionResource : public ResourceObject
  20. {
  21. public:
  22. CollisionResource(ResourceManager* manager)
  23. : ResourceObject(manager)
  24. {
  25. }
  26. ~CollisionResource()
  27. {
  28. }
  29. ANKI_USE_RESULT Error load(const ResourceFilename& filename);
  30. PhysicsCollisionShapePtr getShape() const
  31. {
  32. return m_physicsShape;
  33. }
  34. private:
  35. PhysicsCollisionShapePtr m_physicsShape;
  36. };
  37. /// @}
  38. } // end namespace anki