I have an extremely annoying bug with a rounded cube dynamic convex rigid body that refuses to rotate when bouncing, friction or anything else that I do not do manually do (i.e "Phy set rigid body angular velocity")
Note: My current project is a hovercar racing game and the body in question is the car's "collision shape" made in Caligari Gamespace, as well as the car and they (should) fit perfectly.
REM Project: Hover racing championship
REM Created: 16/12/2006 13:37:33
REM
REM ***** Main Source File *****
REM
sync on;sync rate 9000
autocam off
set window title "Loading..."
minimize window
sync
set camera range 1,90000
phy start
phy set gravity 0,-50.0,0
phy make material 1,"slippery"
phy set material restitution 1,0.01
phy set material static friction 1,0.00001
phy set material dynamic friction 1,1.5
phy build material 1
load object "Colobject0.x",1
`scale object 1,150,150,150
`hide object 1
load object "Rocket ship2.x",5
position object 1,0,700,0
phy set rigid body terrain extent -4024
phy make rigid body dynamic convex 1,"Rocket ship.phy",1
`phy load rigid body dynamic convex 1,"Rocket ship.phy",1
load object "Mountain road.x",2
position object 2,0,0,0
set object collision to polygons 2
phy make rigid body static terrain 2,"Mountain road.phy",1
`phy load rigid body static terrain 2,"Mountain road.phy"
`sc_setupcomplexobject 2,0,2
make object sphere 3,100
`set object collision to spheres 3
hide object 3
`sc_setupobject 3,0,0
load object "sky.x",4
scale object 4,90000,90000,90000
`hide object 4
yrotate object 5,180
fix object pivot 5
maximize window
phy set rigid body mass 1,300.5
set window title "Hover racing champoinship"
do
`sc_updateobject 3
`x#=camera position x()
`y#=camera position y()
`z#=camera position z()
position camera object position x(1),object position y(1)+10,object position z(1)
set camera to object orientation 5
move camera -50.5
position object 5,object position x(1),object position y(1),object position z(1)
set object to object orientation 5,1
`sc_sphereslide(3,x#,y#,z#,object position x(3),object position y(3),object position z(3),100,0)
`position camera sc_getcollisionslidex(),sc_getcollisionslidey(),sc_getcollisionslidez()
position object 4,camera position x(),camera position y(),camera position z()
while phy get collision data()
if phy get collision object a()=1 or phy get collision object b()=1
if upkey()=1 then phy add rigid body local force 1,0,0,1300,1
if downkey()=1 then phy add rigid body local force 1,0,0,-1300,1
endif
endwhile
if inkey$()="," then phy set rigid body angular velocity 1,-1.0,0,0
if inkey$()="." then phy set rigid body angular velocity 1,1.0,0,0
if leftkey()=1 then phy set rigid body angular velocity 1,0,-0.3,0
if rightkey()=1 then phy set rigid body angular velocity 1,0,0.3,0
if leftkey()=0 and rightkey()=0 and inkey$()="" then phy set rigid body angular velocity 1,0,0,0
if spacekey()=1 then phy add rigid body local force 1,0,0,3000,1
phy update
if escapekey()=1 then exit
sync
loop
set window title "Shutdown"
phy clear
phy end
delete objects 1,2
end
delete memblock 0
You need the external files, it takes a long time to load, and unless you have a HUGE+ computer, you should turn all except your essential applications off.(I will post them separately)
<?>