Rabishan
Member
|
Player Position
Hi guys,
i'm trying to figure out the position of the player with respect to the ground. in esenthel i've seen player.pos function. if i'm not mistaken this does not give the actual ground position but position slightly above the ground position. what i need is the position and direction of the plane where the player is standing.
thanks in advance.
|
|
06-07-2011 07:42 AM |
|
Driklyn
Member
|
RE: Player Position
1) Cast a ray that points downward from the player's position. Then, get the pos/normal via physHit.plane.pos and physHit.plane.normal.
2) Assuming you're always on a heightmap terrain, you can use this (position only):
Code:
Game::World.hmHeight(Players[0].pos().xz());
3) Or, to just get the position roughly near the player's feet, you can use this (position only):
Code:
Players[0].ctrl.actor.box().down();
|
|
06-07-2011 08:10 AM |
|
Rabishan
Member
|
RE: Player Position
thanks for the reply. seems like ray casting would be my options because i need plane direction more than plane position.
|
|
06-07-2011 08:13 AM |
|