ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > irrEdit
forum topic indicator Collsion with a irredit scene
person icon
hybrid
Guest
Quote
2007-04-17 20:40:56

Use the c_str method: irrstring.cstr()

person icon
vitek
Guest
Quote
2007-04-17 20:41:10

You should get used to looking stuff up in the headers or documentation. If you don't you'll spend a lot of time begging for people to answer your questions... You can get a character array [const c8*] from a stringc with c_str().

Travis

person icon
Kennypu
Guest
Quote
2007-05-05 21:13:28

Hello, can any body help me? My program crashes everytime I run this program. Heres the source code.

    smgr->loadScene("media/room1.irr");
    scene::ITriangleSelector* selector=0;
    smgr->getRootSceneNode();
    scene::ISceneNode*  snode=smgr->getSceneNodeFromName("room");
    scene::IAnimatedMesh* level;
    if (snode && snode->getType()==scene::ESNT_MESH)
    {
              level=(scene::IAnimatedMesh*)snode;
              
    }
    scene::ISceneNode* node=0;
    if (level)
    {
              node= smgr->addOctTreeSceneNode(level->getMesh(0));
    }
    if (node)
    {
             selector= smgr->createOctTreeTriangleSelector(level->getMesh(0),node,128);
              node->setTriangleSelector(selector);
              selector->drop();
    }


thats the part where i try to get the mesh out of the file, and put collision response on it. I get a debugging error saying "An Access violation(Segmentation Fault) raised in your program", at the line:
              node= smgr->addOctTreeSceneNode(level->getMesh(0));

can anybody help me out please?thanks



person icon
Brendan
Guest
Quote
2007-05-09 02:22:10

[quote=Kennypu (Guest)]Hello, can any body help me? My program crashes everytime I run this program. Heres the source code.

    smgr->loadScene("media/room1.irr");
    scene::ITriangleSelector* selector=0;
    smgr->getRootSceneNode();
    scene::ISceneNode*  snode=smgr->getSceneNodeFromName("room");
    scene::IAnimatedMesh* level;
    if (snode && snode->getType()==scene::ESNT_MESH)
    {
              level=(scene::IAnimatedMesh*)snode;
              
    }
    scene::ISceneNode* node=0;
    if (level)
    {
              node= smgr->addOctTreeSceneNode(level->getMesh(0));
    }
    if (node)
    {
             selector= smgr->createOctTreeTriangleSelector(level->getMesh(0),node,128);
              node->setTriangleSelector(selector);
              selector->drop();
    }


thats the part where i try to get the mesh out of the file, and put collision response on it. I get a debugging error saying "An Access violation(Segmentation Fault) raised in your program", at the line:
              node= smgr->addOctTreeSceneNode(level->getMesh(0));

can anybody help me out please?thanks

[/quote]
Here:

level=(scene::IAnimatedMesh*)snode;

You are attempting to cast a scene node to a mesh, which does not work.  'level' ends up equalling 0, which causes the seg fault. You need to use the getMesh function (remember also it returns a ptr to a IMesh, not an IAnimatedMesh.)

person icon
willikus
Guest
Quote
2007-05-12 16:40:57

Hi !
(sorry but, I writh badly the english)

So, with the new version, I would use IrrEdit.

I try all method on this topic, but I doesn't arriv....


Nobody have a small soft & code where we can use .irr with cameraFPS & collision ?

Thank for your help

person icon
Louki
Guest
Quote
2007-08-09 00:55:13

Hey I tell you what I did for C# (using irrlicht .net cp) I made the name of the nodes that I wanted to be collidable with be formed like this: "C_nameofmesh.extension" that way the C_ lets it know that it needs to be put in the metatriangleselector, and the name of the mesh is so you can load the file with GetMesh().

Then after you load the scene, you can use the RootSceneNode property and then get the children, and check their names.

More work on the editing side, but it works until theres a better solution... (another option would be to parse the irr file... but i'm not that hardcore)


Louki
http://code.google.com/p/altworldporpg/

person icon
Adam
Guest
Quote
2007-09-08 00:58:06

Hello,
Is there any way to apply the collision animator to the entire .irr scene?
To use the function createCollisionResponseAnimator() I need a selector
and to use createOctTreeTriangleSelector() I need a mesh.
Is there any way around to get a selector without accesing single meshes?

Why does not work option collisionResponse in irrEdit? How to get it working properly?

Regards
Adam


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |