code cleanup

This commit is contained in:
rextimmy 2014-06-07 12:11:44 +10:00
parent d58a69e76c
commit 87ba9a7084
4 changed files with 17 additions and 44 deletions

View file

@ -147,10 +147,6 @@ bool Px3Body::init( PhysicsCollision *shape,
{
physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
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<Point3F>( actor->getLinearVelocity() );
outState->angVelocity = px3Cast<Point3F>( actor->getAngularVelocity() );
outState->sleeping = actor->isSleeping();
outState->momentum = px3Cast<Point3F>( (1.0f/actor->getMass()) * actor->getLinearVelocity() );//??
outState->momentum = px3Cast<Point3F>( (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<physx::PxRigidDynamic>();
actor->setKinematicTarget(px3Cast<physx::PxTransform>(transform));
}
void Px3Body::setTransform( const MatrixF &transform )
{
AssertFatal( mActor, "Px3Body::setTransform - The actor is null!" );

View file

@ -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 );

View file

@ -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);

View file

@ -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: