BsPhysXPlaneCollider.cpp 713 B

1234567891011121314151617181920212223242526272829
  1. #include "BsPhysXPlaneCollider.h"
  2. #include "BsPhysX.h"
  3. #include "PxPhysics.h"
  4. #include "BsFPhysXCollider.h"
  5. using namespace physx;
  6. namespace BansheeEngine
  7. {
  8. PhysXPlaneCollider::PhysXPlaneCollider(PxPhysics* physx, const Vector3& position, const Quaternion& rotation)
  9. {
  10. PxPlaneGeometry geometry;
  11. PxShape* shape = physx->createShape(geometry, *gPhysX().getDefaultMaterial(), true);
  12. shape->setLocalPose(toPxTransform(position, rotation));
  13. mInternal = bs_new<FPhysXCollider>(shape);
  14. }
  15. PhysXPlaneCollider::~PhysXPlaneCollider()
  16. {
  17. bs_delete(mInternal);
  18. }
  19. FPhysXCollider* PhysXPlaneCollider::getInternal() const
  20. {
  21. return static_cast<FPhysXCollider*>(mInternal);
  22. }
  23. }