Right sorry...
The quick made source code but shows the "blasting rock" thing.
sync on
sync rate 60
phy start
autocam off
position camera -20,10,-25
point camera 0,10,0
make light 1
set directional light 1, -5,-5,5
`boulder (add the correct root for stone model)
load object "*stone_test.x", 1
perform checklist for object limbs 1
limbs=checklist quantity()
`make shards
dim object(limbs)
for lim=1 to limbs
if limb exist(1,lim)=1
object(lim)=lim+1
make object from limb object(lim),1,lim,1
color object object(lim), rgb(rnd(255),rnd(255),rnd(255))
phy make rigid body dynamic box object(lim)
`***************************************
`change rigid body position to 0,30,0 and they'll explode in the air
`***************************************
phy set rigid body position object(lim),0,0,0
endif
next lim
delete object 1
` make static ground
make object box 20,40,1,40
phy make rigid body static box 20
color object 20,RGB(0,0,160)
`main loop
`************************************************
do
`the "stone shard exists" checks the limbs from 2 to 12 (their numbers), do they exists or not and says so
set cursor 0,0
print "FPS:"+str$(screen fps())
for c=2 to 12
print "stone shard"+" "+str$(c)+" "+"exists:"+" "+str$(object exist(c))
next c
control camera using arrowkeys 0,5,5
phy update
sync
loop
`***************************************************
`***************************************************
The stone model is attached.
EDIT: made a quick joint simulation also, it uses the same stone model, source code is:
sync on
sync rate 60
phy start
autocam off
position camera -20,20,-25
point camera 0,10,0
make light 1
set directional light 1, -5,-5,5
`boulder (add the correct root for stone model)
load object "*stone_test.x", 1
perform checklist for object limbs 1
limbs=checklist quantity()
`make shards
dim object(limbs)
for lim=1 to limbs
if limb exist(1,lim)=1
object(lim)=lim+1
make object from limb object(lim),1,lim,1
color object object(lim), rgb(rnd(255),rnd(255),rnd(255))
phy make rigid body dynamic box object(lim)
`***************************************
`change rigid body position to 0,30,0 and they'll explode in the air
`***************************************
phy set rigid body position object(lim),0,0,0
endif
next lim
delete object 1
`make joints
stone_a=2
stone_b=stone_a+1
for joint=1 to 11
phy make fixed joint joint,stone_a,stone_b
phy set joint break limits joint, 1000,1000
inc stone_a
next joint
`make static ground
make object box 20,40,1,40
make object box 21,1,10,40
position object 21,20,5,0
make object box 22,1,10,40
position object 22,-20,5,0
make object box 23,40,10,1
position object 23,0,5,20
make object box 24,40,10,1
position object 24,0,5,-20
for ground=20 to 24
phy make rigid body static box ground
color object ground,RGB(rnd(255),rnd(255),rnd(255))
next ground
`main loop
`************************************************
do
`the "stone shard exists" checks the limbs from 2 to 12 (their numbers), do they exists or not and says so
set cursor 0,0
print "FPS:"+str$(screen fps())
for c=2 to 12
print "stone shard"+" "+str$(c)+" "+"exists:"+" "+str$(object exist(c))
next c
control camera using arrowkeys 0,5,5
phy update
sync
loop
`***************************************************
`***************************************************
"Enjoy the moment... forget the past and the future. Eternity is here..."