From 17df1362bde4444fd51fa497c2d5490802ffe24d Mon Sep 17 00:00:00 2001 From: John3 Date: Wed, 13 Jul 2016 19:54:02 -0500 Subject: [PATCH 1/2] fix create datablock for physicsshapes. --- Engine/source/T3D/physics/physicsShape.cpp | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Engine/source/T3D/physics/physicsShape.cpp b/Engine/source/T3D/physics/physicsShape.cpp index 660db0791..a1acbb481 100644 --- a/Engine/source/T3D/physics/physicsShape.cpp +++ b/Engine/source/T3D/physics/physicsShape.cpp @@ -271,6 +271,8 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer ) { if ( !Parent::preload( server, errorBuffer ) ) return false; + + if( server ) return true; // If we don't have a physics plugin active then // we have to fail completely. @@ -280,19 +282,24 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer ) return false; } - if ( !shapeName || !shapeName[0] ) + if( shapeName && shapeName[0] != '\0' && !bool(shape) ) { - errorBuffer = "PhysicsShapeData::preload - No shape name defined."; - return false; - } + // Load the shape. + shape = ResourceManager::get().load(shapeName); + if( bool(shape) == false ) + { + errorBuffer = String::ToString("PhysicsShapeData::load: Couldn't load shape \"%s\"", shapeName); + return false; + } + else + { + TSShapeInstance* pDummy = new TSShapeInstance(shape, !server); + delete pDummy; + } - // Load the shape. - shape = ResourceManager::get().load( shapeName ); - if ( bool(shape) == false ) - { - errorBuffer = String::ToString( "PhysicsShapeData::preload - Unable to load shape '%s'.", shapeName ); - return false; } + else + return false; // Prepare the shared physics collision shape. if ( !colShape ) From 4936567c0ddac2e09f072a2a17449fb81bcf7826 Mon Sep 17 00:00:00 2001 From: John3 Date: Fri, 15 Jul 2016 19:45:17 -0500 Subject: [PATCH 2/2] removed to allow create server side "TSShape and PhysicsCollisionRef" --- Engine/source/T3D/physics/physicsShape.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Engine/source/T3D/physics/physicsShape.cpp b/Engine/source/T3D/physics/physicsShape.cpp index a1acbb481..f08f18bb4 100644 --- a/Engine/source/T3D/physics/physicsShape.cpp +++ b/Engine/source/T3D/physics/physicsShape.cpp @@ -272,8 +272,6 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer ) if ( !Parent::preload( server, errorBuffer ) ) return false; - if( server ) return true; - // If we don't have a physics plugin active then // we have to fail completely. if ( !PHYSICSMGR )