Horde3D
http://horde3d.org/forums/

Newbie attach node question.
http://horde3d.org/forums/viewtopic.php?f=2&t=173
Page 1 of 1

Author:  eddie [ 08.10.2007, 16:57 ]
Post subject:  Newbie attach node question.

So I am still trying to grasp this concept properly.

"To overcome these problems Horde3D offers a special Integration Library. With version 0.11 Horde introduces the concept of node attachments. An attachment is a derived class that you can attach to Horde scene graph nodes and which can contain all your game specific data. The key point is that this class is handled by Horde when updating the scene graph which means that you get a notification when a child or parent node is transformed. This concept makes it easy to let the graphics engine interact with e.g. a physics engine and enables you to store game specific semantics and meta data directly with the graphics objects."

So if I make an Eddie Monster class,
Do I derive it from the addNodes class? and how do have Horde update it properly? And how would I use attach node ? The only reason I am sweating this is I think I should do it right so it is as fast as possible.

Author:  marciano [ 08.10.2007, 21:04 ]
Post subject: 

There is no single "best" way to integrate a graphics engine with a game framework. The way presented is just one possibility. Actually the idea is quite simple: You derive your game entity classes from the NodeAttachment class and attach them to the scene graph with the NodeAttachment constructor. What happens is that Horde will call the onUpdate function of your entity when the scene node to which the entity is attached is transformed e.g. by an animation.

Another very practical thing is that you can store additional meta-information for your game (e.g. the health of a character, physics properties, etc.) in the scene graph files. The static function NodeAttachment::setFactory lets you specify a callback function which gives you that additional data. This is useful when you don't want to create your own world format, but of course you are not forced to use the meta data system.

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