No physics plugin active!
by siba · in Torque 3D Professional · 06/22/2011 (6:45 pm) · 7 replies
I scripted a box to spawn with physics properties and when I load the game, I do not see any "physics shapes" section, and when I execute the script manually, I get that error, so I figured I was missing a .cs file with some physics properties or something, so I found physicshapes.cs. loaded that, and it did the same thing
#2
Which version of Engine, what template, etc..
Do a search, setting up the Physics in T3D is not as simple as start
a new project. The two templates do not have Physics implemented initially.
06/22/2011 (11:39 pm)
Not enough details..Which version of Engine, what template, etc..
Do a search, setting up the Physics in T3D is not as simple as start
a new project. The two templates do not have Physics implemented initially.
#3
06/23/2011 (5:49 am)
You have to implement physx or bullet, The pacific demo has physx implemented, the others do not, and the two templates do not either
#4
In your projects buildFiles/config/project.conf (assuming windows and a project based on the full template) add the following line somewhere between the beginConfig() and endConfig():
Then you will need to run the generateProjects.bat for your project and compile.
Once you have compiled a physics-enabled exe, add the following:
art/datablocks/physicsShape.cs (create if it does not exist)
art/shapes/physicsShapes/crate_square_unbroken.DAE - copy this from the Pacific demo to the same location in your project.
art/datablocks/datablockExec.cs - add the following line anywhere in the file
At this point you should be able load the editor and have the "PhysicsShape" category appear with the PSCrateSquareUnbreakable; you should be able to place this now and see some basic functionality.
06/23/2011 (6:29 am)
Its not so much as "implementing" as it is enabling and creating a placeable object:In your projects buildFiles/config/project.conf (assuming windows and a project based on the full template) add the following line somewhere between the beginConfig() and endConfig():
includeModule( 'bullet' ); // could also be 'physx'
Then you will need to run the generateProjects.bat for your project and compile.
Once you have compiled a physics-enabled exe, add the following:
art/datablocks/physicsShape.cs (create if it does not exist)
datablock PhysicsShapeData( PSCrateSquareUnbreakable )
{
category = "PhysicsShape";
shapeName = "art/shapes/physicsShapes/crate_square_unbroken.DAE";
invulnerable = 1;
friction = 1.0;
staticFriction = 0.1;
buoyancyDensity = 0.09;
restitution = 1.0;
linearDamping = 0.1;
angularDamping = 0.1;
};art/shapes/physicsShapes/crate_square_unbroken.DAE - copy this from the Pacific demo to the same location in your project.
art/datablocks/datablockExec.cs - add the following line anywhere in the file
exec("./physicsShape.cs");At this point you should be able load the editor and have the "PhysicsShape" category appear with the PSCrateSquareUnbreakable; you should be able to place this now and see some basic functionality.
#5
either such as :
And a few more spread thru the scripts...
Go thru the Pacific Demo to see them all
06/23/2011 (8:37 am)
Not quite, the Basic /Full templates do not include the Script partseither such as :
function onStart()
{
// The core does initialization which requires some of
// the preferences to loaded... so do that first.
exec( "./client/defaults.cs" );
...
...
// Init the physics plugin.
physicsInit();
...
}
(AND Defaults.cs)
$pref::Video::mode = "1280 800 false 32 60 4";
$pref::windEffectRadius = 75.0;
$pref::Physics::threadCount = 4;
(And)
function GameConnection::onConnectionAccepted(%this)
{
// Called on the new connection object after connect() succeeds.
LagIcon.setVisible(false);
// Startup the physics world on the client before any
// datablocks and objects are ghosted over.
physicsInitWorld( "client" );
}
(And)
function disconnect()
{
// We need to stop the client side simulation
// else physics resources will not cleanup properly.
physicsStopSimulation( "client" );
...
..And a few more spread thru the scripts...
Go thru the Pacific Demo to see them all
#6
I'am a newby running the new 2.0 Torque version and having a hard time with physics.
Seems that everything above is fine. The rigidshape bouncingboulder works awfully (goes through ground from time to time and if it detects my player, my player does not detect it)
So I wanted to give the big mother class a try. I cannot create physicshape or physicshapedata (failed and I noticed not available in the datablock editor).
I am a curious but poor programmer and feel lost.
maybe anyone has a complete working example? My need is basic: barrels are falling and I want my player to avoid them and not go through them if they don't move.
Thanks a lot for your help,
Michaël
04/07/2013 (12:25 am)
Hello,I'am a newby running the new 2.0 Torque version and having a hard time with physics.
Seems that everything above is fine. The rigidshape bouncingboulder works awfully (goes through ground from time to time and if it detects my player, my player does not detect it)
So I wanted to give the big mother class a try. I cannot create physicshape or physicshapedata (failed and I noticed not available in the datablock editor).
I am a curious but poor programmer and feel lost.
maybe anyone has a complete working example? My need is basic: barrels are falling and I want my player to avoid them and not go through them if they don't move.
Thanks a lot for your help,
Michaël
#7
by default t3d do not have physx or bullet.
u have to add bullet first to make "physicshape or physicshapedata" available under datablock editor.
did u try :
http://www.garagegames.com/community/forums/viewthread/126602/1#comment-810450
?
"maybe anyone has a complete working example? My need is basic: barrels are falling and I want my player to avoid them and not go through them if they don't move."
that should work just fine after u add bullet engine in your project.
here is tut:
http://www.garagegames.com/community/forums/viewthread/119211
try this series:
http://www.garagegames.com/community/resources/view/20937
04/14/2013 (7:31 pm)
" I cannot create physicshape or physicshapedata (failed and I noticed not available in the datablock editor). "by default t3d do not have physx or bullet.
u have to add bullet first to make "physicshape or physicshapedata" available under datablock editor.
did u try :
http://www.garagegames.com/community/forums/viewthread/126602/1#comment-810450
?
"maybe anyone has a complete working example? My need is basic: barrels are falling and I want my player to avoid them and not go through them if they don't move."
that should work just fine after u add bullet engine in your project.
here is tut:
http://www.garagegames.com/community/forums/viewthread/119211
try this series:
http://www.garagegames.com/community/resources/view/20937
Torque 3D Owner siba