Horde3D

Next-Generation Graphics Engine
It is currently 29.09.2024, 16:37

All times are UTC + 1 hour




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Horde3D and ODE
PostPosted: 14.12.2008, 13:46 
Offline

Joined: 13.12.2008, 17:43
Posts: 6
Hello everyone!
I have the following question:
I want to use ODE for simulating my physics. Since there is a possibility to load mesh data into ODE, I want to access the my resource data from Horde3D and pass it to ODE so that it can do its magic with it.
I don't know if a lot of people have experiencein doing that but would that be the right approach of doing this?
My other question is:
If I use the functions

Code:
const void* data = Horde3D::getResourceData(modelRes, GeometryResParams::VertexData);


and

Code:
int size = Horde3D::getResourceParami(modelRes, GeometryResParams::VertexCount);


the returned values are always 0. I debugged into the library and found that I always reach this point in the Horde lib:

Code:
int Resource::getParami( int /*param*/ )
{
   return 0;
}


Before doing that I loaded the resources properly and if I query whether it's been loaded true is being returned. I can also use it with Horde and display everything just fine. Only accessing the resource data and it's properties seems to go wrong.

Does anybody have a suggestion what I'm doing wrong?

Thanks in advance


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 14.12.2008, 19:17 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
The model does not have geometry data itself. So you have to call getResourceData on the geometry resource handle not on the model resource (what I guess is the scene graph resource in your case).


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 14.12.2008, 23:08 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Please check also Voker's Bullet integration sample that is linked on the downloads site.


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 15.12.2008, 11:34 
Offline

Joined: 13.12.2008, 17:43
Posts: 6
Wicked!
Thanks, it works now


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 13:44 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
Volker wrote:
The model does not have geometry data itself. So you have to call getResourceData on the geometry resource handle not on the model resource (what I guess is the scene graph resource in your case).


how do you acces the geometry resource handle for a given scene graph resource?

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 14:20 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Did you tried
Code:
Horde3D::getResourceParami( sceneGraphHandle, ModelNodeParams::GeometryRes );
?


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 15:36 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
yes... but it returns 0

this the code
Code:
ResHandle podRes = Horde3D::addResource(ResourceTypes::SceneGraph, "models/pod/pod.scene.xml", 0 );
Horde3DUtils::loadResourcesFromDisk( _contentDir.c_str() );
NodeHandle pod = Horde3D::addNodes(RootNode, podRes);

int v = Horde3D::getResourceParami(Horde3D::getResourceParami( pod, ModelNodeParams::GeometryRes ) , GeometryResParams::VertexCount);

i've tryed with both the node and the res handle, but still it yields 0. the actual piece of geometry draws fine.

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 15:41 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
pod is not a resource. You have to use podRes. Did you tried to debug into it? Could the resouce be loaded? Are there any errors in the log?


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 15:54 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
i have tryed with both of them (pod and podRes), thinking i understood it wrong. in both cases v = 0

i know v's value by placing a breakpoint after the code i've posted earlyer and placed the variable in watch. the resource is loaded (podRes is not null and there aren't any errors in the log. plus i know it is loaded because i can see the model when i run the app without debugging)

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 17:02 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Does
Code:
Horde3D::getResourceParami( podRes, ModelNodeParams::GeometryRes )

return a valid resource handle?
If not the problem must be somewhere in the geometry data resolving code. If yes, the problem must be in the vertex count.

Do you use LODs? Maybe there is still a bug somewhere. I currently don't have a running example on this computer so I can't digg into it further.


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 17:11 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
The returned ResHandle is equal to 0. This is werid as podRes is not null.

The code is added to the chicago sample. I haven't added LODs.

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 17:15 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Well podRes is only the scene graph resource, that does not mean necessarily, that the scene graph has also a valid geometry resource, although it should have one, if you can see your model. I will have a look at it this evening.


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 17:22 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
thanks for the assistance. i'm looking forward for your next reply

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 19.03.2009, 18:43 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
well I should have think about it before answering.
ModelNodeParam is a param that can be requested only for nodes (that's why it is called ModelNode and not ModelRes). Therefore the correct solution should be

Code:
   ResHandle geoRes = Horde3D::getNodeParami( pod, ModelNodeParams::GeometryRes );
   int v = Horde3D::getResourceParami( geoRes, GeometryResParams::VertexCount );


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D and ODE
PostPosted: 20.03.2009, 00:04 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
thanks for the solution :)

_________________
Paul


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 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