Rules FAQ Members List Search Register Login

 Raised This Month: \$203 Target: \$400 50%

Author Message
ImACow
AlliedModders Donor
Join Date: Feb 2015
 05-06-2020 , 18:58   Trace from a position towards a hull. #1 Hi! I was wondering if there is any way of tracing from a point towards a hull. I have a point fStart[3] (player eyes) I have a end point fEnd[3] (other player abs location) I have a hull fMin[3] & fMax[3] for the hull on the player. Visual example: https://i.imgur.com/ROj2DWG.jpg TR_TraceHullFilter seems not capable of this (afaik?) Looking forward towards your feedback! __________________ Last edited by ImACow; 05-06-2020 at 19:00.
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
 05-06-2020 , 21:34   Re: Trace from a position towards a hull. #2 The best way to do this while using the engines trace ray function would be to create a model with a hitbox (same size as the player hull bounds) and spawn it at the players position. You then just race against this objects hitbox. If you want to do this without the model prop then you will have to manually raytrace yourself with just math and a visibility function to the box using a normal raytrace to the bounds of the virtual hitbox you've defined + rotation. I would suggest using a FOV check against the player to see if you are aiming near the player for optimizations first. Then check visibility with a raytrace to this player (minus the distance of the origin to its longest edge length (using players hulls will be 32 units)). If this raytrace hits nothing, then you know the path is clear to this object and a good to then manually trace against. All you have to do then is align the rotations to 90 degree axis and enumerate a length of a vector which you extend + 1 unit in a for loop for a max distance. Then check if this point is within the min\max bounds of the hitbox you've defined
ImACow
AlliedModders Donor
Join Date: Feb 2015
 05-07-2020 , 07:38   Re: Trace from a position towards a hull. #3 Hmm, thanks @backwards, I'm going to try some stuff out. __________________
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
 05-08-2020 , 04:48   Re: Trace from a position towards a hull. #4 What about this: https://gitlab.com/Zipcore/zStocks/-...s/bbox.inc#L98 ? EDIT: Here is an example: https://gitlab.com/Zipcore/Prophunt/...del_hit.sp#L54 __________________ Last edited by zipcore; 05-08-2020 at 04:54.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Server Discussion     Source Servers (SRCDS)     HL1 Servers (HLDS) AMX Mod X     News     Bug Reports     General     Off-Topic     Plugins         Suggestions / Requests         Approved Plugins         New Plugin Submissions         Unapproved/Old Plugins         Translation Request         High-Traffic Plugins             GunGame             UAIO (Ultimate All-In-One Plugin)             xREDIRECT             CSDM             AMX Super             RuneMod             Zombie Plague Mod             SuperHero Mod                 News                 Tech Support                 Scripting Help                 Off-Topic / General Chat                 Heroes                     Suggestions / Requests                     Approved Heroes                     New Submissions                     Unapproved/Old Heroes                         Module Heroes                     SuperHero Mod Stats - By 123                 (OLD) Bug Reports     Scripting         Scripting Help         Code Snippets/Tutorials         Module Coding     Donor Access SourceMod     News     General     Plugins         Plugins         Unapproved Plugins         Plugin/Gameplay Ideas and Requests         High-Traffic Plugins             SourceMod Anti-Cheat             Zombie:Reloaded             SourceBans / SourceBans++             VSH / Freak Fortress             Store             SM_Hosties             HLstatsX:CE     Scripting     Extensions     Snippets and Tutorials     Donor Access     Metamod: Source         Metamod:Source Plugins         Metamod:Source Questions         Coding MM:S Plugins & SM Extensions Hosted Stuff     Asherkin's Plugins         TFDodgeball         TF2Items         SteamTools     Bail's Plugins         CSDM         CS:S DM Off-Topic & Trash     Off-Topic     Trash

All times are GMT -4. The time now is 13:25.

 DMCA - Archive - Top