<SB> Childe Roland wrote:
I found the following section of code:
=====================================================
void CPropJeep::GetCannonAim( Vector *resultDir )
{
        Vector  muzzleOrigin;
        QAngle  muzzleAngles;
        GetAttachment( LookupAttachment("gun_ref"), muzzleOrigin, muzzleAngles 
);
        AngleVectors( muzzleAngles, resultDir );
}
=====================================================
Does anyone know how the "gun_ref" attachment works?

My guess is that "gun_ref" is an attachment point on the weapon that is attached to the vehicle. I'm guessing GetAttachment() takes the location and rotation of a bone (named "gun_ref") and returns those values in 'muzzleOrigin' (the location) and 'muzzleAngles' (the rotation). It then converts the muzzle angles to a vector 'resultDir' and that gets returned to the caller.

This function basically takes the "gun_ref" bone (the gun that you can
aim while driving the buggy) and returns a vector indicating which way
that gun is currently pointing.

--
Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to