Using the trial version of dark physics for the software compo, I stepped into this problem. When I called
phy clear it deleted everything in the physics world except joints.
See Code:
cls
sync on
sync rate 60
phy start
make object cube 1,10
position object 1,0,0,0
phy make rigid body dynamic box 1
make object cube 2,10
position object 2,8,5,0
phy make rigid body dynamic box 2
make object cube 3,100
scale object 3,100,5,100
position object 3,0,-30,0
phy make rigid body static box 3
phy make fixed joint 1,1,2
phy build fixed joint 1
do
set cursor 0,0
print "Press enter to reset."
if returnkey() = 1 and retkey = 0
`delete all physics
phy clear
`re-initilise world
position object 1,0,0,0
position object 2,8,5,0
rotate object 1,0,0,0
rotate object 2,0,0,0
phy make rigid body dynamic box 1
phy make rigid body dynamic box 2
phy make rigid body static box 3
`Check if joint exist - without this line, error occurs
` if phy get joint exist(1) = 1 then phy delete joint 1
phy make fixed joint 1,1,2
phy build fixed joint 1
retkey = 1
endif
if returnkey() = 0 and retkey = 1 then retkey = 0
phy update
sync
loop
In the code above, DP will give a
Failed to set up fixed joint as ID is already in use error upon pressing enter to reset the world. If on the other hand, the joint is manually deleted, everything seems to work correctly.
Is this a normal behaviour or maybe its just the trial causing this problem?
Home computers are being called upon to perform many new functions, including the consumption of homework formerly eaten by the dog.