Horde3D
http://www.horde3d.org/forums/

Problem Using h3dGetNodeAABB
http://www.horde3d.org/forums/viewtopic.php?f=2&t=1630
Page 1 of 1

Author:  imranhabib [ 23.01.2012, 15:19 ]
Post subject:  Problem Using h3dGetNodeAABB

Helloo ! I am using this function for getting bounding box of an obstacle or an entity
i have a handle to my crate3 and this function takes the handle of the entity and
gives you bounding box values in x , y , z dimensions minX, minY, minZ , maxX maxY, maxZ.
For my crate3 i get the bounding box of crate1, which is wrong, when I need bounding box
values of crate1 then I get 0 in all minX, minY, minZ , maxX maxY, maxZ.. I don't know why

Code:
  crat1 = GameEngine::entityWorldID("crate1");
  float minX,minY,minZ,maxX,maxY,maxZ;
  h3dGetNodeAABB(crat1,&minX,&minY,&minZ,&maxX,&maxY,&maxZ);

i don't understand why this is happening that
1. Firstly it is giving me wrong entities bounding box values
2. Why it doesnt give me value for another entity why it gives 0
I am 100% sure that my every entity has a unique id

Author:  Roland [ 23.01.2012, 19:36 ]
Post subject:  Re: Problem Using h3dGetNodeAABB

Hi.
You have to keep in mind that Horde IDs are not the same as GameEngine IDs.
GameEngine::entityWorldID() returns a GameEngine entity ID, not a Horde3D ID (which h3dGetNodeAABB() expects).

Your results are mere coincidence, most likely because of the GameEngine ID of "crate3" being the same value as the Horde ID of "crate1".

A possible solution would be:

Code:
H3DNode myObjectsHordeID = GameEngine::entitySceneGraphID( GameEngine::entityWorldID("crate1") );
float minX,minY,minZ,maxX,maxY,maxZ;
h3dGetNodeAABB( myObjectsHordeID, &minX, &minY, &minZ, &maxX, &maxY, &maxZ );

Author:  imranhabib [ 25.01.2012, 14:34 ]
Post subject:  Re: Problem Using h3dGetNodeAABB

Roland wrote:
Hi.
You have to keep in mind that Horde IDs are not the same as GameEngine IDs.
GameEngine::entityWorldID() returns a GameEngine entity ID, not a Horde3D ID (which h3dGetNodeAABB() expects).

Your results are mere coincidence, most likely because of the GameEngine ID of "crate3" being the same value as the Horde ID of "crate1".

A possible solution would be:

Code:
H3DNode myObjectsHordeID = GameEngine::entitySceneGraphID( GameEngine::entityWorldID("crate1") );
float minX,minY,minZ,maxX,maxY,maxZ;
h3dGetNodeAABB( myObjectsHordeID, &minX, &minY, &minZ, &maxX, &maxY, &maxZ );

Helloo !

Thank You so much

It works but i have one more problem related to it.
It works for the crates that were provided already in SVN but I have other objects that i created in
3D max. I exported them from 3D max and then converted them by Collada converter and then used
them in Horde3d SceneEditor what will be the case for them. I tried following.

Code:
 H3DNode OBS4 = GameEngine::entitySceneGraphID (GameEngine::entityWorldID("FrontWallLab"));


but it gives me an Error at the run time. It says

Code:
 
Invalid allocation size 4294967295

****Edit***
On debugging I found that I have a value -858993460
which is think is different then other entities that I have from SVN e.g crates.

Author:  imranhabib [ 27.01.2012, 06:44 ]
Post subject:  Re: Problem Using h3dGetNodeAABB

imranhabib wrote:
Roland wrote:
Hi.
You have to keep in mind that Horde IDs are not the same as GameEngine IDs.
GameEngine::entityWorldID() returns a GameEngine entity ID, not a Horde3D ID (which h3dGetNodeAABB() expects).

Your results are mere coincidence, most likely because of the GameEngine ID of "crate3" being the same value as the Horde ID of "crate1".

A possible solution would be:

Code:
H3DNode myObjectsHordeID = GameEngine::entitySceneGraphID( GameEngine::entityWorldID("crate1") );
float minX,minY,minZ,maxX,maxY,maxZ;
h3dGetNodeAABB( myObjectsHordeID, &minX, &minY, &minZ, &maxX, &maxY, &maxZ );

Helloo !

Thank You so much

It works but i have one more problem related to it.
It works for the crates that were provided already in SVN but I have other objects that i created in
3D max. I exported them from 3D max and then converted them by Collada converter and then used
them in Horde3d SceneEditor what will be the case for them. I tried following.

Code:
 H3DNode OBS4 = GameEngine::entitySceneGraphID (GameEngine::entityWorldID("FrontWallLab"));


but it gives me an Error at the run time. It says

Code:
 
Invalid allocation size 4294967295

****Edit***
On debugging I found that I have a value -858993460
which is think is different then other entities that I have from SVN e.g crates.


I solved it myself.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/