Get origin of player's hitboxes
How to get origin of each hitbox of a player?
I can get the origin of player's vector using entity_get_vector(ent, EV_VEC_origin, entOrigin) function. Is there any way to get the origin of player's legs/hands for example? Any suggestions are wellcome. Thks in advance. |
Re: Get origin of player's hitboxes
You can use EngFunc_GetBonePosition ( see fakemeta_cons.inc ) and to know the bone number just do "Dump Model Info" with Half-Life Model Viewer.
|
Re: Get origin of player's hitboxes
Thank you, will try and revert.
|
Re: Get origin of player's hitboxes
Tyvm, i works well, but is there any other way to do it? This func is a bit CPU consuming...
|
Re: Get origin of player's hitboxes
How is a bit CPU consuming ? It should be retrieve information already loaded into memory.
|
Re: Get origin of player's hitboxes
Well maybe it's other func using my CPU...
How to write trace_line(-1, userOrigin, entOrigin, hitOrigin) function using FakeMeta instead of Engine? and will it give me any advantage? |
Re: Get origin of player's hitboxes
Here the code source for TraceLine ( engine ) :
Code:
Quote:
In fakemeta it would be : engfunc( EngFunc_TraceLine, vStart, vEnd, IGNORE_MONSTERS, 0, tr); But it doesn't return TR_pHit nor TR_vecEndPos, you have to do using get_tr2(). If you use an index for IgnoreEnt, in fakemeta it would be : engfunc( EngFunc_TraceLine, vStart, vEnd, DONT_IGNORE_MONSTERS, iEnt, tr); Depending what you need, you have to use engine or fakemeta. For example if you want to use IGNORE_MONSTERS with a valid IgnoreEnt, you can't. If you don't need the end pos and hit, use fakemeta. If you want to use IGNORE_GLASS you can't etc. The engine version is more specific. The fakemeta version you have an access to all the params of TRACE_LINE() function. ( engine use TRACE_LINE() too ). EngFunc_TraceLine is a direct link to the HL1 engine function TRACE_LINE(), there are no addition like in the engine function. That's why you can do more things with EngFunc_TraceLine. If you reproduce the engine function to fakemeta, it will be more efficient to use engine. Not sure if I explain well. :p |
Re: Get origin of player's hitboxes
Wow, thks for such detailed explanation! But how do you think which way will take less CPU engine (trace_line) or fakemata(engfunc+get_tr2)?
|
Re: Get origin of player's hitboxes
The less natives calls you have ( amxx plugin -> module ) = the less cpu consuming it will be.
eg: You want to retrieve the hit and the hit origin. Using engine : Code:
Using fakemeta : Code:
Engine, you need one call, Fakemeta 3. It's possible to see the difference using the profiler by sawce. But here the difference would not be really significant. |
Re: Get origin of player's hitboxes
Just profiled :
Code:
type | name | calls | time / min / max |
| All times are GMT -4. The time now is 15:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.