From 87ba9a70843a1b9a46389274aded6e4e74dd2442 Mon Sep 17 00:00:00 2001 From: rextimmy Date: Sat, 7 Jun 2014 12:11:44 +1000 Subject: [PATCH] code cleanup --- Engine/source/T3D/physics/physx3/px3Body.cpp | 24 +------------------ Engine/source/T3D/physics/physx3/px3Body.h | 2 +- Engine/source/T3D/physics/physx3/px3World.cpp | 21 +--------------- README.md | 14 +++++++++++ 4 files changed, 17 insertions(+), 44 deletions(-) diff --git a/Engine/source/T3D/physics/physx3/px3Body.cpp b/Engine/source/T3D/physics/physx3/px3Body.cpp index 4adc39a3c..026309f08 100644 --- a/Engine/source/T3D/physics/physx3/px3Body.cpp +++ b/Engine/source/T3D/physics/physx3/px3Body.cpp @@ -147,10 +147,6 @@ bool Px3Body::init( PhysicsCollision *shape, { physx::PxRigidDynamic *actor = mActor->is(); physx::PxRigidBodyExt::setMassAndUpdateInertia(*actor,mass); - if(mBodyFlags & BF_CCD) - actor->setRigidBodyFlag(physx::PxRigidBodyFlag::eENABLE_CCD, true); - else - actor->setRigidBodyFlag(physx::PxRigidBodyFlag::eENABLE_CCD, false); } // This sucks, but it has to happen if we want @@ -223,7 +219,7 @@ void Px3Body::getState( PhysicsState *outState ) outState->linVelocity = px3Cast( actor->getLinearVelocity() ); outState->angVelocity = px3Cast( actor->getAngularVelocity() ); outState->sleeping = actor->isSleeping(); - outState->momentum = px3Cast( (1.0f/actor->getMass()) * actor->getLinearVelocity() );//?? + outState->momentum = px3Cast( (1.0f/actor->getMass()) * actor->getLinearVelocity() ); } @@ -368,24 +364,6 @@ void Px3Body::setSimulationEnabled( bool enabled ) delete [] shapes; } - -void Px3Body::moveKinematicTo( const MatrixF &transform ) -{ - AssertFatal( mActor, "Px3Body::moveKinematicTo - The actor is null!" ); - - const bool isKinematic = mBodyFlags & BF_KINEMATIC; - if (!isKinematic ) - { - Con::errorf("Px3Body::moveKinematicTo is only for kinematic bodies."); - return; - } - - mWorld->releaseWriteLock(); - - physx::PxRigidDynamic *actor = mActor->is(); - actor->setKinematicTarget(px3Cast(transform)); -} - void Px3Body::setTransform( const MatrixF &transform ) { AssertFatal( mActor, "Px3Body::setTransform - The actor is null!" ); diff --git a/Engine/source/T3D/physics/physx3/px3Body.h b/Engine/source/T3D/physics/physx3/px3Body.h index 4fcb223d1..79096f57b 100644 --- a/Engine/source/T3D/physics/physx3/px3Body.h +++ b/Engine/source/T3D/physics/physx3/px3Body.h @@ -88,7 +88,6 @@ public: // PhysicsObject virtual PhysicsWorld* getWorld(); virtual void setTransform( const MatrixF &xfm ); - virtual void moveKinematicTo( const MatrixF &xfm ); virtual MatrixF& getTransform( MatrixF *outMatrix ); virtual Box3F getWorldBounds(); virtual void setSimulationEnabled( bool enabled ); @@ -100,6 +99,7 @@ public: U32 bodyFlags, SceneObject *obj, PhysicsWorld *world ); + virtual bool isDynamic() const; virtual PhysicsCollision* getColShape(); virtual void setSleepThreshold( F32 linear, F32 angular ); diff --git a/Engine/source/T3D/physics/physx3/px3World.cpp b/Engine/source/T3D/physics/physx3/px3World.cpp index a7617a723..4f333b733 100644 --- a/Engine/source/T3D/physics/physx3/px3World.cpp +++ b/Engine/source/T3D/physics/physx3/px3World.cpp @@ -54,23 +54,6 @@ physx::PxDefaultAllocator Px3World::smMemoryAlloc; F32 Px3World::smPhysicsStepTime = 1.0f/(F32)TickMs; U32 Px3World::smPhysicsMaxIterations = 4; -//filter shader with support for CCD pairs -static physx::PxFilterFlags sCcdFilterShader( - physx::PxFilterObjectAttributes attributes0, - physx::PxFilterData filterData0, - physx::PxFilterObjectAttributes attributes1, - physx::PxFilterData filterData1, - physx::PxPairFlags& pairFlags, - const void* constantBlock, - physx::PxU32 constantBlockSize) -{ - pairFlags = physx::PxPairFlag::eRESOLVE_CONTACTS; - pairFlags |= physx::PxPairFlag::eCCD_LINEAR; - return physx::PxFilterFlags(); -} - - - Px3World::Px3World(): mScene( NULL ), mProcessList( NULL ), mIsSimulating( false ), @@ -180,7 +163,6 @@ bool Px3World::restartSDK( bool destroyOnly, Px3World *clientWorld, Px3World *se return false; } - //just for testing-must remove, should really be enabled via console like physx 2 plugin #ifdef TORQUE_DEBUG physx::PxVisualDebuggerConnectionFlags connectionFlags(physx::PxVisualDebuggerExt::getAllConnectionFlags()); smPvdConnection = physx::PxVisualDebuggerExt::createConnection(gPhysics3SDK->getPvdConnectionManager(), @@ -241,8 +223,7 @@ bool Px3World::initWorld( bool isServer, ProcessList *processList ) sceneDesc.flags |= physx::PxSceneFlag::eENABLE_CCD; sceneDesc.flags |= physx::PxSceneFlag::eENABLE_ACTIVETRANSFORMS; - - sceneDesc.filterShader = sCcdFilterShader; + sceneDesc.filterShader = physx::PxDefaultSimulationFilterShader; mScene = gPhysics3SDK->createScene(sceneDesc); diff --git a/README.md b/README.md index 93e4b09b4..c06f58f4e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ +<<<<<<< HEAD Torque 3D v3.5 - PhysX 3.3 Basic Plugin ========================== +======= +Torque 3D v3.5.1 +================ +>>>>>>> GarageGames/development This is a basic PhysX 3.3 plugin that does not contain any added features like cloth,particles and CCD. This plugin provides no more features than the bullet plugin and can therefore be used as a drop in alternative. It does not modify any files outside of the physx3 folder. A far more advanced physx3 plugin with CCD, cloth and particles can be found on this repository under the physx3 branch. @@ -25,6 +30,7 @@ Setting up PhysX 3.3 manually The following libraries will also be needed: +<<<<<<< HEAD Release , Debug - PhysX3_x86.lib,PhysX3CHECKED_x86.lib @@ -39,6 +45,14 @@ Release , Debug With debug build feel free to change CHECKED to DEBUG if you prefer but it will still require the CHECKED dll's though. Running a project +======= +* [Complete Torque 3D 3.5.1 zip package](http://mit.garagegames.com/Torque3D-3-5-1.zip) with updated TorqueScript documentation, the *Project Manager*, and compiled versions of the templates. +* [Torque 3D Project Manager v2.1](http://mit.garagegames.com/T3DProjectManager-2-1.zip) on its own for use in your T3D forks. + +If you're looking for an older release see the [Torque 3D Archive](https://github.com/GarageGames/Torque3D/wiki/Torque-3D-Archive) + +Creating a New Project Based on a Template +>>>>>>> GarageGames/development ------------------------------------------ - To run a release project you will need the following from the SDK bin folder: