There are three issues here:
1) Collision representation for the bullet
        In HL2, they are point sized.  You can also make them out of
boxes or fully general vcollides.
2) Velocity of the bullet
        In HL2 the velocity is infinite - they travel instantaneously
until they hit something (simulated with a single traceline).  If you
want to simulate gravity you'll need some notion of finite speed for the
bullet.
3) How to approximate the parabolic motion of the bullet in flight
        In HL2 there is no parabolic motion, so it's not a problem.  But
you really have two options here: Use vphysics, or use multiple
tracelines/boxes with subdivision.  What I propsed earlier was just
using one traceline per tick which means that the bullet's curve is
approximately a line each tick.  Since a tick is no larger than 30msec,
a bullet will only fall sv_gravity * 0.03 (18 inches for HL2) in a
single tick while it will move forward somewhere near 1000 inches
(obviously depending on velocity) in the same tick.  So there's not tons
of error there, but if you need more precision just subdivide dt and
iterate.  If you use vphysics it will do it's own approximation for the
motion which you cannot configure.

Jay



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Hasan Aljudy
> Sent: Wednesday, February 02, 2005 5:03 PM
> To: [email protected]
> Subject: Re: [hlcoders] Weapon ballastics
>
> but bullets in HL2 and HL1 already are tracelines .. like
> everyone have been saying, they are instantaneous, and if you
> think that's bad, then this is why people want to make it
> more bullet-like.
>
> r00t:
> "Husan, I was thinking about doing this actually.
> Not sure of the performace hit doing a traceline everyframe
> on a bullet but something to test out"
>
> well, bullets are already tracelines, and I think the engine
> does tons of traces every frame (I would guess every moving
> object uses traceboxes for collision detection) etc.
>
> On Wed, 02 Feb 2005 18:27:14 -0600, Adam Mason
> <[EMAIL PROTECTED]> wrote:
> > > Iwas thinking .. why don't you just pre-calculate the
> spot where the
> > > bullet will land if it were to fall acording to gravity ..
> > > do a traceline and see how far your target is, then
> figure out how
> > > much it would fall ... etc, you get the idea.
> >
> > BUT... if the bullet is traveling slow and far enough you'd have to
> > lead a moving target, then your traceline will not actually
> be to the target.
> >
> > Adam "Tobias" Mason
> > Back East Design
> >
> > _______________________________________________
> > 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
>
>

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

Reply via email to