Hi Everyone
Ive got physics working really well using 3d shapes it seems to handle up to around 700 at the same time . Now I'm moving the physics into a real world situation where objects are created dynamically using INSTANCEOBJECT and a culling system now the system immediately crashes.
Ive done tests and found the problem is caused within AppGameKit 3d engine, the problem is the Physics system doesn't work with Objects dynamically created,.
See demo Code below that demonstrates the error, When Code is run as-is it crashes but when you disable the line with the InstanceObject and Enable the line with the crateobjectbox it works fine.
Only small Apps can have individual objects like this, anything serious will have many instances and quite often a culling system that dynamically adds and removes objects as they are visibility tested.
until this is resolved there can be no physics worlds larger than a small area.
PS also i see Some people are saying that Raycast now works with Scaled Objects but all code tests show that that is still broken. can anyone confirm if this is fixed.
Thanks Any Help or info would be great
// set window properties
SetWindowTitle( "demonstrate crash using InstanceObject and 3D Physics Engine" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetScissor(0,0,0,0)
Create3DPhysicsWorld()
Set3DPhysicsGravity(0,-1,0)
CreateObjectBox( 1, 200,20,200 )
Create3DPhysicsStaticBody( 1 )
SetObjectShapeBox(1)
//This is the test object thats going to be used with instanceObject
CreateObjectBox( 1000, 10,10,10 )
for t=2 to 100
//*********************************************
//*********************************************
// here is the problem
InstanceObject(t,1000) //This line crashes the system
// although This line works perfect
//createobjectbox(t,10,10,10)
//*********************************************
//*********************************************
SetObjectPosition( t, random(-20,20), random(-20,20), random(-20,20) )
Create3DPhysicsDynamicBody( t )
SetObjectColor(t,random(0,255),random(0,255),random(0,255),255)
next t
SetCameraPosition( 1, 0,30,-80 )
SetCameraLookAt( 1, 0,10,0, 0 )
do
Step3DPhysicsWorld()
Sync()
loop