The OgreOde Thread

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Locked
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Tue Nov 30, 2004 4:34 am

Goosey,

There are probably a lot of things you can do to speed things up, but it depends on how much time you have.

Is your city one big mesh file? Try breaking it up into multiple trimeshes. Can you represent your city for collision purposes as boxes instead of a trimesh? Do you know you'll be colliding with only objects within a certain zone? I think you can disable or remove bodies and geom from the physics simulation which will speed up the calculations.

Good luck,

Clay
0 x

User avatar
Goosey
Halfling
Posts: 88
Joined: Wed Sep 29, 2004 3:33 am
Location: Ohio, USA
Contact:

Post by Goosey » Tue Nov 30, 2004 5:12 am

Falagard wrote:There are probably a lot of things you can do to speed things up, but it depends on how much time you have.
About 1 week :) So not a lot.
Is your city one big mesh file? Try breaking it up into multiple trimeshes.
Multiple meshes, but all in one node that gets passed to the createstatictrimesh.. so all 1 big trimesh (right?)
Can you represent your city for collision purposes as boxes instead of a trimesh? Do you know you'll be colliding with only objects within a certain zone? I think you can disable or remove bodies and geom from the physics simulation which will speed up the calculations.
MMmmm good ideas. I think i will give a shot at breaking it into multiple nodes/multiple trimeshes. Then try to disable geoms that are not near the player (since it is the only thing i need to worry about colliding with).

One question: When you create a static trimesh, does it create both a body and geom, or just a geom?

(still wondering about why the polycount is getitng doubled too :|)
0 x
I <3 the OGRE Wiki, and SO SHOULD YOU! :)

Sanchez108
Gnoblar
Posts: 10
Joined: Thu Dec 02, 2004 9:03 pm
Location: West Chester, PA
Contact:

General Collision question

Post by Sanchez108 » Sat Dec 04, 2004 3:57 pm

Hi. I'm going to use OgreOde in a group project and I'm digging around in the code trying to get a feel for it before I begin the implementation, and I have a question. All references to code are from Monsters demo suite, Demo_SimpleScenes.

The collision function in the SimpleScenes class takes a contact point, but I can't find where this contact structure gets set, or even where SimpleScenes::collision is called. I assume that this is handled behind the scenes by virtue of the fact that SimpleScenes is registered with the world as a CollisionListener, but if that is the case, just what does that take care of?

If there's someplace I can go to read about this rather than have someone write an explanation, that'd be just as good. I've searched through the forums and haven't found anything about it so far.

Thanks for your help.

Alex Silverman
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Mon Dec 06, 2004 1:07 am

Your CollisionListener takes the place of ODE's dNearCallback, so when you call "collide" on your world or on geometries or spaces the listener you have set will get called for every collision that happens. Just like with raw ODE. The supplied "steppers" that the demos use will take care of stepping the world and calling collide on the top level space, which will then cascade down the space hierarchy colliding everything in your world in pretty much the same way as the example code given in section 10.5 of the ODE manual. But you might not need to use the default steppers, in fact the idea would be that you would create your own specific to your application, the supplied ones are just examples.

Registering something as a collision listener is just the same as supplying a dNearCallback to one of ODE's collide functions, it just means that it allows you to be informed of any collisions that take place so you can set the properties of the collision (friction, etc) or ignore it entirely.

Like with the ODE callback, some of the information sent via the collision method is set for you (so you can decide what to do with the collision, e.g. ignore it) and some it expects you to set. Basically, if it's a "get" method (of Contact, e.g. getPosition) then it's something that's set for you before collision is called which you can look at to see whats involved in the collision and if it's a "set" method then it's some property of the collision which you might want to set, e.g. setCoulombFriction. This is explained in more detail in section 7.3.7 of the ODE manual, although the methods for setting the properties of the contact are slightly changed to (I hope!) make them easier to understand.

OgreOde will then automatically create the contact joints for you based on the properties you set in the Contact object.

Hope that makes sense!
0 x

Sanchez108
Gnoblar
Posts: 10
Joined: Thu Dec 02, 2004 9:03 pm
Location: West Chester, PA
Contact:

Post by Sanchez108 » Tue Dec 07, 2004 4:48 pm

Ok. I believe I understand it now. I'll work at it and if anything else comes up, be sure I'll be back :)

Thanks Monster.
0 x

apanjocko
Gnoblar
Posts: 3
Joined: Thu Nov 18, 2004 3:31 pm

Post by apanjocko » Wed Dec 08, 2004 10:15 pm

thanks monster for the effort, it's really nice and the code is easy to read and understand. i really hope you continue this and include things you have discussed such as .physics files etc. excellent work.
0 x

User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie » Fri Dec 10, 2004 8:28 am

I wanted to ask if there's a version around, with a more implemented Vehicle file. Don't get me wrong, there's nothing bad about the file, but there are many methods not yet implemented (the whole gear stuff and so on). I'm just asking if someone made a racing game and already implemnted them. The reason why I'm asking is, that I want to TRY to programm a small car game.
Perhaps I missed something, but I haven't seen a possibility how to increase the speed of the vehicle or reversing (I hope this is the correct word, sorry about my bad english; I mean driving backwards). If there's already a simple solution for this and I missed it, please tell me and ignore the post :lol:

Thanks to monster for making ogreode, it's simply great. I've never done anyything with a phyic engine and I managed to to let a ball bounce arount....
and a car drive :) at least a little
0 x

User avatar
Bren
Goblin
Posts: 215
Joined: Tue Jul 08, 2003 4:41 pm
Location: 0,0,0
Contact:

Post by Bren » Fri Dec 10, 2004 11:04 pm

Where can I get the current version of OgreOde? I looked at the first message in this thread, and it tells me where to get the Preview version. Obviously very old.

That "first message to link" idea is great, but needs to be updated.

I'm getting the String::BLANK building with Ogre 15.1 for the first time. I'm hoping current OgreOde solves that. I still have an old OgreOde_Setup.exe that I got from somewhere, but can't remember where. Is there a permanent home for the current one? The readme says nothing really. It would be great if it said where to get the current version.

I could go to CVS but I much prefer working with Stable code.

BTW The search function sucks. Searching for anything related to OgreODE always coughs up this thread, and that's it, and it's now like 17 pages or something. Not really helpful.

EDIT: I grabbed it from the ogreaddons snapshot, which makes me kinda nervous, but what the hey.
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Sat Dec 11, 2004 7:57 am

I wanted to ask if there's a version around, with a more implemented Vehicle file.
Nope, sorry. As you've said there's lots of methods there that need to be filled in to complete the Vehicle simulation module. What's there is just what I thought might be a reasonable interface for the module, but I've not had a chance to "fill in the blanks" myself. There are some hooks missing though, like a way to simulate a decent tyre model, or an analogue clutch, etc, etc.

I'm sure if someone would like to fill in these missing pieces then everyone else would be very grateful! The Motorsport guys (http://motorsport-sim.org/) seem to be coming up with some very nice stuff, you might look to there for inspriation, and also at Racer (http://www.racer.nl/).
Where can I get the current version of OgreOde?
I think what's in CVS pretty much is the latest stable version (in so far as it can be considered stable) which is basically the Preview version with a few bug fixes. I only update CVS very occasionally, and hopefully only from a relatively stable version from my hard drive.

Bear in mind though that "stable" is a relative term, this is effectively pre-production code which I don't work on as often as I should/could and is therefore nowhere near as stable as (for example) the core Ogre code.

Caveat emptor!
0 x

shul
Gnoblar
Posts: 24
Joined: Sat Sep 11, 2004 9:49 am

Post by shul » Fri Dec 17, 2004 9:58 am

Hi monster, what's up?

You say the stable version is in CVS... ehmm.. what CVS? I synched with "ogrenew" CVS and there is no OgreODE anywhere..

(this is probably written somewhere within the 17 pages long thread)

How can I get OgreODE through CVS?

Thanks,
Shul
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Fri Dec 17, 2004 10:13 am

It's there. You want the ogreaddons bit, not the ogrenew bit. Or just get the addons nightly snapshot.

Oh, and "stable" is a relative term!
;)
0 x

shul
Gnoblar
Posts: 24
Joined: Sat Sep 11, 2004 9:49 am

Post by shul » Sat Dec 18, 2004 9:31 am

OK, got it... thnx

Is there a linux build somewhere? I can't find it...
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Sat Dec 18, 2004 9:55 am

Cool. No there's not a Linux build in CVS, someone did send me some makefiles but I've not had a chance to look at them yet. Basically you just need to compile everything and link to ODE, there shouldn't be any fancy setup needed I think.
0 x

shul
Gnoblar
Posts: 24
Joined: Sat Sep 11, 2004 9:49 am

Post by shul » Sat Dec 25, 2004 9:49 pm

Hiall

Did anyone got the samlpes for ogreode CVS working under linux ?

thnx
0 x

User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie » Mon Jan 03, 2005 7:35 pm

I have a question/problem concerning the landscapes demo. When running it the car drives "through" the green hill.

I thought, maybe a problem with the landscape.cfg. So I reaplaced it with the terrain.cfg from the ogre examples (use in the terrain demo). Same problem. The car doesn't only drive through the hills it also seems to fly at the lower parts, I mean drive on an invisible plane.

I think that's not what's intended by the demo. Has anyone an idea what could be the problem or how I can fix this?
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Mon Jan 03, 2005 8:09 pm

Is this the third or fourth time this question was asked? Can't count it anymore. ;)
Yes, this thread is quite long and hard to read. You have to use Monsters patched version of ODE. The patch is somewhere below ogreaddons/ogreode.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
temas
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 390
Joined: Sun Oct 06, 2002 11:19 pm
Location: The Woodlands, TX
Contact:

Post by temas » Mon Jan 03, 2005 9:11 pm

Maybe it's about time to lock this thread?
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Tue Jan 04, 2005 12:46 am

Maybe it's about time to lock this thread?
Fine by me!
Is this the third or fourth time this question was asked? Can't count it anymore.
I think it's about the 4 millionth time. And, as always, the answer's there if people actually bothered to read the readme files. I didn't just include them for typing practice you know!
0 x

User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie » Tue Jan 04, 2005 11:43 am

Sorry, must have missed this...
Didn't intented to get on your nerves....
0 x

User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie » Thu Jan 06, 2005 7:36 pm

Now I read all the readme files (hope I didn't miss again anything) but now I've got the following compilation problem with ode: in collission_kernel.cpp of ode I get the following error: dTerrainCallback: identifier not found (it's the part where I added all those setCollider(....) ).
And in collision_trimesh.cpp there is the identifier g undeclared in the #ifdef dTRIMESH_ENABLED. Now I've been playing around with this the whole day an honestly I don't know what to do now. I'm sure it's a stupid beginner error but I'm not abler to fix it. :(

Would it be possible that someon could zip his whole ogreode folder and sent it to me via e-mail or publish it on a ftp. That would be a great help.

My Mail: charlie.babittATgmx.at

PLEASE!!! :oops:
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Fri Jan 07, 2005 12:47 am

Can you post the actual compilation errors you get. I can only assume you've followed one of the steps incorrectly and I apologise if the documentation is unclear.

For starters, you shouldn't have done anything to collision_trimesh.cpp so I can't understand why that's giving you errors.

Secondly, in collision_kernel.cpp, step 5 of the instructions asks you to add lines with the text dTerrainCallbackClass and dCollideTerrainCallback, I don't believe that there's anywhere that you're asked to add anything that says dTerrainCallback. You add the function prototype for dCollideTerrainCallback to collision_std.h (step 6) and the value for dTerrainCallbackClass to the enum in collision.h (step 2).

Hope that makes sense.

What's in CVS (or the snapshot thereof) effectively is my OgreOde folder zipped up. I'm pretty sure that the instructions are correct because I'm sure more people would have whinged if they were wrong, plus I use them myself whenever I upgrade my Ogre installation and have to re-compile OgreOde!

Alternatively there's a patch (created by sinbad, ta!) to make these changes to your ODE installation automatically. I've never tried it, but it should be there in CVS I think.

[edit]
Actually, it's not in CVS, but you can get it here;
http://www.green-eyed-monster.com/ode-05-ogreode.patch
Note that you still need to manually copy across the new dTerrainCallback.cpp file.
[/edit]
0 x

User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie » Sat Jan 08, 2005 6:25 pm

Thanks for the patch monster....
Worked!!

Now I'm driving on the hills and not through the hills.....

As the others already said, great work...
0 x

User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie » Sun Jan 09, 2005 9:18 pm

Again I have a question.
Concerning the landscape demo.
For playing around I wanted to add some objects to the scene. Worked great but I wanted the y coordinate to be calculated by the "system" and not write it hardcoded. So I tried (at the buttom of the createScene(...) method) the command:

Code: Select all

test_position.y=heightAt(test_position);
The method heightAt is decalred in the same file and I suppose this should be the way to get the height at a position.
The Vector3 test_position was initiated with a position which I'm sure is above the terrain (but I also tried an initial position beyond the terrain.

But however my test_position.y always returns 0. Which is definitly beyond the terrain!!! I tried several config files, but still the problem stays.
Would be great if someone has an idea and could help.
0 x

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster » Mon Jan 10, 2005 12:49 pm

the scene needs to have been rendered once before the ray query will work, do it in frame ended not create scene
0 x

User avatar
temas
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 390
Joined: Sun Oct 06, 2002 11:19 pm
Location: The Woodlands, TX
Contact:

Post by temas » Mon Jan 10, 2005 11:03 pm

********* LOCKED *********

This thread is huge and cumbersome, and awfully repetitive now. Search first! If you still have a question, post a new thread.
0 x

Locked