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.

Dark GDK / ODE 1.0 problem

Author
Message
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 28th Feb 2007 02:07
oOde.ODE_CreateStaticBox(townObj)
oOde.ODE_SetContactFDir1(townObj, 210)

This I presume is working since it gives no errors, but I am using it on my buildings and other static objects.

Since the example does not use meshes that are from any of the known loadable formats, but instead uses simple created objects, I am not sure if this is the right way to do this.

The ball however, falls right through my ground.
The ground is one of the townObj id's of objects.

Can someone please point out what I am obviously doing wrong? Each of the objects that loads in are X mesh objects. How do I get a mesh to mesh collision to work in ODE?
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 28th Feb 2007 03:18
check your erp and cfm settings, examples provided are not really set correctly for rigidity.

try world erp 0.2f and cfm 0.0f and see if that helps.

London 7/7/05 = 1 in 10^38 Alex Jones: Terror Storm
Ron Paul '08
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 28th Feb 2007 04:02
Got me closer, now how do I make the collision more accurate? It took the overall width and height of my object and made is "solid", where as the object has angles and such, which call should I make instead of the static cube?
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Feb 2007 10:10
Zum, ODE supports a function called ODE_CreateStaticTriangleMesh which is used for complex poly collision, but I'm not sure how well this will work with your model. Both CattleRustler and myself have struggled with this function, but it's worth a try.

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 28th Feb 2007 14:31
I was afraid you were going to say that.
This is the error I get when it is ran against my guild hall:
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="ODEPhysics.NET"
StackTrace:
at ODEPhysicsNET.CODEPlugin.ODE_CreateStaticTriangleMesh(Int32 iObject)

So suffice to say, the ode plugin is only good for simple objects, not complex?

I know ODE supports higher end objects, I can even pre-compute the pol/ply files (poly conversion). So now I have another conundrum.

How am I going to be able to create a proper collision object for my game? (or objects in this instance), I totally get what it is doing when I do the createstaticbox, its like when you open gamespace and select the object, until you go into edit mode, you see a box around the entire thing, this is what createstaticbox does, but the createstatictrianglemesh isn't working for complex objects.

Any suggestions?
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Feb 2007 14:46
Wait a sec... does that error occur when you try to apply that function against your model? Send me the model file and I'll try to see why it's breaking in the plugin.

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 28th Feb 2007 19:43
Sending it to you via email now.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 28th Feb 2007 19:45
Here is some code for a simple ODE project in DB Pro. Try using the same settings in your own program as a test:

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 28th Feb 2007 19:50 Edited at: 28th Feb 2007 19:52
I really don't think I am clear here, I don't care about using "make object", I want to LOADOBJECT("FILENAME",ID)
I also don't care about a 4 sided cube, I care about a complex object like a building, a terrain, a tree, a sign post, things that matter.

BASIC object like a cube and a cheesy ball work if you create them like the demo has using MAKE OBJECT. This is all useless for a game.

Now, if I was making a box game with a ball, sure, no problem. However, my town has 15 buildings in it, a city foundation, steps, complicated objects, THATS what crashes the ODE.

Not boxes and balls.

I submitted a purchase order request ticket early this morning for the DGDK c++ version, waiting on a response from it so that I can try to move forward with trying all this in C++ for DGDK if at all possible, haven't heard back yet though, I know the queue is long.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 28th Feb 2007 20:39
Have you tried having your level as a static mesh and your other objects as dynamic boxes or spheres?
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 28th Feb 2007 21:35 Edited at: 28th Feb 2007 21:36
All objects right now were set as static, the only dynamic object i have right now is a manually generated sphere to test gravity. Each object in the level as it is loaded in, is odeset as static (or attempted with statictrianglemesh), which blows up. Its a problem with number of poly's. (or assumed to be).

Only dynamic objects ever needed are those that move, like a grouping of spheres attached to a player body or a box that represents the character itself.

Take my castle wall, included with it is the town square foundation, so if tranglemesh worked, then collision on that static object should occur on the walls and foundation, thats the problem right now, until I can get the trianglemesh thing to work, or get accurate collisioning to work, I am stuck.

Only moveable objects will be dynamic, some object won't have collision as dynamic like chests, they would be static even though they open, the overall collision can be of a cube on those.

The disconnect here is that the objects, like the buildings, are not square, there oddly shaped, if I use a box, I loose tons of space. Dynamic or static loaded in gets the same results.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Feb 2007 22:27
Ok, I'm able to replicate the error Zum, so I'll investigate the plugin.

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 1st Mar 2007 14:33
Any luck yet Paul?
Zum
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Mar 2007 17:58
Zum, this ode converted plugin is basically useless for anything other than boxes and balls, it only does whole object bounded collision detection, which may be fine for some stuff, if you want to make entire levels as separate objects. It won't do polygonal collsion or anything complex. While its physics is ok I wouldnt use this as a solution. But again thats mho.

London 7/7/05 = 1 in 10^38 Alex Jones: Terror Storm
Ron Paul '08
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 1st Mar 2007 21:35
Zum, not sure if you've seen this thread, but I'll try to obtain the changes to the plugin that he made, and see if this helps in working with your model. Also, since ODE can work with CSG based or closed shape model files for collision, have you thought about using an invisible model file that represents the bounding areas for the different parts of your model? i.e. a much simpler CGS facsimile of your model for the actual physics tests, and you use your normal model for the visual pipeline.

Anyway, here's the thread I was referring to:

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

Paul.

Login to post a reply

Server time is: 2024-06-29 04:18:02
Your offset time is: 2024-06-29 04:18:02