Page MenuHomeFeedback Tracker

How to get players head direction on server side? [Not a bug - question]
New, UrgentPublic

Description

Hi!
As it described in title - how can I get player's head direction in server side?
Let's say that PlayerBase player contains some player data
I can get vector body = player.GetDirection() and this data contains player body direction - when I'm walking on square path - I see how this vector changes accordingly.
But I can't get players head (look) direction :(
I try player.m_CharactersHead.GetDirection(), head and neck bones player.GetBoneRotationWS but this data is always same and doesn't changes when I'm rotating player's head holding Alt key (PC).
I'm full agree with not getting perfect vector of player's look, but at least I'd like to get vector of players head direction (and this data defenetly should exists on server side at least to be sended to other players so they can see head rotation of others)
What is correct way to get this data on server side?

p.s. and similar - how to get player's aiming vector on server side? :)

thanks :)

Details

Severity
Feature
Resolution
Open
Reproducibility
Unable To Reproduce
Operating System
Windows 7
Operating System Version
any DayZ server OS
Category
General
Steps To Reproduce

question exactly - how to get this data? :)

Event Timeline

Liven added a subscriber: Liven.Jul 2 2022, 7:14 PM

I'm also interested to access this value (even if only client side)

komer added a subscriber: komer.Jul 7 2022, 11:40 PM

check class AITargetCallbacksPlayer

m_Player.GetBonePositionWS(m_iHeadBoneIndex);

and then get rotations using

//! returns local space, model space, world space orientation (quaternion) of a bone 
	proto native	void 		GetBoneRotationLS(int pBoneIndex, out float pQuat[4]);
	proto native 	void 		GetBoneRotationMS(int pBoneIndex, out float pQuat[4]);
	proto native 	void 		GetBoneRotationWS(int pBoneIndex, out float pQuat[4]);

aiming in human.c

//! returns base aiming angle UD - without sway/offsets/...
proto native float GetBaseAimingAngleUD();

//! returns base aiming angle LR - without sway/offsets/...
proto native float GetBaseAimingAngleLR();

@Hunterz thanks! will check it in few dayz and reply :)

Liven added a comment.Tue, Jul 12, 6:38 AM

@Hunterz , sadly the GetBoneRotation only detect horizontal movements not vertical ones (I tried with Head and Neck bones).

And the GetBaseAimingAngle doesn't work when the player is in freelook.

The GetBaseAimingAngleUD will help me a little bit, thanks to you for that but a real "head direction" would really help.