24.11.2017, 23:51
https://sampforum.blast.hk/showthread.php?tid=586068
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
This finds the slope then rotates a loaded prefab to the slope of the surface the player is standing on.
Код:
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)
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);