BsCollision.h 932 B

123456789101112131415161718192021222324
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsVector3.h"
  6. namespace BansheeEngine
  7. {
  8. struct ContactPoint
  9. {
  10. Vector3 position; /**< Contact point in world space. */
  11. Vector3 normal; /**< Normal pointing from the second shape to the first shape. */
  12. /** Impulse applied to the objects to keep them from penetrating. Divide by simulation step to get the force. */
  13. float impulse;
  14. float separation; /**< Determines how far are the objects. Negative value denotes penetration. */
  15. };
  16. struct CollisionData
  17. {
  18. Collider* collider;
  19. Vector<ContactPoint> contactPoints; // Note: Not too happy this is heap allocated, use static allocator?
  20. };
  21. }