sorry, I don't know why it didnt post all... I hope that it will work now :
function matrixAngleX(mat,x#,z#,fluid)
if fluid < 1 then fluid = 1
hauteur1# = get ground height(mat,x#,z#+fluid)
hauteur2# = get ground height(mat,x#,z#-fluid)
diffhauteur# = hauteur2# - hauteur1#
angle# = asin((diffhauteur# / (2*fluid)))
angle# = wrapvalue(angle#)
endfunction angle#
function matrixAngleZ(mat,x#,z#,fluid)
if fluid < 1 then fluid = 1
hauteur1# = get ground height(mat,x#+fluid,z#)
hauteur2# = get ground height(mat,x#-fluid,z#)
diffhauteur# = hauteur2# - hauteur1#
angle# = asin((diffhauteur# / (2*fluid)))
angle# = wrapvalue(angle#)
endfunction angle#
for the two snippets, you have to give 3 informations :
1. the position X
2. the position Z
3. the smooth ( fluid in my snippet because smooth is "fluidité" in french
)
and the snippet gives back theorientation of the area of the matrix at the coordinates X and Z.
what does smooth ? I try to explain well in english, but it won't be well ^^
If you use those function to set a truck to the matrix orientation, if the truck is between two tiles, you have two choices : it's orientation change suddently, or it's orientation change slowly.
if you want that it change slowly, give a high value for smooth, else give a small value.
hmm I tried to explain it better in my first post, but I'm sure that you know how work arcsinus
my snippet isn't hard to understand, but it work well ^^
P.S.: I hope that it will poste all
I'm following John, but I'm not john.
Lol, it is funnier in french