Hi all. I have been having difficulty with TraceFilters/Tracelines, I can
never get them to actually HIT props, the tracelines always go through them.

------------------ code ----------------------------

class CTraceFilterVis : public CTraceFilter
{
public:
    CTraceFilterVis(edict_t *pPlayer, edict_t *pHit = NULL ) // store these
as I don't want to hit these entities
    {
        m_pPlayer = pPlayer;
        m_pHit = pHit;
    }

    virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int
contentsMask )
    {
        // just check if the entities I don't want to hit returns false
        if ( pServerEntity == (IHandleEntity*)m_pPlayer->GetIServerEntity()
)
            return false;

        if ( m_pHit && (pServerEntity ==
(IHandleEntity*)m_pHit->GetIServerEntity()) )
            return false;

        // all others should return true ... but PROPS seem to ignore this?
        return true;
    }

    virtual TraceType_t    GetTraceType() const
    {
        return TRACE_EVERYTHING;
    }
private:
    edict_t *m_pPlayer;
    edict_t *m_pHit;
};
-------------------- /code ---------------------
All I want this filter to do is start a traceline from one entity to the
other, while ignoring ONLY those entities so that the trace fraction will be
1.0 if it they visible from each other.

Trouble is , a lot of props get in the way and the tracelines always go
through them, even though it should "return true" if it should hit.

I have also tried TRACE_EVERYTHING_FILTER_PROPS and it just makes it worse I
believe.

Any hints? Or is a traceline the wrong way to go about doing it?

Cheers & thanks in advance!
[rcbot]Cheeseh
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to