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.

Newcomers DBPro Corner / Collision with very large objects.

Author
Message
ReElectro
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 3rd Jan 2011 22:29
Hello. Is there a way to detect whatever a small object collides with a real large object that's not made out of matrix?

For an example, a ball collides with table that's loaded from a single object file. Or in a bowl.

I've looked at other methods like Sparky's Collision.

Would a physics engine like DarkPhsyics or Newton do the job of detecting whatever a small object collides with a much larger level not made out of a matrix in order to do a condition like make the ball disappear when it comes on contact?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Jan 2011 22:58
Sparky's is the best thing for collision detection in my opinion. It will do exactly what you are looking for here.

ReElectro
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 6th Jan 2011 20:21
I managed to get the Sparky collision examples to work.

The problem is, I am trying to figure out on how to make a sphere or a cube collide with a complex object I made in a 3d modeling program that was exported to a .X format.

I looked at the code example where a sphere collided with a green level, I thought it was easy to do when I copied the command line into my own example program to see if it would work. I tried it and strangely it does not work.

I'm probably missing something..
Should I attach the code and file to explain the problem?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Jan 2011 09:47
Yes, attach the code it can only help

ReElectro
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 7th Jan 2011 20:36
Here's a zip file.

The program's objective is to have the variable return something when a sphere collides with this complex object I made with a 3d modeling program but it's not working.

Something is either not right or I messed up but the sphere does move back and forth.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 9th Jan 2011 21:46 Edited at: 9th Jan 2011 21:47
Whenever you reposition an object you need to update it. This edited code gives collision against your object. I didn't get why you are using raycast also.



Hope this helps,

LB

ReElectro
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 10th Jan 2011 08:10
Yep. I sort of figured it out already using a different method.

One more question, will this Sparky Collision DLL work with DBO files apart from .x files?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jan 2011 10:03
Quote: "One more question, will this Sparky Collision DLL work with DBO files apart from .x files?"

Yes. When you load an "object" into your game it effectively converts into the same format.

Login to post a reply

Server time is: 2024-11-23 03:35:40
Your offset time is: 2024-11-23 03:35:40