Horde3D

Next-Generation Graphics Engine
It is currently 24.11.2024, 20:45

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 23.01.2012, 15:19 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
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


Top
 Profile  
Reply with quote  
PostPosted: 23.01.2012, 19:36 
Offline

Joined: 23.07.2009, 21:03
Posts: 51
Location: Germany
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 );


Top
 Profile  
Reply with quote  
PostPosted: 25.01.2012, 14:34 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
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.


Top
 Profile  
Reply with quote  
PostPosted: 27.01.2012, 06:44 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group