[Bleeding] Bug in TriangleMesh constructor

mikachu

14-04-2008 23:06:43

Hi all,

In this TriangleMesh constructor:

TriangleMesh::TriangleMesh(const Resources::ResourceIdentifier& identifier, const ShapeParams& params)
: Shape()
{
mParams = params;
paramsToDescription(&mShapeDescription, &mParams);
mResourceIdentifier = identifier;
}

mMesh is not initialised at all.
Visual Studio 9 defaults it to 0xcdcdcdcd. Later, when I want to create a body with this TriangleMesh, mMesh is compared against 0.
As mMesh is not null, it is considered to be valid, thus crashing the program.

betajaen

14-04-2008 23:13:54

Duly noted and added.

On another note, I need some sort of automated internet based bug reporting system.

luis

15-04-2008 10:11:20

On another note, I need some sort of automated internet based bug reporting system.
dotproject ? trac ?

betajaen

15-04-2008 10:26:40

No. I'll write my own, and embed it into Plastic.

Toby

30-04-2008 22:23:08

Hi, I just port my code using 0.39 to Bleeding and I noticed same bug.


TriangleMesh::createShape(00000000)
rs => 00D393C8
mesh identifier => piste_mer.mesh
mMesh => 00000000


My mesh is in a zip file and I set location in resources.cfg in my release directory. This works fine before.

How to create a correct track for my car game now? Thanks a lot.

betajaen

30-04-2008 23:05:47

You have to convert the Ogre mesh into a PhysX one (NXS) using flour before you can use it in NxOgre.

Toby

01-05-2008 13:59:49

Then I update physx to 2.8.0 and convert my track in nxs format with flour.
I copy piste_mer.nxs where piste_mer.mesh is.

To create my track I create a body like this:

trackBody = _scene->createBody(trackName, new NxOgre::TriangleMesh(trackName+".mesh"), _pos, "model: "+trackName+".mesh", "static: yes");



But same problem occurs:

TriangleMesh::createShape(00000000)
rs => 0177A898
mesh identifier => piste_mer.nxs
mMesh => 00000000

I debug step by step in TriangleShape::createShape function (nxogreshapemeshes.cpp line 165) and mMesh is not assigned. mResourceIdentifier is not found. (Maybe no resource were loaded but before to upgrade my code all was ok)

Caphalor

01-05-2008 14:07:43

Did you try my fix?
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6891
One post before the last.

Toby

01-05-2008 14:19:39

Hi, Yes I just try it and nothing change. I also add in constructor:


TriangleMesh::TriangleMesh(const Resources::ResourceIdentifier& identifier, const ShapeParams& params)
: Shape()
{
mParams = params;
paramsToDescription(&mShapeDescription, &mParams);
mResourceIdentifier = identifier;
mMesh = NULL; << --------- add
}


Else game crash on mShapeDescription.meshData = mMesh->mMesh.mTriangleMesh;
in createShape function.

Toby

07-10-2008 18:46:42

I up this topic because I want to retry to load my track.

I use a nxs file converted by flour. And I zip it. zip file is loaded by Ogre at start of application.
but could be a problem?

And I do not add this code line before create body:

::NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://piste_mer.nxs", "meshtest-triangle");

any problem if I skip it?

I answer to me. Both this to cause problem.

Now with this part of code all is fine.:


::NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://"+trackName+".nxs", trackName+".nxs");

trackBody = _scene->createBody(trackName, new NxOgre::TriangleMesh(trackName+".nxs"), _pos, "model: "+trackName+".mesh", "static: yes");