Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Distance To Line / Relative position within a line (Vector Math)

Author
Message
Proteus
22
Years of Service
User Offline
Joined: 4th Oct 2002
Location: The Future
Posted: 5th Aug 2004 12:04 Edited at: 5th Aug 2004 13:17
(2D DBP code )
So,

This is probably the messiest code I’ve ever wrote (It was ripped out of a project so there’s a lot of junk code), It’s supposed to be an example on how to code 2d instant bullet collisions(with spheres) the “Right” (vectorial) way, so that one can use the same concept in 3d...

Features ( or feature LoL)
+It’s quite fast,This method gives you the first "hit" object (supposed to be a bullet right ... ...) w/o a single sqrt()

Anyway , Compile and see if you like it, if you do then post something and I’ll write a readable/understandable version and replace this entry with it...



Bye

Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 5th Aug 2004 22:10
Good work.

I've also written some code to calculate the closest point to a 3d vector. You'll find that somewhere in the code snippets board.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home

Login to post a reply

Server time is: 2024-11-23 19:19:34
Your offset time is: 2024-11-23 19:19:34