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.

DarkBASIC Professional Discussion / Bounce angle of a ball off a mesh

Author
Message
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 12th Jul 2010 20:55
In C++/DX there is a collision command that can give the face that was collided against. This can be used to calculate the reflection vector of the colliding object. I there a simple way to do that in DBP?

The fastest code is the code never written.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 12th Jul 2010 21:10
With Sparky's collision DLL, you can check the normal vector of a collided polygon but also the bounce vector, very handy stuff. You should have a look at that.


Health, Ammo, and bacon and eggs!
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 12th Jul 2010 21:11 Edited at: 12th Jul 2010 21:12
I'm pretty sure Sparky's Collision DLL does this

It's free and available from >here<

>edit<
Ninja'd by Van B

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 12th Jul 2010 21:13
Thanks. I was really wanting to do as much of the engine myself, but if there's no practical way to do it with pure DBP, then I'll try Sparky's.

The fastest code is the code never written.
maicl
19
Years of Service
User Offline
Joined: 19th Jun 2007
Location:
Posted: 13th Jul 2010 08:50 Edited at: 13th Jul 2010 08:54
Here's an example that uses bouncing collision with Sparky's dll :

http://forum.thegamecreators.com/?m=forum_view&t=89539&b=1

In the ninth post

Login to post a reply

Server time is: 2026-07-25 03:25:44
Your offset time is: 2026-07-25 03:25:44