Quote: "Actually this works but it is not good. You can no longer clone/instance and object."
Obviously this workaround requires every individual object to be loaded from an external file having its position already done.
Quote: "you can also use phy set rigid body position/rotation, to position it after"
I was under (maybe wrong?) impression that once an object was setup as static, it cannot be moved.
Quote: "No you don't, position and rotation before hand is fine"
Here is an example of the problem:
cls
set display mode 1024,768,32
sync on
sync rate 60
phy start
phy set gravity 0,-25,0
autocam off
position camera -200,200,500
point camera -200,100,0
` object 1 - untouched object just placed as static
` object 2 - Positioned prior set as static
` object 3 - Positioned after set as static
for i = 1 to 3
load object "ramp.X",i
next i
`position object 2 prior setup as static
position object 2,-200,0,0
`setup as static
phy make rigid body static mesh 1
phy make rigid body static mesh 2
phy make rigid body static mesh 3
`move object 3 once declared as static
phy set rigid body position 3,-400,0,0
`strangely enough unless the object itself is moved using position object,
`only the collision data will move not the object.
`Enable this line to see the object
`position object 3,-400,0,0
`load spheres
for i = 4 to 6
make object sphere i,15
next i
`position spheres
position object 4,0,300,-320
position object 5,-200,300,-320
position object 6,-400,300,-320
`set as dynamci spheres
phy make rigid body dynamic sphere 4
phy make rigid body dynamic sphere 5
phy make rigid body dynamic sphere 6
phy update
cam = 0
do
set cursor 0,0
print "Change Cameras: Press 1 or 2"
Print "Reset Physics: Space"
`camera settings
if inkey$() = "1" then cam = 0
if inkey$() = "2" then cam = 1
if cam = 0
text 315,80,"Object 1"
text 480,80,"Object 2 "
text 660,80,"Object 3"
text 310,95,"Unmodified"
text 430,95,"Position prior setup"
text 610,95,"Position after setup"
position camera -200,200,500
point camera -200,100,0
endif
if cam = 1
position camera -800,500,-300
point camera 0,200,0
endif
`reset physics
if spacekey() = 1 and setup = 0
phy clear
`position spheres
position object 4,0,300,-320
position object 5,-200,300,-320
position object 6,-400,300,-320
`set as dynamci spheres
phy make rigid body dynamic sphere 4
phy make rigid body dynamic sphere 5
phy make rigid body dynamic sphere 6
`setup as static
phy make rigid body static mesh 1
phy make rigid body static mesh 2
phy make rigid body static mesh 3
phy set rigid body position 3,-400,0,0
phy update
setup = 1
endif
if spacekey() = 0 and setup = 1 then setup = 0
phy update
sync
loop
The object on the
left (edit:hehe typo), which was just loaded and setup as static, works correctly. The middle one, which was moved prior setting it as static does not work. Finally, the more interesting, if an object is setup as static and moved, the collision data will move, while the object attached to it remains were it was initialised and the object needs to be moved manually.
Find attached the file ramp.x used in the code above.
Home computers are being called upon to perform many new functions, including the consumption of homework formerly eaten by the dog.