BsPhysXRigidbody.cpp 539 B

12345678910111213141516171819202122
  1. #include "BsPhysXRigidbody.h"
  2. #include "PxRigidDynamic.h"
  3. #include "PxScene.h"
  4. using namespace physx;
  5. namespace BansheeEngine
  6. {
  7. PhysXRigidbody::PhysXRigidbody(PxPhysics* physx, PxScene* scene, const Vector3& position, const Quaternion& rotation)
  8. {
  9. PxTransform tfrm = toPxTransform(position, rotation);
  10. mInternal = physx->createRigidDynamic(tfrm);
  11. scene->addActor(*mInternal);
  12. }
  13. PhysXRigidbody::~PhysXRigidbody()
  14. {
  15. // TODO - Remove from scene? Or is that part of release()?
  16. mInternal->release();
  17. }
  18. }