AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   EngFunc_TraceHull and TR_vecPlaneNormal (https://forums.alliedmods.net/showthread.php?t=273179)

vitorrossi 10-14-2015 09:19

EngFunc_TraceHull and TR_vecPlaneNormal
 
I use the following code for when a player is stuck in a wall:

PHP Code:

new Float:fOrigin], Float:fNormalVector], trHull;
    
    
trHull create_tr2( );
    
pevidpev_originfOrigin );
    
    
engfuncEngFunc_TraceHullfOriginfOriginDONT_IGNORE_MONSTERSHULL_HUMANidtrHull );
    
    
get_tr2trHullTR_vecPlaneNormalfNormalVector )
    
    
free_tr2trHull 

returns fNormalVector[0] = 0.0, fNormalVector[1] = 0.0, fNormalVector[2] = 0.0
If doing so with a traceline, you actually get the normal vector corresponding to the plane the traceline hits.

How come this is not the case for tracehull, can it be shown from the HLSDK? Is there a way to retrieve the normal to the plane tracehull hits?

vitorrossi 10-15-2015 12:58

Re: EngFunc_TraceHull and TR_vecPlaneNormal
 
After checking the amxmodx sdk and the hlsdk I think trace hull is done by tracing a bunch of tracelines from the origin outwards, representing the size of the hull. I think without accessing these functions directly (maybe with orpheus or rage) retrieving the normals can't be done.


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

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