Any way to get the slope of the terrain?
#1

Hello guys, Is there any way to get the slope of the terrain?




@Sorry for my bad English!
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=586068
Код:
CA_RayCastLineAngle(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz)
It only really works for terrain well, I am not sure how to get the correct rotation to translate an objects position correctly so it stands on the face of a surface correctly.

The mangle module in Texture Studio uses this function.

https://github.com/Pottus/Texture-St...dio/mangle.pwn
Код:
			CA_RayCastLineAngle(x, y, 1200.0, x, y, -100.0, z, z, z, GroupSlopeRX[playerid], GroupSlopeRY[playerid], z);
   			GroupRotate(playerid, GroupSlopeRX[playerid], GroupSlopeRY[playerid], 0.0);
This finds the slope then rotates a loaded prefab to the slope of the surface the player is standing on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)