--
[ Picked text/plain from multipart/alternative ]
Well I have tried that.

Having for example :

Vector    startPos= pOwner->Weapon_ShootPosition();
Vector    aimDir    = pOwner->GetAutoaimVector( AUTOAIM_5DEGREES );
Vector    endPos    = startPos + ( aimDir * MAX_TRACE_LENGTH );

 trace_t    tr;
UTIL_TraceLine( startPos, endPos, MASK_SHOT, pOwner, COLLISION_GROUP_NONE,
&tr );

That gets it from the gun to the first wall.
So then I have

if ( tr.DidHitWorld() && !(tr.surface.flags & SURF_SKY) ) //don't go through
sky
{
        //Try  penetrwallation
        UTIL_ImpactTrace( &tr, GetAmmoDef()->DamageType(m_iPrimaryAmmoType),
"ImpactGauss" );
        UTIL_DecalTrace( &tr, "RedGlowFade" );

        CPVSFilter filter( tr.endpos );
        te->GaussExplosion( filter, 0.0f, tr.endpos, tr.plane.normal, 0 );

        Vector    testPos = tr.endpos + ( aimDir * 48.0f );

        UTIL_TraceLine( testPos, tr.endpos, MASK_SHOT, pOwner,
COLLISION_GROUP_NONE, &tr );

        if ( !tr.allsolid )
        {
            UTIL_ImpactTrace( &tr,
GetAmmoDef()->DamageType(m_iPrimaryAmmoType), "ImpactGauss" );
            UTIL_DecalTrace( &tr, "RedGlowFade" );

            penetrated = true;
        }

Then farther down in the same function:

        trace_t beam_tr;
        Vector vecDest = startPos + aimDir * MAX_TRACE_LENGTH;
        UTIL_TraceLine( tr.endpos, vecDest, MASK_SHOT, pOwner,
COLLISION_GROUP_NONE, &beam_tr);

That seems to get it to go through the second wall.
But then if I want it to go from there to the next wall i would have
        UTIL_TraceLine( beam_tr.endpos, vecDest, MASK_SHOT, pOwner,
COLLISION_GROUP_NONE, &beam_tr);

But that does not seem to work, so I was thinking, maybe the destination
needs to be updated so I did
       vecDest = beam_tr.endpos + aimDir * MAX_TRACE_LENGTH;
        UTIL_TraceLine( beam_tr.endpos, vecDest, MASK_SHOT, pOwner,
COLLISION_GROUP_NONE, &beam_tr);

And still that did not work.
I am currently taking a look at the simulate bullet code, and thanks for
your help :D

On 6/21/06, Aaron Schiff <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> You make a trace then start where you last ended...if you come up with a
> fraction of 0 (sometimes happens with collision models) you have to
> advance
> 1 unit along the normal and retrace for the same wall...unless you want to
> ignore physics props.  See also:
> http://developer.valvesoftware.com/wiki/Simulated_Bullets the
> SimulateBullet() function
>
>
> --
> ts2do
> --
>
> _______________________________________________
> 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

Reply via email to