IrrPhysx 0.2 - Nvidia Physx 2.8.1 wrapper
I have a weird issue.
When I load my terrain tiles, I use 33x33 for each patch, it works well but if I don't face the terrain supposed to load PhysX crashes on "createHeightField()".
I tried to find a problem on my part but couldn't find any :/
If i disable PhysX my app doesn't crash at all.
Also I noticed that if I start the app from VS using the debug tool the problem never occurs...
Could it be a PhysX problem or maybe a bad implementation of PhysX for Windows 7 ?
I tried pretty much everything but I couldn't find a solution :/
When I load my terrain tiles, I use 33x33 for each patch, it works well but if I don't face the terrain supposed to load PhysX crashes on "createHeightField()".
I tried to find a problem on my part but couldn't find any :/
If i disable PhysX my app doesn't crash at all.
Also I noticed that if I start the app from VS using the debug tool the problem never occurs...
Could it be a PhysX problem or maybe a bad implementation of PhysX for Windows 7 ?
I tried pretty much everything but I couldn't find a solution :/
I will take a look, thanks for the tip.
EDIT
It is indeed this ROUND function that crashed the program, so I looked for a ROUND function in the standard library and I was surprisied by the fact that no round function existed.
Then I found that during the cast, the round function is native, so the ROUND macro was useless to begin with, you can chose if you floor or ceil in the compiler options.
EDIT2
The problem still occurs but less often...
EDIT
It is indeed this ROUND function that crashed the program, so I looked for a ROUND function in the standard library and I was surprisied by the fact that no round function existed.
Then I found that during the cast, the round function is native, so the ROUND macro was useless to begin with, you can chose if you floor or ceil in the compiler options.
EDIT2
The problem still occurs but less often...
Hi gyes! JP, I'm one of admins of russian community of irrPhysX. And we write russian tutorials for IrrPhysX. Now, I want to write articles about using IrrPhysX with irr-files, but I don't know anythink about use Irr-files with IrrPhysX. And my this is my question: How use IrrPhysX with irr-files. If you can make the example project about this, pls, make it and upload it to this topic.
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
Hey Dronchik, maybe this helps:
The code above gets all nodes from an .irr scene, then creates meshes from those nodes and applies collision, then it hides the meshes created by IrrPhysX, so only the initial .irr meshes are shown. This way I can keep the settings made with IrrEdit (transparencies etc.)
Also I'd like to say thanks to JP for making this extension for Irrlicht, it's great!
I'm currently trying to create a vehicle (car type), I'll post the code if I succeed.
Code: Select all
core::array<scene::ISceneNode *> nodes;
smgr->getSceneNodesFromType(scene::ESNT_ANY, nodes); // Find all nodes
for (u32 i=0; i < nodes.size(); ++i)
{
scene::ISceneNode * node = nodes[i];
switch(node->getType())
{
case scene::ESNT_MESH:
{
ISceneManager* smgr = device->getSceneManager();
attribs = device->getFileSystem()->createEmptyAttributes();
node->serializeAttributes(attribs);
core::stringc nameXX = attribs->getAttributeAsString("Mesh");
attribs->drop();
scene::IMesh* groundMesh = 0;
groundMesh = smgr->getMesh(nameXX.c_str());
core::vector3df pos = node->getPosition();
core::vector3df rot = node->getRotation();
core::vector3df sca = node->getScale();
SPhysxAndNodePair* pair = new SPhysxAndNodePair;
IPhysxMesh* physxMesh = physxManager->createTriangleMesh(groundMesh->getMeshBuffer(0), sca);
pair->PhysxObject = physxManager->createTriangleMeshObject(physxMesh, pos, rot);
pair->SceneNode = smgr->addMeshSceneNode(groundMesh, NULL, -1, pos, rot, sca);
pair->SceneNode->setVisible(false);
objects.push_back(pair);
}
case scene::ESNT_TERRAIN:
{
physxManager->createHeightfieldObject((scene::ITerrainSceneNode*)node, 0);}
break;
default:
break;
}
Also I'd like to say thanks to JP for making this extension for Irrlicht, it's great!
I'm currently trying to create a vehicle (car type), I'll post the code if I succeed.
-
- Posts: 3
- Joined: Thu Sep 17, 2009 6:47 am
I look forward to seeing that vehicle support! Certainly something I've thought about myself but never got round to playing with yet, lots of other things on the todo list which I still don't have much time for either!
Dronchik, check out readScene .h & .cpp in the IrrPhysx SDK (probably in the Common folder, under the Examples folder), that's how I handle .irr scenes. Actually that might just be in the Game Example... have a nose around and you'll find it somewhere!
Dronchik, check out readScene .h & .cpp in the IrrPhysx SDK (probably in the Common folder, under the Examples folder), that's how I handle .irr scenes. Actually that might just be in the Game Example... have a nose around and you'll find it somewhere!
-
- Posts: 18
- Joined: Fri Sep 11, 2009 4:31 am
-
- Posts: 18
- Joined: Fri Sep 11, 2009 4:31 am
-
- Posts: 18
- Joined: Fri Sep 11, 2009 4:31 am