AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client's head origin (https://forums.alliedmods.net/showthread.php?t=77113)

allenwr 09-05-2008 18:59

client's head origin
 
does anyone know the z-axis offset for a standard player model's head?

Exolent[jNr] 09-05-2008 19:28

Re: client's head origin
 
My guess:
Code:
new Float:head[3]; new Float:origin[3], Float:maxs[3]; pev(client, pev_origin, origin); pev(client, pev_maxs, maxs); head[0] = origin[0]; head[1] = origin[1]; head[2] = origin[2] + maxs[2] - 16.0; // head is the origin of the head

However, this is only an estimate, and not an exact answer.

minimiller 09-05-2008 19:34

Re: client's head origin
 
theres a file on XJ somewhere which tells u the units of a player model
I dont have it on this computer but ill search for it 2moro if u still need it
Sleepy time for me now :)

Emp` 09-05-2008 19:39

Re: client's head origin
 
Code:

engfunc(EngFunc_GetBonePosition, target, bone, origin, angles)
Bone 8 Name: "Bip01 Head"

So I would assume:
Code:

new Float:HeadOrigin[3], Float:HeadAngles[3];
engfunc(EngFunc_GetBonePosition, id, 8, HeadOrigin, HeadAngles);

if you really need the z-axis offset only, then just:
Code:

new Float:origin[3];
pev( id, pev_origin, origin );
new Float:offset = floatabs( HeadOrigin[2] - origin[2]);


allenwr 09-05-2008 20:37

Re: client's head origin
 
Looks like I am finally going to learn fakemeta.

Thank you Emp`, in return old song http://gprime.net/flash.php/youareapirate

Prajch 09-05-2008 20:53

Re: client's head origin
 
If you just wanna know how high the model extends above the origin, it's 32 units. If you want their view origin...

PHP Code:

 new Float:userOrigin[3], Float:originOffset[3]
 
 
pev(idpev_originuserOrigin)
 
pev(idpev_view_ofsoriginOffset)
 
 new 
Float:viewOrigin[3]
 
viewOrigin[0] = userOrigin[0] + originOffset[0]
 
viewOrigin[1] = userOrigin[1] + originOffset[1]
 
viewOrigin[2] = userOrigin[2] + originOffset[2


allenwr 09-07-2008 01:55

Re: client's head origin
 
Quote:

Originally Posted by Emp` (Post 681774)
Code:

engfunc(EngFunc_GetBonePosition, target, bone, origin, angles)
Bone 8 Name: "Bip01 Head"

So I would assume:
Code:

new Float:HeadOrigin[3], Float:HeadAngles[3];
engfunc(EngFunc_GetBonePosition, id, 8, HeadOrigin, HeadAngles);

if you really need the z-axis offset only, then just:
Code:

new Float:origin[3];
pev( id, pev_origin, origin );
new Float:offset = floatabs( HeadOrigin[2] - origin[2]);


Where can I find this information on the functions, i tried the online func area and the .inc files and haven't found it.

Alka 09-07-2008 03:59

Re: client's head origin
 
Those info about bone? You can find them by opening a model in HLMV(Half-Life Model Viewer) the go to Options -> Dump Model Info.

allenwr 09-07-2008 16:12

Re: client's head origin
 
Not just bone info, but also the format on the function, i tried funcwiki and the inc files.

The funcwiki for fakemeta isn't like any other module so I am having a hard time learning.

what version of hlmv do you have? the one i have does not have the model info.

Alka 09-08-2008 01:51

Re: client's head origin
 
Jed's v1.35.
What function...? EngFunc_GetBonePosition ? -> http://www.amxmodx.org/funcwiki.php?go=module&id=16 .There you have all funcs with params.


All times are GMT -4. The time now is 03:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.