@ Matty H
Hmm, I like the sound of that raycasting solution, I'll try that. - My experience with bitmaps should be sufficient for me to make a sort of terrain heightfield cooking application similar to the one I'd be making to cook the physical meshes of all the ingame props as well.
Quote: "I presume the terrains may just be handled a little different in DBPro?"
Well that was the weird part about it; there
are terrain commands in the help but none of these particular commands featured. xD
It was almost as if you'd invented commands and DBP went "Yeah I know what these are supposed to do" - they're recognized and work fine, but are not the same terrain commands I've come across in other examples.
Quote: "it might help if you could send me a model to test on"
I like the sound of this approach so I've attached Blade in a .rar here:
Included in there is also:
Dynamic body.p (which is the cooked physical mesh)
Dynamic body.x (the model I used to cook that with)
and Blade.x (the complete look of Blade with the wheels attached (simply for reference))
You may also want this code which illustrates how I'm setting the cars up in WOR and shows how to scale them (it's no good if we find a solution for one scale then I try it in WOR with a different scale and it doesn't work again xD):
// Project: World Off Road
// < CAR SETUP SOURCE >
// SOHARIX ©
// SETUP EACH CAR INDIVIDUALLY
SPAWNCAR:
if EDIT=0 then CARAY#=object angle y(START)
// TENSE
if CARCHOSEN$="Tense"
FRONTMAT=0
BACKMAT=0
CARTORQUE=500000
FRONTOFF#=3.2
BACKOFF#=3.2
SIDEOFF#=3.2
WHEELWEIGHT#=10
MAXANG#=120.0
SCALE=10
gosub MAKELOCALCAR
endif
// TRENT
if CARCHOSEN$="Trent"
FRONTMAT=0
BACKMAT=0
CARTORQUE=500000
FRONTOFF#=3.2
BACKOFF#=3.2
SIDEOFF#=3.2
WHEELWEIGHT#=10
MAXANG#=100.0
SCALE=10
gosub MAKELOCALCAR
endif
// MONSTER
if CARCHOSEN$="Monster"
FRONTMAT=0
BACKMAT=0
CARTORQUE=500000
FRONTOFF#=3.2
BACKOFF#=3.2
SIDEOFF#=3.2
WHEELWEIGHT#=10
MAXANG#=120.0
SCALE=10
gosub MAKELOCALCAR
endif
// BLADE
if CARCHOSEN$="Blade"
FRONTMAT=0
BACKMAT=0
CARTORQUE=500000
FRONTOFF#=3.2
BACKOFF#=3.2
SIDEOFF#=4.0
WHEELWEIGHT#=10
MAXANG#=120.0
SCALE=10
gosub MAKELOCALCAR
endif
// CRUNCH
if CARCHOSEN$="Crunch"
FRONTMAT=0
BACKMAT=0
CARTORQUE=500000
FRONTOFF#=3.2
BACKOFF#=3.2
SIDEOFF#=3.2
WHEELWEIGHT#=10
MAXANG#=70.0
SCALE=10
gosub MAKELOCALCAR
endif
// RETURN TO GAMELOAD
return
MAKELOCALCAR:
// DYNAMIC BODY
load object "Data\3D\Dynamicbody.x",CARNO
scale object CARNO,10,10,10
`phy cook convex mesh CARNO,CARNO
phy load convex mesh "Data\3D\Dynamicbody.p",CARNO
position object CARNO,CARX#,CARY#,CARZ#
phy make convex mesh CARNO,CARNO,10
phy set material CARNO,0,1
hide object CARNO
make object collision box CARNO,0.1,0.1,0.1,-0.1,-0.1,-0.1,0
// DYNAMIC FRONT LEFT WHEEL
load object "Data\3D\"+CARCHOSEN$+"\Front.x",CARNO+1
scale object CARNO+1,SCALE+1,SCALE+1,SCALE+1
xrotate object CARNO+1,180
zrotate object CARNO+1,-90
position object CARNO+1,CARX#-SIDEOFF#,CARY#,CARZ#+FRONTOFF#
if CARNO=OBJ then set object effect CARNO+1,4
if CARNO=OBJ2 then set object effect CARNO+1,5
texture object CARNO+1,1,SHADER+1
texture object CARNO+1,2,SHADER+2
set object collision off CARNO+1
if val(left$(OPTIONS$(5),4))>0 then set shadow shading on CARNO+1,-1,50,1
phy make sphere CARNO+1,WHEELWEIGHT#
scale object CARNO+1,SCALE,SCALE,SCALE
phy set angular damping CARNO+1,50
phy set material CARNO+1,0,1
phy set max angular velocity CARNO+1,MAXANG#
phy joint desc set actor a 1,CARNO
phy joint desc set actor b 1,CARNO+1
phy joint desc set global anchor 1,object position x(CARNO+1),object position y(CARNO+1),object position z(CARNO+1)
phy joint desc set global axis 1,1,0,0
phy make joint J,1
J=J+1
// DYNAMIC FRONT RIGHT WHEEL
load object "Data\3D\"+CARCHOSEN$+"\Front.x",CARNO+2
scale object CARNO+2,SCALE+1,SCALE+1,SCALE+1
zrotate object CARNO+2,-90
position object CARNO+2,CARX#+SIDEOFF#,CARY#,CARZ#+FRONTOFF#
if CARNO=OBJ then set object effect CARNO+2,4
if CARNO=OBJ2 then set object effect CARNO+2,5
texture object CARNO+2,1,SHADER+1
texture object CARNO+2,2,SHADER+2
set object collision off CARNO+2
if val(left$(OPTIONS$(5),4))>0 then set shadow shading on CARNO+2,-1,50,1
phy make sphere CARNO+2,WHEELWEIGHT#
scale object CARNO+2,SCALE,SCALE,SCALE
phy set angular damping CARNO+2,50
phy set material CARNO+2,0,1
phy set max angular velocity CARNO+2,MAXANG#
phy joint desc set actor a 1,CARNO
phy joint desc set actor b 1,CARNO+2
phy joint desc set global anchor 1,object position x(CARNO+2),object position y(CARNO+2),object position z(CARNO+2)
phy joint desc set global axis 1,1,0,0
phy make joint J,1
J=J+1
// DYNAMIC BACK LEFT WHEEL
load object "Data\3D\"+CARCHOSEN$+"\Back.x",CARNO+3
scale object CARNO+3,SCALE+1,SCALE+1,SCALE+1
xrotate object CARNO+3,180
zrotate object CARNO+3,-90
position object CARNO+3,CARX#-SIDEOFF#,CARY#,CARZ#-BACKOFF#
if CARNO=OBJ then set object effect CARNO+3,4
if CARNO=OBJ2 then set object effect CARNO+3,5
texture object CARNO+3,1,SHADER+1
texture object CARNO+3,2,SHADER+2
set object collision off CARNO+3
if val(left$(OPTIONS$(5),4))>0 then set shadow shading on CARNO+3,-1,50,1
phy make sphere CARNO+3,WHEELWEIGHT#
scale object CARNO+3,SCALE,SCALE,SCALE
phy set angular damping CARNO+3,50
phy set material CARNO+3,0,1
phy set max angular velocity CARNO+3,MAXANG#
phy joint desc set actor a 1,CARNO
phy joint desc set actor b 1,CARNO+3
phy joint desc set global anchor 1,object position x(CARNO+3),object position y(CARNO+3),object position z(CARNO+3)
phy joint desc set global axis 1,1,0,0
phy make joint J,1
J=J+1
// DYNAMIC BACK RIGHT WHEEL
load object "Data\3D\"+CARCHOSEN$+"\Back.x",CARNO+4
scale object CARNO+4,SCALE+1,SCALE+1,SCALE+1
zrotate object CARNO+4,-90
position object CARNO+4,CARX#+SIDEOFF#,CARY#,CARZ#-BACKOFF#
if CARNO=OBJ then set object effect CARNO+4,4
if CARNO=OBJ2 then set object effect CARNO+4,5
texture object CARNO+4,1,SHADER+1
texture object CARNO+4,2,SHADER+2
set object collision off CARNO+4
if val(left$(OPTIONS$(5),4))>0 then set shadow shading on CARNO+4,-1,50,1
phy make sphere CARNO+4,WHEELWEIGHT#
scale object CARNO+4,SCALE,SCALE,SCALE
phy set angular damping CARNO+4,50
phy set material CARNO+4,0,1
phy set max angular velocity CARNO+4,MAXANG#
phy joint desc set actor a 1,CARNO
phy joint desc set actor b 1,CARNO+4
phy joint desc set global anchor 1,object position x(CARNO+4),object position y(CARNO+4),object position z(CARNO+4)
phy joint desc set global axis 1,1,0,0
phy make joint J,1
J=J+1
// DECOY BODY
load object "Data\3D\"+CARCHOSEN$+"\Body.x",CARNO+5
scale object CARNO+5,SCALE,SCALE,SCALE
position object CARNO+5,CARX#,CARY#,CARZ#
if CARNO=OBJ then set object effect CARNO+5,4
if CARNO=OBJ2 then set object effect CARNO+5,5
texture object CARNO+5,1,SHADER+1
texture object CARNO+5,2,SHADER+2
set object collision off CARNO+5
if val(left$(OPTIONS$(5),4))>0 then set shadow shading on CARNO+5,-1,50,1
// TEXTURE CAR
gosub TEXSETCAR
// INCREASE THE CAR NUMBER BY 6 FOR EVERY CAR MADE
CARNO=CARNO+6
return
// SETUP THE EXTRA TEXTURES ON THE CAR
TEXSETCAR:
if MAPTYPE=1
texture object CARNO+1,3,21 : texture object CARNO+1,4,20
texture object CARNO+2,3,21 : texture object CARNO+2,4,20
texture object CARNO+3,3,21 : texture object CARNO+3,4,20
texture object CARNO+4,3,21 : texture object CARNO+4,4,20
texture object CARNO+5,3,21 : texture object CARNO+5,4,20
endif
if MAPTYPE=2
texture object CARNO+1,3,22 : texture object CARNO+1,4,20
texture object CARNO+2,3,22 : texture object CARNO+2,4,20
texture object CARNO+3,3,22 : texture object CARNO+3,4,20
texture object CARNO+4,3,22 : texture object CARNO+4,4,20
texture object CARNO+5,3,22 : texture object CARNO+5,4,20
endif
if MAPTYPE=3
texture object CARNO+1,3,23 : texture object CARNO+1,4,20
texture object CARNO+2,3,23 : texture object CARNO+2,4,20
texture object CARNO+3,3,23 : texture object CARNO+3,4,20
texture object CARNO+4,3,23 : texture object CARNO+4,4,20
texture object CARNO+5,3,23 : texture object CARNO+5,4,20
endif
if MAPTYPE=4
texture object CARNO+1,3,24 : texture object CARNO+1,4,20
texture object CARNO+2,3,24 : texture object CARNO+2,4,20
texture object CARNO+3,3,24 : texture object CARNO+3,4,20
texture object CARNO+4,3,24 : texture object CARNO+4,4,20
texture object CARNO+5,3,24 : texture object CARNO+5,4,20
endif
if MAPTYPE=5
texture object CARNO+1,3,25 : texture object CARNO+1,4,20
texture object CARNO+2,3,25 : texture object CARNO+2,4,20
texture object CARNO+3,3,25 : texture object CARNO+3,4,20
texture object CARNO+4,3,25 : texture object CARNO+4,4,20
texture object CARNO+5,3,25 : texture object CARNO+5,4,20
endif
if MAPTYPE=6
texture object CARNO+1,3,23 : texture object CARNO+1,4,20
texture object CARNO+2,3,23 : texture object CARNO+2,4,20
texture object CARNO+3,3,23 : texture object CARNO+3,4,20
texture object CARNO+4,3,23 : texture object CARNO+4,4,20
texture object CARNO+5,3,23 : texture object CARNO+5,4,20
endif
return
I sure hope you can get something working because the suspension is really starting to become a must-have in the current WOR maps now.
@ Everyone
More pics:
@ Matty H
Oh crap, I just realised, I can't actually use heightfields in WOR because I'm not using strict terrain collision: there will be overhangs. I may as well just keep it as it is and focus all my attention on getting the wheels working. (Suspension is really all WOR's cars need in my opinion now.
)
I can't believe I didn't realise until I'd uploaded that last picture. xD