23.05.2012, 10:14
Hi, i'm using the new camera interpolation funcs added in 0.3e.
The problem is this; I have a camera angle high above the playing field, i want to interpolate the camera from that position and angle - to behind the player and facing in the direction the player is facing. So the cam zooms to behind the player. (same angle player is facing)
This is the func i would normally use to get an xyz co-ordinate in front/behind the player.
But that obviously wont work if the players camera is facing another direction. Is there another function available to me that doesn't rely on camera vector/pos? Eg, just uses players xyz and angle??
Doesn't matter if its not the most efficient func as long as it works.
Any help would be very much appreciated.
The problem is this; I have a camera angle high above the playing field, i want to interpolate the camera from that position and angle - to behind the player and facing in the direction the player is facing. So the cam zooms to behind the player. (same angle player is facing)
This is the func i would normally use to get an xyz co-ordinate in front/behind the player.
pawn Код:
stock TE::GetXYZInFrontOfPlayer(playerid, Float:range, &Float:x, &Float:y, &Float:z)
{
new
Float:fPX, Float:fPY, Float:fPZ,
Float:fVX, Float:fVY, Float:fVZ;
GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
x = fPX + floatmul(fVX, range);
y = fPY + floatmul(fVY, range);
z = fPZ + floatmul(fVZ, range);
}
Doesn't matter if its not the most efficient func as long as it works.
Any help would be very much appreciated.