Page 17 of 17
Posted: Tue Nov 30, 2004 4:34 am
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.
Posted: 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
General Collision question
Posted: 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.
Posted: 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!
Posted: 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
Posted: 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.
Posted: 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
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
Posted: 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.
Posted: 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.
Posted: 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?
Posted: 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!
Posted: Sat Dec 18, 2004 9:31 am
OK, got it... thnx
Is there a linux build somewhere? I can't find it...
Posted: 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.
Posted: Sat Dec 25, 2004 9:49 pm
Did anyone got the samlpes for ogreode CVS working under linux ?
Posted: 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?
Posted: 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.
Posted: Mon Jan 03, 2005 9:11 pm
Maybe it's about time to lock this thread?
Posted: 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!
Posted: Tue Jan 04, 2005 11:43 am
Sorry, must have missed this...
Didn't intented to get on your nerves....
Posted: 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
Posted: 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
TerrainCallback, 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.
Actually, it's not in CVS, but you can get it here;
Note that you still need to manually copy across the new dTerrainCallback.cpp file.
Posted: Sat Jan 08, 2005 6:25 pm
Thanks for the patch monster....
Now I'm driving on the hills and not through the hills.....
As the others already said, great work...
Posted: 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
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.
Posted: 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
Posted: 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.