The OgreOde Thread
-
- Gnoblar
- Posts: 18
- Joined: Wed Oct 13, 2004 12:40 pm
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
@ thegame
Not a lot, it's mostly just incorporating the changes people have suggested to make the code better and more portable. What's new;
@ Brutha
http://ode.petrucci.ch/
Or there's always the ODE mailing list;
http://q12.org/mailman/listinfo/ode
Just don't mention that you're using some dodgy wrapper, pretend you're using the actual ODE functions! As I've said before, the function calls should be pretty much exact equivalents of the raw ODE stuff, so the ODE docs and any pure ODE example code should be easy enough to translate.
Part of the documentation that I need to do will be letting people know the equivalent ODE functions (and enums, etc) for the OgreOde stuff. Most of it's obvious, but in some cases I've attempted to make the names a bit more meaningful, and probably just made them more confusing!
But, no, I've never used AMotors myself.
How much has changed in this version of OgreOde ?
Not a lot, it's mostly just incorporating the changes people have suggested to make the code better and more portable. What's new;
- The Vehicle stuff - but still needs a lot of work!
Utility functions (the MeshInformer) - makes it easier to build Trimeshes, bounding spheres and bounding boxes from Ogre nodes without having to manually read the vertex/index data. See how much the Trimesh sample has been simplified.
The terrain collision primitive and...
The planar (2.5D) joint - but you'll have to modify ODE itself (instructions included) to support these two
An automatic "combination of materials" collision listener - that I haven't actually tested yet!
Changes to the auto disable stuff - it's now sleep/wake rather than disable/enable
A few changes to make it work with the latest versions of ODE and Ogre.
Seriously? That does suck. Last month I managed to download nearly 6Gb so 2Mb is a drop in the ocean!my bandwith sucks and 2 mb for me is like 200 !!
@ Brutha
Actually there is an ODE forum, it's here;...as there is no Ode Forum I'll just ask here.
http://ode.petrucci.ch/
Or there's always the ODE mailing list;
http://q12.org/mailman/listinfo/ode
Just don't mention that you're using some dodgy wrapper, pretend you're using the actual ODE functions! As I've said before, the function calls should be pretty much exact equivalents of the raw ODE stuff, so the ODE docs and any pure ODE example code should be easy enough to translate.
Part of the documentation that I need to do will be letting people know the equivalent ODE functions (and enums, etc) for the OgreOde stuff. Most of it's obvious, but in some cases I've attempted to make the names a bit more meaningful, and probably just made them more confusing!
But, no, I've never used AMotors myself.
-
- Gnoblar
- Posts: 18
- Joined: Wed Oct 13, 2004 12:40 pm
-
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
-
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
An another one question.
In helicopter demo i try to create one more compound object.
New object collid with boxes but do not collid with helicopter and rockets .
Strange...
i include then code in constructor
Do Ogreode support collision between two compound objects like helicopter ?
Thanks.
In helicopter demo i try to create one more compound object.
New object collid with boxes but do not collid with helicopter and rockets .
Strange...
i include then code in constructor
Code: Select all
//*************************************************************************
Entity* shashka_entity;
shashka_entity=_mgr->createEntity("Shashka", "Cylinder04.mesh");
shashka_entity->setCastShadows(true);
SceneNode* shashka_node=_mgr->getRootSceneNode()->createChildSceneNode("Shashka");
shashka_node->attachObject(shashka_entity);
shashka_node->setPosition(0,4,0);
shashka_node->setScale(0.1,0.1,0.1);
OgreOde::SimpleSpace* shashka_space= new OgreOde::SimpleSpace(_space);
shashka_space->setInternalCollisions(false);
OgreOde::BoxMass shashka_mass(1.5,Vector3(1,1,1));
OgreOde::Body* shashka_body = new OgreOde::Body();
shashka_node->attachObject(shashka_body);
shashka_body->setMass(shashka_mass);
_bodies.push_back(shashka_body);
_last_node=shashka_node;
OgreOde::TransformGeometry* transformGeometry = new OgreOde::TransformGeometry(shashka_space);
OgreOde::BoxGeometry* shashka_geometry = new OgreOde::BoxGeometry(Vector3(1.0,1.0,1.0));
transformGeometry->setBody(shashka_body);
transformGeometry->setEncapsulatedGeometry(shashka_geometry);
shashka_geometry->setPosition(Vector3( 0,0,0));
_geoms.push_back(shashka_geometry);
_geoms.push_back(transformGeometry);
//**************************************************************************
Thanks.
-
- Gnoblar
- Posts: 18
- Joined: Wed Oct 13, 2004 12:40 pm
I played a bit with angular motors and I think there is a function missing in OgreOde.
In Ode Manual it says:
7.5.1. Parameter Functions (setParameter)
These parameter names can be optionally followed by a digit (2 or 3) to indicate the second or third set of parameters, e.g. for the second axis in a hinge-2 joint, or the third axis in an AMotor joint. A constant dParamGroup is also defined such that: dParamXi = dParamX + dParamGroup * (i-1).
There should either be a public ParamGroup in the Joint Class or just in enum Parameter
LowStop2 = dParamLoStop2,
and so on
If there is already a way to do this I apologize
In Ode Manual it says:
7.5.1. Parameter Functions (setParameter)
These parameter names can be optionally followed by a digit (2 or 3) to indicate the second or third set of parameters, e.g. for the second axis in a hinge-2 joint, or the third axis in an AMotor joint. A constant dParamGroup is also defined such that: dParamXi = dParamX + dParamGroup * (i-1).
There should either be a public ParamGroup in the Joint Class or just in enum Parameter
LowStop2 = dParamLoStop2,
and so on
If there is already a way to do this I apologize
-
- Gnoblar
- Posts: 11
- Joined: Tue Aug 10, 2004 9:08 pm
- Location: Pasadena, CA
-
- Gnoblar
- Posts: 18
- Joined: Wed Oct 13, 2004 12:40 pm
I just added:
MotorVelocity2 = dParamVel2,
MotorVelocity3 = dParamVel3,
to "enum Parameter" in OgreOdeJoint.h . That worked for me since I didn't need anything else, but I think there are certain conditions where you need more input for the other parameters. Just wanted to report it
BTW I love OgreOde thanks Monster
MotorVelocity2 = dParamVel2,
MotorVelocity3 = dParamVel3,
to "enum Parameter" in OgreOdeJoint.h . That worked for me since I didn't need anything else, but I think there are certain conditions where you need more input for the other parameters. Just wanted to report it
BTW I love OgreOde thanks Monster
-
- Gnoblar
- Posts: 23
- Joined: Tue Aug 31, 2004 7:50 am
Downloaded the preview version of OgreOde...
StringUtil::BLANK undeclared identifier - I figured this out myself, using Ogre 0.14 and with the latest Ogre its moved from String to StringUtil.
Compiling Demo_SimpleScreens
I guess this has also got to do with the new Ogre - or is it something else ??
StringUtil::BLANK undeclared identifier - I figured this out myself, using Ogre 0.14 and with the latest Ogre its moved from String to StringUtil.
Compiling Demo_SimpleScreens
Code: Select all
SimpleScenesApplication.cpp
..\..\include\SimpleScenes_Buggy.h(63) : error C3861: 'Radian': identifier not found, even with argument-dependent lookup
SimpleScenes.cpp
Linux Rocks!!!
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
From the original post announcing this version;StringUtil::BLANK undeclared identifier - I figured this out myself, using Ogre 0.14
And from the post mentioning some of the changes;You should extract the Zip to your ogrenew (or whatever you've renamed it to) directory, remembering to preserve the directory structure. And that ogrenew directory should contain a reasonably recent CVS snapshot of Ogre, mine's from a couple of days ago.
So yes, the implication is that it will only work with a resaonably recent version of Ogre. It's targetted at the 0.15 release. Sorry, that should probably be in the readme.A few changes to make it work with the latest versions of ODE and Ogre.
You can't. Because ODE can't. There are some cylinder contributions available for ODE but at the moment the concensus seems to be that they're not really ready for prime time. Especially when colliding with trimeshes. If this changes, or if anyone would like to point out that it has changed already, then I'll be happy to incorporate a cylinder primitive into OgreOde.How I can create cilynder with ogreode
Yep, it should, if ODE does. Which it does. You have to make sure your geometries are in different spaces, or if they're in the same space, that you've got "internal collisions" switched on for that space.Do Ogreode support collision between two compound objects like helicopter
That looks like something I've missed out. Sorry about that. I'll look into it and add the missing bits as appropriate.7.5.1. Parameter Functions (setParameter)
These parameter names can be optionally followed by a digit (2 or 3)
Thanks for spotting it!
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
Download updated. Now there's an optional parameter to Joint::setParameter called 'axis'. This specifies the axis you want the parameter to apply to. Effectively it's the 2 or 3 following the parameter name, but without making the enum massive. The default value for this parameter is 1. I've also added the joint addTorque/Force stuff that I seemed to have missed out.7.5.1. Parameter Functions (setParameter)
These parameter names can be optionally followed by a digit (2 or 3)
Hope that's OK.
-
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
Strange... When I created objects in the same space -- all works,You have to make sure your geometries are in different spaces, or if they're in the same space, that you've got "internal collisions" switched on for that space.
but in diferent spaces objects still do not collids.
setInternalCollisions(true); -- swiched.
Please help me to fix it:
Code: Select all
Entity* shashka_entity;
shashka_entity=_mgr->createEntity("Shashka", "Cylinder04.mesh");
shashka_entity->setCastShadows(true);
SceneNode* shashka_node=_mgr->getRootSceneNode()->createChildSceneNode("Shashka");
shashka_node->attachObject(shashka_entity);
shashka_node->setPosition(0,4,0);
shashka_node->setScale(0.1,0.1,0.1);
OgreOde::SimpleSpace* shashka_space= new OgreOde::SimpleSpace(_space);
shashka_space->setInternalCollisions(true);
shashka_space->setAutoCleanup(false);
//shashka_space->
OgreOde::BoxMass shashka_mass(1.5,Vector3(1,1,1));
OgreOde::Body* shashka_body = new OgreOde::Body();
shashka_node->attachObject(shashka_body);
shashka_body->setMass(shashka_mass);
_bodies.push_back(shashka_body);
_last_node=shashka_node;
OgreOde::TransformGeometry* transformGeometry = new OgreOde::TransformGeometry(shashka_space);
OgreOde::BoxGeometry* shashka_geometry = new OgreOde::BoxGeometry(Vector3(1.0,1.0,1.0));
transformGeometry->setBody(shashka_body);
transformGeometry->setEncapsulatedGeometry(shashka_geometry);
shashka_geometry->setPosition(Vector3( 0,0,0));
_geoms.push_back(shashka_geometry);
_geoms.push_back(transformGeometry);
//**************************************************************************
---- SKIP ----
---- SKIP ----
---- SKIP ----
_apache_space = new OgreOde::SimpleSpace(_space);
//WHEN THIS STRING IS AVAIBLE - ALL WORKS....
//_apache_space= shashka_space;
_apache_space->setInternalCollisions(true);
_apache_space->setAutoCleanup(false);
// Create the physical body of the helicopter
OgreOde::BoxMass apache_mass(1.5,Vector3(1.4,1.46,4.24));
_apache = new OgreOde::Body();
_apache_body_node->attachObject(_apache);
_apache->setMass(apache_mass);
_bodies.push_back(_apache);
_last_node = _apache_body_node;
// Create the geometry of the helicopter from several bits
// Main body
OgreOde::TransformGeometry* trans = new OgreOde::TransformGeometry(_apache_space);
OgreOde::BoxGeometry* geom = new OgreOde::BoxGeometry(Vector3(1.4,1.46,4.24));
trans->setBody(_apache);
trans->setEncapsulatedGeometry(geom);
geom->setPosition(Vector3(0.013,0.014,1.052));
_geoms.push_back(geom);
_geoms.push_back(trans);
-
- OGRE Retired Moderator
- Posts: 1365
- Joined: Tue Sep 07, 2004 12:43 pm
- Location: Aalborg, Denmark
I had the same problem with an earlier version of OgreODE, I don't know if this has been fixed, but my solution was to change:Strange... When I created objects in the same space -- all works,
but in diferent spaces objects still do not collids.
Code: Select all
void World::collisionCallback(void *data,dGeomID geom_a,dGeomID geom_b)
{
if( dGeomIsSpace(geom_a) || dGeomIsSpace(geom_b) )
{
if(dGeomIsSpace(geom_a)) ((Space*)(dGeomGetData(geom_a)))->collide(data);
else ((Space*)(dGeomGetData(geom_b)))->collide((Geometry*)(dGeomGetData(geom_a)),data);
if(dGeomIsSpace(geom_b)) ((Space*)(dGeomGetData(geom_b)))->collide(data);
else ((Space*)(dGeomGetData(geom_a)))->collide((Geometry*)(dGeomGetData(geom_b)),data);
}
else
{
((Geometry*)(dGeomGetData(geom_a)))->collide((Geometry*)(dGeomGetData(geom_b)),_collision_listener);
}
}
Code: Select all
void World::collisionCallback(void *data,dGeomID geom_a,dGeomID geom_b)
{
if( dGeomIsSpace(geom_a) || dGeomIsSpace(geom_b) )
{
// Colliding a space with something
((Space*)(dGeomGetData(geom_a)))->collide((Geometry*)(dGeomGetData(geom_b)),data);
// Collide all geoms internal to the space(s)
if (dGeomIsSpace(geom_a))
((Space*)(dGeomGetData(geom_a)))->collide(data);
if (dGeomIsSpace(geom_b))
((Space*)(dGeomGetData(geom_b)))->collide(data);
}
else
{
((Geometry*)(dGeomGetData(geom_a)))->collide((Geometry*)(dGeomGetData(geom_b)),_collision_listener);
}
}
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
The World::collisionCallback function has changed in this version of OgreOde it should do;This version also checks space/space rather than only geom/space and geom/geom.
- spaceA/spaceB
spaceA/geomB
geomA/spaceB
spaceA internal
spaceB internal
geomA/geomB
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
@ Troglodit
I've just copied your code from above (from the line "Entity* shashka_entity;" to the line "_geoms.push_back(transformGeometry);") straight into the SimpleScenes_Crash.h source (just above the line that says "// Create a space for the helicopter to live in") and it works perfectly. I just had to change the "Cylinder04.mesh".
If I leave the line "_apache_space = new OgreOde::SimpleSpace(_space);" as-is then it works fine. If I change that to "_apache_space = shashka_space;" then (obviously) it doesn't collide because I then subsequently need to do "_apache_space->setInternalCollisions(true);" which makes everything OK.
Perhaps a stupid question, but you are using this latest version of OgreOde aren't you?
I've just copied your code from above (from the line "Entity* shashka_entity;" to the line "_geoms.push_back(transformGeometry);") straight into the SimpleScenes_Crash.h source (just above the line that says "// Create a space for the helicopter to live in") and it works perfectly. I just had to change the "Cylinder04.mesh".
If I leave the line "_apache_space = new OgreOde::SimpleSpace(_space);" as-is then it works fine. If I change that to "_apache_space = shashka_space;" then (obviously) it doesn't collide because I then subsequently need to do "_apache_space->setInternalCollisions(true);" which makes everything OK.
Perhaps a stupid question, but you are using this latest version of OgreOde aren't you?
-
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
hm... ups...Perhaps a stupid question, but you are using this latest version of OgreOde aren't you?
I dont think so...
latest file is 28.06.04 9:55.
I just download link from first page of this topic ... 3 days ago.
From where I must download it ?
I found ! This one :http://www.green-eyed-monster.com/OgreOde_Preview.zip ?
-
- Goblin
- Posts: 220
- Joined: Mon May 31, 2004 5:54 am
- Location: Canada
Cool, got the new version of OgreOde working with the latest CVS with no problems, and the mouse movement issue is gone (so have the OpenGL shadow duplications)
Anyways, the Landscape demo seems to not really work properly. Rendering-wise it's fine, but when I drive around the car seems to "drive" in to the terrain, and flip around and stuff, and eventually ends up upsidedown?
I'm thinking I have to compile something special into ODE, but how did it compile with no errors even though it's missing something?
edit - NM, I RTFM.
Anyways, the Landscape demo seems to not really work properly. Rendering-wise it's fine, but when I drive around the car seems to "drive" in to the terrain, and flip around and stuff, and eventually ends up upsidedown?
I'm thinking I have to compile something special into ODE, but how did it compile with no errors even though it's missing something?
edit - NM, I RTFM.
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
That's the one.I found ! This one...
I've also updated the first post in the thread to help people find the latest version!
LOL! Yeah, you have to compile ODE with the special terrain collision primitive.edit - NM, I RTFM.
And everything's #ifdef'd out so that it'll still compile even if you don't want to muck about with ODE. It just won't (as you discovered) work quite correctly!
-
- Gnoblar
- Posts: 18
- Joined: Wed Oct 13, 2004 12:40 pm
-
- Gnoblar
- Posts: 23
- Joined: Tue Aug 31, 2004 7:50 am
The OgreOde_Preview complied without a hitch with the new version of Ogre. I love the car controls now - it skids a lot
Anyway after modifiying ODE-0.5 to use the TerrainCallback collider everyhting compiles and the ode & opcode libraries are created successfully. But bulding the odeDLL sloution gives me this link error
seen this before ?
Anyway after modifiying ODE-0.5 to use the TerrainCallback collider everyhting compiles and the ode & opcode libraries are created successfully. But bulding the odeDLL sloution gives me this link error
Code: Select all
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification\par
collision_kernel.obj : error LNK2019: unresolved external symbol
"int __cdecl dCollideTerrainCallback(struct dxGeom *,struct dxGeom *,int,struct dContactGeom *,int)"
(?dCollideTerrainCallback@@YAHPAUdxGeom@@0HPAUdContactGeom@@H@Z) referenced in function "void __cdecl initColliders(void)" (?initColliders@@YAXXZ)
..\\lib\\oded.dll : fatal error LNK1120: 1 unresolved externals
Linux Rocks!!!
-
- Goblin
- Posts: 220
- Joined: Mon May 31, 2004 5:54 am
- Location: Canada
I don't think you should be compiling ODE as a dll?Open Dynamics Engine for OgreOde
================================
In the following documentation $OGRE_TOP is the directory to which you have
extracted your Ogre distribution. This directory is normally named 'ogrenew'.
You must build ODE, as detailed in it's documentation, in this directory.
Also, $ODE_TOP refers to the top level directory to which you have extracted
ODE. For the current stable release, and assuming you are using the correct
OgreOde directory structure, this will be $OGRE_TOP/OgreOde/ode-0.5
Building ODE
------------
To use ODE with OgreOde I recommend that you compile it with the following
options (in config/user-settings) set;
PLATFORM=msvc
Rather than msvc-dll, when compiling with MSVC.
-
- Gnoblar
- Posts: 23
- Joined: Tue Aug 31, 2004 7:50 am
Damn....
EDIT : not quite. Well I didn't bother to create ode.dll this time and proceeded as usual. I get this linker error with OgreOde
and the OgreOde_demos*.exe ask for OgreOde.dll. I am sorry If I am missing something real obvious here but since I am new to the Windows Development Environment (which BTW sucks!), I am all at sea [/code]
EDIT : not quite. Well I didn't bother to create ode.dll this time and proceeded as usual. I get this linker error with OgreOde
Code: Select all
Linking...
Creating library ..\..\lib\Release/OgreOde.lib and object ..\..\lib\Release/OgreOde.exp
ode.lib(collision_kernel.obj) : error LNK2001: unresolved external symbol "int __cdecl dCollideTerrainCallback(struct dxGeom *,struct dxGeom *,int,struct dContactGeom *,int)" (?dCollideTerrainCallback@@YAHPAUdxGeom@@0HPAUdContactGeom@@H@Z)
..\..\lib\Release/OgreOde.dll : fatal error LNK1120: 1 unresolved externals
Linux Rocks!!!
-
- Gnoblar
- Posts: 23
- Joined: Tue Aug 31, 2004 7:50 am
-
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
Around line 66 of ode-0.5/ode/src/collision_std.h, just after where it says;
You should have added the function prototype;
The function body, which the linker is complaining that it can't find, is in ode-0.5/contrib/TerrainCallback/dTerrainCallback.cpp and you need to copy this to ode-0.5/ode/src and add it to the ODE_SRC variable in ODE's makefile. I suspect it's this last step that you're missing.
You should have modified ode-0.5/Makefile so that the ODE_SRC variable is defined thus;
And, BTW, Makefiles suck to the max! Put a tab instead of a space (or vice versa) and the whole thing breaks!
If you've done all this;
Code: Select all
int dCollideRayPlane (dxGeom *o1, dxGeom *o2, int flags,
dContactGeom *contact, int skip);
Code: Select all
int dCollideTerrainCallback(dxGeom *o1, dxGeom *o2, int flags,dContactGeom *contact, int skip);
You should have modified ode-0.5/Makefile so that the ODE_SRC variable is defined thus;
Code: Select all
ODE_SRC = \
ode/src/array.cpp \
ode/src/error.cpp \
ode/src/memory.cpp \
ode/src/obstack.cpp \
ode/src/odemath.cpp \
ode/src/matrix.cpp \
ode/src/misc.cpp \
ode/src/rotation.cpp \
ode/src/mass.cpp \
ode/src/ode.cpp \
ode/src/step.cpp \
ode/src/stepfast.cpp \
ode/src/quickstep.cpp \
ode/src/util.cpp \
ode/src/lcp.cpp \
ode/src/joint.cpp \
ode/src/timer.cpp \
ode/src/mat.cpp \
ode/src/testing.cpp \
ode/src/export-dif.cpp \
ode/src/collision_kernel.cpp \
ode/src/collision_util.cpp \
ode/src/collision_std.cpp \
ode/src/collision_space.cpp \
ode/src/collision_transform.cpp \
ode/src/dTerrainCallback.cpp \
ode/src/collision_quadtreespace.cpp
If you've done all this;
- Check that the signature you added in collision_std.h is correct
You shouldn't have touched dTerrainCallback.cpp, except to copy it into the right place. But check that it matches the prototype.
Ensure that you've defined "PLATFORM=msvc", "PRECISION=SINGLE", "BUILD=release", "WINDOWS16=0", and "OPCODE_DIRECTORY=OPCODE" in ode-0.5/config/user-settings
Do a make clean, and then a make ode-lib