DotScene Collision

DieHard

14-11-2006 14:59:03

After integrating NxOgre, my decided to make a level loading (aka dotscene) feature into my engine.

I created the level in Autodesk Maya and exported it out using LFA sceneManager (which also use Ogre Maya Exporter):
http://www.lfagames.com/help.htm

I found a "OgreNewt Dotscene" soure code somewhere on Ogre's websites. I want to convert it over NxOgre to create the collision through the level with only static bodies. (dynamic bodies is not important). I got the level rendering working, but no collision at all, the last major piece. I'm playing between nxOgre::convexShape and nxOgre::meshShape.

nxOgre::meshShape crashes using input parameters MeshFilename and mPhysicsScene.

nxOgre::convexShape asked for "_meshname" (I assume MeshFilename), but it crashes.

Here is a code snippet:
// OgreNewt specific code (I just try !!!)
//OgreNewt::Collision* colDotScen = new OgreNewt::CollisionPrimitives::TreeCollision( m_World, NewNode, false);
//bodDotScen = new OgreNewt::Body( m_World, colDotScen );
//delete colDotScen;

//bodDotScen->attachToNode( NewNode );
// End OgreNewt

//mPhysicsBody = mPhysicsScene->createStaticBody(EntityName, EntityMeshFilename, new nxOgre::convexShape(EntityMeshFilename));
//mPhysicsBody = mPhysicsScene->createStaticBody(EntityName, EntityMeshFilename, new nxOgre::convexShape(EntityName));
mPhysicsBody = mPhysicsScene->createStaticBody(EntityName, EntityMeshFilename, new nxOgre::meshShape(EntityMeshFilename, mPhysicsScene));
mPhysicsBody->mNode->setScale(TempVec);


Everybody like pictures:


I want to contribute this work to NxOgre, so everybody can load levels using XML converted from their "3D Tool" (aka Maya, Blender, and 3ds Max) exporters. I am so close I can taste it.

betajaen

14-11-2006 16:04:34

Excellent, we need a DotScene loader.

The only thing that my spidey senses tell me is that ideally the DotScene should work through the serialiser interface, as shown through Tutorials 504a and 504b.

There is good text serialiser class already written, which you could the code base off. The idea is that you supply a blueprint the needed attributes of the scenes and bodies within from the DotScene file, and the blueprint is passed onto the application, which then creates it for you.

DieHard

15-11-2006 11:54:16

I look into the tutorials, but I can't find "test.txt" So, I assume the next thing, the "SceneSave0.xml" file from my Ageia SDK pack. Very different, because it is more than only collision.

I started tracing through your nxOgre source code from "Serialiser::Serialiser::Unserialise" to "Serialiser::TextStream" in your 504b tutorial. I end up in "nxOgre_textstream.cpp" and started trying different bits & pieces of code from what I found.

I already have a XML reader and a loop to read each item.

Declaration within the read XML loop:
nxOgre::blueprint<nxOgre::scene> bp;bp.toDefault();
bool isPhysicsBody = false;
Ogre::String TempEntityMeshFilename;
Ogre::String bodyName;


The implementation:
nxOgre::blueprint<nxOgre::body> bodyprint;
nxOgre::pose mPose(TempVec, TempQuat);

bodyprint.setToDefault();
bodyprint.addMesh(TempEntityMeshFilename, mPose);
bodyprint.mActor_GlobalPose = mPose;
bodyprint.mNxBody_Exists = false;
bp.mBodies[bodyName] = bodyprint;

for(std::map<Ogre::String, nxOgre::blueprint<nxOgre::body>>::iterator i = bp.mBodies.begin();i != bp.mBodies.end();++i) {
nxOgre::body* b = (*i).second.create((*i).first, mPhysicsScene);
b->mNode->setScale(TempVecScale);
b->setGlobalPosition(TempVec);
b->mNode->setPosition(TempVec);
b->setGlobalOrientation(TempQuat);
b->mNode->setOrientation(TempQuat);
b->wakeUp();
}


Note, the "for-loop" loops once because there is one item made and it is within the "read XML loop", so it reinitialize the declarations. I have no idea how to transform the "for" loop into a execute-once statement because of the "iterator" is getting the "bp.mBodies" The level is rendering properly when I set the "mNode" and "setGlobal..." Setting the "bodyprint" does not work and there is no scale attribute.

After trying as much as I can, I made no progress of getting the collision (only) around the level. The "serialise" way is not working for me. Please note I only want collision and to be static. (The most important feature to have in a level.)

Check it yourself, you will see the commented-out OgreNewt code. The source code is easy to follow.
http://www.developersclub.org/public/Nx ... table1.zip

Thank you for your help.

betajaen

15-11-2006 12:42:45

So far it's looking good.

However if you use do:


for(std::map<Ogre::String, nxOgre::blueprint<nxOgre::body>>::iterator i = bp.mBodies.begin();i != bp.mBodies.end();++i) {
nxOgre::body* b = (*i).second.create((*i).first, mPhysicsScene, pose(TempVec, TempQuat));
b->mNode->scale(TempVecScale);
b->wakeUp();
}


It'll faster, and better on the intergrater ;)

DieHard

15-11-2006 13:32:30

I tried your code snippet, but when I run the program all the objects in the level are centered at the origin. Is it because the mNode is not set too?

Anyway, there is no collision in the level. :(

betajaen

15-11-2006 13:59:32

Ahh. No. I forgot static bodies don't respond to wake ups.

You could try just after sleeping:

b->updateNode();

DieHard

15-11-2006 14:17:15

I removed "b->wakeUp();" because the bodies are static. I added "b->updateNode();" so the position and orientation is working with one stroke. Thanks!

But, the collision (utmost important) feature on the level is still not working. :(

betajaen

15-11-2006 17:37:11

Ahh. I believe I haven't blueprinted the shapes yet, so only a cube works.

So you'd have to go via a different route, and just ignore the blueprint bits for now and do:

mScene->createStaticBody(meshName, pose);

DieHard

16-11-2006 01:25:22

I don't get it. I made the code simple, the XML reader provide me the mesh file and mesh name. I know it's going through NxOgre, because it's rendering out of NxOgre the level with scale, position, and orientation. But, there is no collision! :(

The code is so simple, I'll paste here:

Declaration:
nxOgre::body* mPhysicsBody

Implementation:
nxOgre::pose mPose(TempVec, TempQuat);
mPhysicsBody = mPhysicsScene->createStaticBody(TempEntityMeshFilename, mPose);
mPhysicsBody->mNode->scale(TempVecScale);
mPhysicsBody->updateNode();


The code above is in the XML reader loop, going through each item.

I'm running out of option on static bodies. What is wrong? Where is the collision?

I already uploaded the zip file of the source code, its listed above. Let me know you need the media?

betajaen

16-11-2006 10:19:58

The code is fine. but you can do this:

mPhysicsBody = mPhysicsScene->createStaticBody(TempEntityMeshFilename, nxOgre::pose(TempVec, TempQuat));

But your scaling the mesh? are you expecting the collision mesh to scale, when you scale the node. Because that won't happen.

Also what does the debug renderer look like? (mWorld->debug(true))

DieHard

16-11-2006 15:48:02

Scale is needed. I'll try that code when I get back from work. We better have a option to scale the collision mesh too!!! :)

This is straight from the Autodesk Maya scene exporter:
<scene id="0" formatVersion="0.2.0" sceneManager="any" minOgreVersion="0.14.0" author="LFA Maya Scene Manager by metaldev">
<environment>
<colourAmbient r="0" g="0" b="0" a="0" />
</environment>
<nodes>
<node name="Box1Node" id="0">
<position x="0" y="0" z="411.9912859" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box1" id="0" meshFile="Box1.mesh" static="false" castShadows="true" />
</node>
<node name="PlayerFloorNode" id="0">
<position x="0" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="1" z="24" />
<entity name="PlayerFloor" id="0" meshFile="PlayerFloor.mesh" static="false" castShadows="true" />
</node>
<node name="Building1Node" id="0">
<position x="550" y="0" z="-200" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="300" y="150" z="200" />
<entity name="Building1" id="0" meshFile="Building1.mesh" static="false" castShadows="true" />
</node>
<node name="Building2Node" id="0">
<position x="300" y="0" z="-600" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="300" z="200" />
<entity name="Building2" id="0" meshFile="Building2.mesh" static="false" castShadows="true" />
</node>
<node name="Building3Node" id="0">
<position x="200" y="0" z="-200" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="200" y="500" z="200" />
<entity name="Building3" id="0" meshFile="Building3.mesh" static="false" castShadows="true" />
</node>
<node name="FloorStreet3Node" id="0">
<position x="0" y="0" z="-412" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="800" y="1" z="800" />
<entity name="FloorStreet3" id="0" meshFile="FloorStreet3.mesh" static="false" castShadows="true" />
</node>
<node name="Building4Node" id="0">
<position x="650" y="0" z="-650" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="200" y="600" z="250" />
<entity name="Building4" id="0" meshFile="Building4.mesh" static="false" castShadows="true" />
</node>
<node name="PlayerFloor1Node" id="0">
<position x="400" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="1" z="24" />
<entity name="PlayerFloor1" id="0" meshFile="PlayerFloor1.mesh" static="false" castShadows="true" />
</node>
<node name="PlayerFloor2Node" id="0">
<position x="800" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="1" z="24" />
<entity name="PlayerFloor2" id="0" meshFile="PlayerFloor2.mesh" static="false" castShadows="true" />
</node>
<node name="Wall1Node" id="0">
<position x="792" y="0" z="-412" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="16" y="72" z="800" />
<entity name="Wall1" id="0" meshFile="Wall1.mesh" static="false" castShadows="true" />
</node>
<node name="FloorStreet2Node" id="0">
<position x="0" y="0" z="411.9912859" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="800" y="1" z="800" />
<entity name="FloorStreet2" id="0" meshFile="FloorStreet2.mesh" static="false" castShadows="true" />
</node>
<node name="FloorGroundNode" id="0">
<position x="800" y="0" z="-412" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="800" y="1" z="800" />
<entity name="FloorGround" id="0" meshFile="FloorGround.mesh" static="false" castShadows="true" />
</node>
<node name="PlayerFloor3Node" id="0">
<position x="1200" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="1" z="24" />
<entity name="PlayerFloor3" id="0" meshFile="PlayerFloor3.mesh" static="false" castShadows="true" />
</node>
<node name="Box2Node" id="0">
<position x="375" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box2" id="0" meshFile="Box2.mesh" static="false" castShadows="true" />
</node>
<node name="Box3Node" id="0">
<position x="550" y="50" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box3" id="0" meshFile="Box3.mesh" static="false" castShadows="true" />
</node>
<node name="Box4Node" id="0">
<position x="375" y="100" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box4" id="0" meshFile="Box4.mesh" static="false" castShadows="true" />
</node>
<node name="Box5Node" id="0">
<position x="500" y="150" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box5" id="0" meshFile="Box5.mesh" static="false" castShadows="true" />
</node>
<node name="FloorGround1Node" id="0">
<position x="800" y="0" z="12" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="800" y="1" z="800" />
<entity name="FloorGround1" id="0" meshFile="FloorGround1.mesh" static="false" castShadows="true" />
</node>
<node name="PlayerFloor8Node" id="0">
<position x="1600" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="1" z="24" />
<entity name="PlayerFloor8" id="0" meshFile="PlayerFloor8.mesh" static="false" castShadows="true" />
</node>
<node name="PlayerFloor9Node" id="0">
<position x="2000" y="0" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="400" y="1" z="24" />
<entity name="PlayerFloor9" id="0" meshFile="PlayerFloor9.mesh" static="false" castShadows="true" />
</node>
<node name="FloorGround2Node" id="0">
<position x="1600" y="0" z="-412" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="800" y="1" z="800" />
<entity name="FloorGround2" id="0" meshFile="FloorGround2.mesh" static="false" castShadows="true" />
</node>
<node name="FloorGround3Node" id="0">
<position x="1600" y="0" z="12" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="800" y="1" z="800" />
<entity name="FloorGround3" id="0" meshFile="FloorGround3.mesh" static="false" castShadows="true" />
</node>
<node name="Building5Node" id="0">
<position x="1400" y="0" z="-452.0000066" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="200" y="100" z="100" />
<entity name="Building5" id="0" meshFile="Building5.mesh" static="false" castShadows="true" />
</node>
<node name="Box6Node" id="0">
<position x="1400" y="100" z="-450" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box6" id="0" meshFile="Box6.mesh" static="false" castShadows="true" />
</node>
<node name="Box7Node" id="0">
<position x="1450" y="100" z="-450" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="24" y="24" z="24" />
<entity name="Box7" id="0" meshFile="Box7.mesh" static="false" castShadows="true" />
</node>
<node name="Wall2Node" id="0">
<position x="792" y="0" z="212" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="16" y="72" z="402.7537554" />
<entity name="Wall2" id="0" meshFile="Wall2.mesh" static="false" castShadows="true" />
</node>
<node name="pCube1Node" id="0">
<position x="425" y="50" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="300" y="1" z="24" />
<entity name="pCube1" id="0" meshFile="pCube1.mesh" static="false" castShadows="true" />
</node>
<node name="pCube2Node" id="0">
<position x="250" y="100" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="250" y="1" z="24" />
<entity name="pCube2" id="0" meshFile="pCube2.mesh" static="false" castShadows="true" />
</node>
<node name="pCube3Node" id="0">
<position x="150" y="200" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="300" y="1" z="24" />
<entity name="pCube3" id="0" meshFile="pCube3.mesh" static="false" castShadows="true" />
</node>
<node name="pCube4Node" id="0">
<position x="425" y="150" z="0" />
<rotation qx="0" qy="0" qz="0" qw="1" />
<scale x="200" y="1" z="24" />
<entity name="pCube4" id="0" meshFile="pCube4.mesh" static="false" castShadows="true" />
</node>
</nodes>
</scene>

betajaen

16-11-2006 17:26:51

Ahh.

The meshShape's can't scale, although I could write the code to do it, but it would be better to scale the mesh in your modeler anyway.

DieHard

16-11-2006 22:45:37

No, it is scaled in the modeler tool. That file is straight from the exporter, from Autodesk Maya. I never touch the code when modeling the level. This is how it should be. If not, we're going to have some compatibility problem with Autodesk Maya and Ogre Maya Scene Exporter.

It's been this way since May 2005, a lot people is using it for Autodesk Maya and it works very well:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=10463

betajaen

16-11-2006 22:53:04

Alright, but is the modeler saving those scale models? Or is it just saving them at the default size?

I would prefer the first, although it won't make any different to the mesh cooking time, I would like people to consider to optimize their collision meshes.

CaseyB

16-11-2006 23:14:47

This happens in Max and Blender when you don't collapse the transform stack. If you find the Maya equivalant you'll find that you get a nice FPS boost since you don't need to renormalize the normals to overcome the lighting issues associated with scaling in code.

DieHard

16-11-2006 23:43:18

Thanks for the info, CaseyB. But, I have no idea where in Autodesk Maya to do that. I've been working with Autodesk Maya for months and read through the tutorials and videos, they never explained that to me. :(

I'll Google it later and look for it. Do you know any better keywords to find the exact match?

If I find that option in Autodesk Maya, I'll take that route for performance. But, it will be nice to have that option to scale anyway because of the exporter and newcomers like me.

DieHard

18-11-2006 09:01:55

Okay, I got the collision and static bodies to the level, the most important feature every! Took me hours trying find the command in Autodesk Maya, it was under my nose the whole time, but I didn't know it applies to the mesh when you export it out and it can mess up your level if you don't pick the right options using the command after trial and error.

For other people with the same problems, this is how I did:
On Autodesk Maya, you must do "Freeze Tranformations" (only scale is needed) on all objects. Be careful when doing "Freeze Transformations", you will lose your object's position and orientation relative to the world.

I'm going cleanup the code and I want to create a simple demo, a character moving around and shooting projectiles. I'll release the full source code of NxOgre Dotscene soon.

Thanks for the help again! Another progress success.

parrotbait

18-01-2007 22:57:37

Hi all,
Sorry to resurrect this topic! I have one problem and another question!

My problem involves the same problem as the person who started this topic. I have a parseDotScene method that loads up the scene and adds the .meshes to the physics world and the scene renders out ok. The problem I'm having is that I am trying to perform a raycast operation on the scene but the results are very strange,completely unexpected!

Here is my code to load up the world(the relevant bit anyway!) sorry if its a bit long

XMLNode = XMLNodes->FirstChildElement( "node" );

while( XMLNode )
{ Quaternion TempQuat;
Vector3 TempVec;
String TempValue;

// Process the current node
// Grab the name of the node
NodeName = XMLNode->Attribute("name");
// First create the new scene node
SceneNode* NewNode = static_cast<SceneNode*>( mSceneMgr->getRootSceneNode()->createChild( NodeName ) );


// Now position it...
XMLPosition = XMLNode->FirstChildElement("position");
if( XMLPosition ){
TempValue = XMLPosition->Attribute("x");
TempVec.x = StringConverter::parseReal(TempValue);
TempValue = XMLPosition->Attribute("y");
TempVec.y = StringConverter::parseReal(TempValue);
TempValue = XMLPosition->Attribute("z");
TempVec.z = StringConverter::parseReal(TempValue);
NewNode->setPosition( TempVec );

}

// Rotate it...
XMLRotation = XMLNode->FirstChildElement("rotation");
if( XMLRotation ){

TempValue = XMLRotation->Attribute("qx");
TempQuat.x = StringConverter::parseReal(TempValue);
TempValue = XMLRotation->Attribute("qy");
TempQuat.y = StringConverter::parseReal(TempValue);
TempValue = XMLRotation->Attribute("qz");
TempQuat.z = StringConverter::parseReal(TempValue);
TempValue = XMLRotation->Attribute("qw");
TempQuat.w = StringConverter::parseReal(TempValue);
NewNode->setOrientation( TempQuat );
}

// Scale it.
XMLScale = XMLNode->FirstChildElement("scale");
if( XMLScale ){
TempValue = XMLScale->Attribute("x");
TempVec.x = StringConverter::parseReal(TempValue);
TempValue = XMLScale->Attribute("y");
TempVec.y = StringConverter::parseReal(TempValue);
TempValue = XMLScale->Attribute("z");
TempVec.z = StringConverter::parseReal(TempValue);
NewNode->setScale( TempVec );
}


XMLLight = XMLNode->FirstChildElement( "light" );
if( XMLLight )
{ NewNode->attachObject( LoadLight( XMLLight ) );
}

// Check for an Entity
XMLEntity = XMLNode->FirstChildElement("entity");
if( XMLEntity )
{ String EntityName, EntityMeshFilename;
EntityName = XMLEntity->Attribute( "name" );
EntityMeshFilename = XMLEntity->Attribute( "meshFile" );
if( XMLEntity->Attribute("static") )
{
if( strcmp( XMLEntity->Attribute("static"), "false" )==0 ){
// Create entity
Entity* NewEntity = mSceneMgr->createEntity(EntityName, EntityMeshFilename);
NewNode->attachObject( NewEntity );


}


}
nxOgre::body* mPhysicsBody;
//nxOgre::pose mPose(NewNode->getPosition(), TempQuat);

//mPhysicsBody = physicsScene->createStaticBody(EntityName,EntityMeshFilename,new nxOgre::meshShape(EntityMeshFilename,physicsScene),mPose);
//mPhysicsBody = physicsScene->createStaticBody(EntityMeshFilename, nxOgre::pose(NewNode->getPosition(), TempQuat));
//mPhysicsBody->updateNode();

nxOgre::pose mPose(NewNode->getPosition(), TempQuat);
mPhysicsBody = physicsScene->createStaticBody(EntityMeshFilename, mPose);
//mPhysicsBody->mNode->scale(Vector3(1,1,1));
mPhysicsBody->updateNode();
}


Here is my raycasting code


rayCaster *mCaster;
Vector3 nodePosition = Vector3(worldNodes[p.y * mapSize.x + p.x].mapPos.x, 50.0f, worldNodes[p.y * mapSize.x + p.x].mapPos.y);
mCaster = physicsScene->createRayCaster(nodePosition,Vector3::NEGATIVE_UNIT_Y,50.0f);

mCaster->cast();

if (mCaster->mDistance > 45.0f)
{
worldNodes[p.y * mapSize.x + p.x].walkable = false;
}
else
{ worldNodes[p.y * mapSize.x + p.x].walkable = true;
}



Essentially the points are pathfinding nodes and I am trying to automatically mark some as walkable/unwalkable. Anyone see anything wrong with my code?

My question is that I was using the DotSceneManager previously to cull the scene but with the nxogre world it appears the kitchen.bin which contains the octree data isn't being parsed at all. Does this mean there's no octree operations going on at all? is there a way for the scene manager to use my .bin file?

Thanks,
Eddie

DieHard

20-01-2007 07:16:47

Is there more than one problem you're asking? Lets back up a minute to the DotScene. It should read a file type called ".scene" which contains XML information.

Before you do raycasting code, you need to see if the DotScene code renders the level with collision and all it's glory. So, does it load and render the level?

parrotbait

20-01-2007 10:33:54

Ok right. I didn't put in the first part of my dotscene parsing function for the sake of brevity but yes it is loading my .scene file and reading in all the various parts as expected.

The NxOgre 'model' is also being rendered correctly and collision detection is working on the level as I have some little units that fall around the place and bounce off of objects in the level when subjected to gravity. So as I can see everything is being created as expected for NxOgre but just no raycasting! Any help would be much appreciated.

parrotbait

20-01-2007 11:58:54

For a little bit of further information and visualisation of my problem here is my scene with the world->debug(true) overlay switched on.

http://parrotbait.googlepages.com/screenshot_3.jpg

As you can see my level is a little kitchen and what I want to do is to cast a ray in the negative y direction from various horizontal points in the scene to determine scene walkability. So if a ray is cast and it intersects with the floor the distance will be greater than if a ray intersects with the counter and that node(in my pathfinding) can be marked as unwalkable.

Do you need to transform the ray origin and direction to model space akin to DirectX, I assumed NxOgre does that for you!

betajaen

20-01-2007 18:23:00

I found raycasting in older versions to be a little iffy in closed spaces like that. A character controller uses raycasting to help it walk, try and see if that works.

If it doesn't see what Ageia thinks of it.


Also try cutting down on the amount of polygons for meshes used by PhysX, basically the less triangles; the more accurate and faster it is. You can cheat for example the floor could just be 2 triangles. Instead of 20, then you use the un-optimised mesh for Ogre.

parrotbait

21-01-2007 10:36:48

Right got this problem fixed it was pretty stupid of me. I tried to send messages to the Ogre.log and on examining the log file I discovered that the raycasting operation was being performed on the physics scene before the meshes were added. Not sure how it happened but it works perfectly now and my pathfinding nodes are ready to be plugged into A*. Thanks for your help.