Merge branch 'master' into console-func-refactor

Conflicts:
	Engine/source/app/net/net.cpp
	Engine/source/console/astNodes.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/console/console.h
	Engine/source/console/consoleInternal.h
	Engine/source/console/engineAPI.h
This commit is contained in:
Daniel Buckmaster 2014-10-14 14:40:17 +11:00
commit b507dc9555
6487 changed files with 315149 additions and 609761 deletions

View file

@ -24,7 +24,7 @@
#define _BULLET_H_
// NOTE: We set these defines which bullet needs here.
#ifdef TORQUE_OS_WIN32
#ifdef TORQUE_OS_WIN
#define WIN32
#endif

View file

@ -335,16 +335,22 @@ void BtBody::applyImpulse( const Point3F &origin, const Point3F &force )
AssertFatal( mActor, "BtBody::applyImpulse - The actor is null!" );
AssertFatal( isDynamic(), "BtBody::applyImpulse - This call is only for dynamics!" );
// Convert the world position to local
MatrixF trans = btCast<MatrixF>( mActor->getCenterOfMassTransform() );
trans.inverse();
Point3F localOrigin( origin );
trans.mulP( localOrigin );
if ( mCenterOfMass )
{
Point3F relOrigin( origin );
Point3F relOrigin( localOrigin );
mCenterOfMass->mulP( relOrigin );
Point3F relForce( force );
mCenterOfMass->mulV( relForce );
mActor->applyImpulse( btCast<btVector3>( relForce ), btCast<btVector3>( relOrigin ) );
}
else
mActor->applyImpulse( btCast<btVector3>( force ), btCast<btVector3>( origin ) );
mActor->applyImpulse( btCast<btVector3>( force ), btCast<btVector3>( localOrigin ) );
if ( !mActor->isActive() )
mActor->activate();

View file

@ -286,7 +286,7 @@ void BtWorld::explosion( const Point3F &pos, F32 radius, F32 forceMagnitude )
void BtWorld::onDebugDraw( const SceneRenderState *state )
{
mDebugDraw.setCuller( &state->getFrustum() );
mDebugDraw.setCuller( &state->getCullingFrustum() );
mDynamicsWorld->setDebugDrawer( &mDebugDraw );
mDynamicsWorld->debugDrawWorld();

View file

@ -311,7 +311,8 @@ PhysicsDebris* PhysicsDebris::create( PhysicsDebrisData *datablock,
}
PhysicsDebris::PhysicsDebris()
: mLifetime( 0.0f ),
: mDataBlock( NULL ),
mLifetime( 0.0f ),
mShapeInstance( NULL ),
mWorld( NULL ),
mInitialLinVel( Point3F::Zero )
@ -342,6 +343,12 @@ bool PhysicsDebris::onAdd()
if ( !Parent::onAdd() )
return false;
if( !mDataBlock )
{
Con::errorf("PhysicsDebris::onAdd - Fail - No datablock");
return false;
}
// If it has a fixed lifetime then calculate it.
if ( mDataBlock->lifetime > 0.0f )
{

View file

@ -41,6 +41,7 @@
#include "lighting/lightQuery.h"
#include "console/engineAPI.h"
using namespace Torque;
bool PhysicsShape::smNoCorrections = false;
bool PhysicsShape::smNoSmoothing = false;
@ -240,7 +241,7 @@ void PhysicsShapeData::onRemove()
void PhysicsShapeData::_onResourceChanged( const Torque::Path &path )
{
if ( path != Path( shapeName ) )
if ( path != Path( shapeName ) )
return;
// Reload the changed shape.

View file

@ -46,7 +46,7 @@
#define __APPLE__
#elif defined(TORQUE_OS_LINUX) && !defined(LINUX)
#define LINUX
#elif defined(TORQUE_OS_WIN32) && !defined(WIN32)
#elif defined(TORQUE_OS_WIN) && !defined(WIN32)
#define WIN32
#endif

View file

@ -527,7 +527,7 @@ bool PxMultiActorData::preload( bool server, String &errorBuffer )
return false;
}
if (!shapeName || shapeName == '\0')
if (!shapeName || shapeName[0] == '\0')
{
errorBuffer = "PxMultiActorDatas::preload: no shape name!";
return false;
@ -570,7 +570,7 @@ bool PxMultiActorData::preload( bool server, String &errorBuffer )
// Register for file change notification to reload the collection
if ( server )
FS::AddChangeNotification( physXStream, this, &PxMultiActorData::_onFileChanged );
Torque::FS::AddChangeNotification( physXStream, this, &PxMultiActorData::_onFileChanged );
return true;
}
@ -2648,4 +2648,4 @@ ConsoleMethod( PxMultiActorData, reload, void, 2, 2, ""
"If the reload sucessfully completes, all PxMultiActor's will be notified.\n\n")
{
object->reload();
}
}

View file

@ -39,7 +39,7 @@ AFTER_MODULE_INIT( Sim )
{
NamedFactory<PhysicsPlugin>::add( "PhysX", &PxPlugin::create );
#if defined(TORQUE_OS_WIN32) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
NamedFactory<PhysicsPlugin>::add( "default", &PxPlugin::create );
#endif

View file

@ -448,9 +448,8 @@ void PxWorld::releaseActor( NxActor &actor )
// Clear the userdata.
actor.userData = NULL;
// If the scene is not simulating then we have the
// write lock and can safely delete it now.
if ( !mIsSimulating )
// actors are one of the few objects that are stable removing this way in physx 2.8
if (mScene->isWritable() )
{
mScene->releaseActor( actor );
}