Game Development Community

Clientside position and rotation

by Robert Rourks · in Torque Game Engine · 12/01/2002 (11:43 am) · 1 replies

I can't seem to figure out how to get the position and rotation of the camera in clientside scripts. Any help would be appreciated. Something along the lines of %player.getEyeVector(), except a clientside version.

Thanks in advance,

#1
12/02/2002 (7:56 am)
Ya need a server command "server side" that calls a client command "client side" that gets the clients camera.
commandToServer('getClientCamInfo');

function serverCmdGetClientCamInfo(%client)
{
   commandToClient(%client, "getCamInfo");
}

function clientCmdGetCamInfo(%client)
{
   if(!isObject(%client))
      return;

   %cam = %client.camera;
   %trans = %cam.getTransform();
   
   // Heres the position and rotation.
   %pos = getWords(%trans, 4, 6);
   %rot = getWords(%trans, 0, 3);
}

Im sorry if this is totally screwed I dont have access to the source atm, but I think this is real close if not right on.