Game Development Community

T3D 1.2 - Getting PhysX objects working in the Full PhysX Template - LOGGED (THREED-3152)

by CSMP · in Torque 3D Professional · 11/26/2011 (9:00 pm) · 6 replies

I've just tried loading up the Pacific Demo's physX items into the Full PhysX Template and it seems the crate and pallet move when being shot at but none of the objects are destroyable.

This is the error that is showing up when PhysicsShape's are shot:
art/datablocks/weapons/Lurker.cs (225): Unknown command damage.
  Object (5505) PhysicsShape -> GameBase -> SceneObject -> NetObject -> SimObject

I've added:
art/datablocks/physicsShape.cs
scripts/server/physicsShape.cs
scripts/Server/physX.cs

and executed them in the respective files so I'm not sure what I'm missing, I thought that the PhysX Template would actually have PhysX demonstrations but I guess not...

#1
11/27/2011 (6:27 pm)
If I remember correctly, you need to add in the functions that apply the damage and also change the onCollision and radiusDamage functions to work with gameBaseObjects instead of shapeBaseObjects.

I think the extra functions were in the shapebase.cs file in the Pacific demo to copy from.


But like you said, the physX demo really should have some sort of example working already.
#2
11/28/2011 (2:14 pm)
@GG: Adding in the scripts and maybe some art(only in Full template) from the Pacific demo would complete the PhysX templates.
#3
01/11/2012 (10:51 am)
Thanks for the suggestion CSMP. I've gone ahead and logged this under improvement ticket number THREED-3152 for review.
#4
07/28/2012 (10:08 am)
i have the same error as above thus anyone now the fix for it or where can you find more about it the docs Introduction to Destructible Objects
i did all that and allot more what i coulth find in the pasific demo and added that in full physx template but no explosion or breakable objects nothing happens
#5
07/29/2012 (8:17 am)
i finally found out here is a sort awnser what you need to get physx to work in torque3d 1.2

error
art/datablocks/weapons/Lurker.cs (225): Unknown command damage.
Object (4557) PhysicsShape -> GameBase -> SceneObject -> NetObject -> SimObject


ad this in the game\scripts\server\shapeBase.cs and the error is gone

//-----------------------------------------------------------------------------

function GameBase::damage(%this, %sourceObject, %position, %damage, %damageType)
{
// All damage applied by one object to another should go through this method.
// This function is provided to allow objects some chance of overriding or
// processing damage values and types. As opposed to having weapons call
// ShapeBase::applyDamage directly. Damage is redirected to the datablock,
// this is standard procedure for many built in callbacks.

%datablock = %this.getDataBlock();
if ( isObject( %datablock ) )
%datablock.damage(%this, %sourceObject, %position, %damage, %damageType);
}

//-----------------------------------------------------------------------------

Torque_3D_Pro_1.1_1of2-Win.exe
Torque_3D_Pro_1.1_2of2-Win.exe in this is the pasific demo

and do allso add these from the pasific demo put them in and ad to torque3d 1.2

added script game/art/datablocks/physicsShape.cs
added script game/scripts/server/physicsShape.cs
added script game/scripts/server/physX.cs
added in script game/scripts/server/scriptExec.cs:
exec("./physicsShape.cs");
exec("./physX.cs");
added in script art/datablocks/datablocksExec.cs:
exec("./physicsShape.cs");
#6
08/14/2015 (7:28 am)
Hi can you show your

game/scripts/server/physX.cs