Getting mouse position for object selection
by Tiago Correia · in Torque Game Engine · 06/19/2007 (7:23 am) · 0 replies
Hi,
i have implemented the advanced camera + object selection from 2 tutorials available here in this website..
my question is: the object selection im using is ready for picking objects on first person mode by doing this:
%player = %client.player;
%eye = %player.getEyeVector();
%vec = vectorScale( %eye, %selectRange );
// startPoint = the player's eye position
// endPoint = startPoint + length of selectable range
%startPoint = %player.getEyeTransform();
%endPoint = VectorAdd( %startPoint, %vec );
%exempt = 0;
if ($selectedObj) %exempt = $selectedObj;
%object = ContainerRayCast( %startPoint, %endPoint, %searchMasks, %player, %exempt );
i am able to get the camera postion from the advanced camera, but i now need to know the mouse position to be able to raycast the world and find colliding objects..
im sould be using godview or track camera mode
anyone ?
i have implemented the advanced camera + object selection from 2 tutorials available here in this website..
my question is: the object selection im using is ready for picking objects on first person mode by doing this:
%player = %client.player;
%eye = %player.getEyeVector();
%vec = vectorScale( %eye, %selectRange );
// startPoint = the player's eye position
// endPoint = startPoint + length of selectable range
%startPoint = %player.getEyeTransform();
%endPoint = VectorAdd( %startPoint, %vec );
%exempt = 0;
if ($selectedObj) %exempt = $selectedObj;
%object = ContainerRayCast( %startPoint, %endPoint, %searchMasks, %player, %exempt );
i am able to get the camera postion from the advanced camera, but i now need to know the mouse position to be able to raycast the world and find colliding objects..
im sould be using godview or track camera mode
anyone ?