DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetSurfaceOrientation()

vector CGame::GetSurfaceOrientation ( float x,
float z )
inlineprotected

Returns tilt of the ground on the given position in degrees, so you can use this value to rotate any item according to terrain.

См. определение в файле Global/game.c строка 1216

1217 {
1218 vector normal = g_Game.SurfaceGetNormal(x, z);
1219 vector angles = normal.VectorToAngles();
1220 angles[1] = angles[1]+270; // This fixes rotation of item so it stands vertically. Feel free to change, but fix existing use cases.
1221
1222 //Hack because setorientation and similar functions break and flip stuff upside down when using exactly this vector ¯\_(ツ)_/¯ (note: happens when surface is flat)
1223 if (angles == "0 540 0")
1224 angles = "0 0 0";
1225 return angles;
1226 }
DayZGame g_Game
Определения DayZGame.c:3942
Icon x
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.

Перекрестные ссылки g_Game, vector::VectorToAngles() и x.