-- [ Picked text/plain from multipart/alternative ] I think you misunderstood what I'm attempting. I'm trying to create a Sphere Trace against the map planes, not entities. I probably should of put that in the subject.
On 9/25/07, Ben Everett <[EMAIL PROTECTED]> wrote: > > CEntitySphereQuery. > > Example: > CBaseEntity *ent = NULL; > > for (CEntitySphereQuery sphere(GetAbsOrigin(), > FORSAKEN_SPAWN_RADIUS); > (ent = sphere.GetCurrentEntity()) != NULL; > sphere.NextEntity()) > { > CBaseEntity *plent = ent; > > if ( plent && plent->IsPlayer() && plent != > pPlayer > ) > return false; > } > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Joel R. > Sent: Tuesday, September 25, 2007 5:40 PM > To: hlcoders > Subject: [hlcoders] Creating a Sphere Trace > > -- > [ Picked text/plain from multipart/alternative ] > I've been attempting to create my own sphere trace using 2 engine > functions. > > void GetBrushesInAABB( const Vector &vMins, const Vector &vMaxs, > CUtlVector<int> *pOutput, int iContentsMask = 0xFFFFFFFF ) > bool GetBrushInfo( int iBrush, CUtlVector<const cplane_t *> *pPlanesOut, > int > *pContentsOut ) > > I had 2 theories to go about doing this using a start/end point and a > radius. > > First theory was to create a box around my start/end positions and grab > all > plane data within the confines of this box. > I'd do something like so: > > float d1 = (plane.dist - radius) - start; > float d2 = (plane.dist - radius) - end; > > and using that to determine for a hit/miss based on the positive and > negative values of the distance. However surrounding a box around my > start/end would give me extra planes that'll give me a bunch of false > positives on planes that are very tiny, since this algorithm is used for > infinite sized planes.. > > Second theory was to slide the box in intervals and check for planes at > each > interval with a mins/max box the size of my radius. Then back checking the > distance to see if I hit or penetrated any planes within. > > Both of these methods seem to not work after thinking about different > possibilities that could arise due to the infinite sized plane algorithm. > I > then noticed there was extra values in the cplane_t structure that I'm not > very familiar with: cplane_t::signbit and cplane_t::type. What purpose > do > these serve for the plane? Do they help determine if I'm within the > planes > constrictions for a collision? > > Anyone out there familiar with collision detection could help me out? I'd > really like to have a sphere trace. > -- > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > __________ NOD32 2550 (20070925) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > -- _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders