Crystal Space
Welcome, Guest. Please login or register.
November 23, 2014, 11:16:54 pm

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2046 Topics by 9099 Members
Latest Member: Basiahosa
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  MeshWrapper hierarchical structures
« previous next »
Pages: [1] Print
Author Topic: MeshWrapper hierarchical structures  (Read 887 times)
Jacek
Newbie
*
Posts: 2


View Profile Email
« on: March 05, 2010, 04:53:35 pm »

Hello,

I’m new to CS and I’m reading the manual and trying out some parts just now.
In Section 4.10.2 (Using Mesh Objects) in the User Manual I have read something about hierarchical structures of “iMeshWrapper”. I’m not sure if I have understood this part right. Are this hierarchical structures of iMeshWrapper only used for LOD? Or is it possible to represent an object, which consists of many other objects with such hierarchical structures? i.e. I would like to generate a car which consist of 3 factories (frame, wheel and steering wheel). Would it be possible to generate an iMeshWrapper “car” which contains the objects of this 3 categories? i.e.
<meshobj name=”car”>
  …
  <meshobj name=”leftWheel”>
    <params>
      <factory>Wheel</factory>
    </params>
    ….
  </meshobj>
….
</meshobj>

I could only find methods in iMeshWrapper which belongs to LOD. If it is possible to create such hierarchical structures – is there an example somewhere? I would like to use it from code …

Thanks

Best regards

Jacek
Logged
kickvb
Global Moderator
Jr. Member
*****
Posts: 79


View Profile
« Reply #1 on: August 08, 2010, 04:09:19 pm »

Sorry to answer so lately, hopefuly this can however help someone else.

You can create hierarchical structures of meshes, cameras and lights through the scene graph system. See iSceneNode and iMovable for that.

Basically, you simply need to call something like:

Code:
childMesh->QuerySceneNode ()->SetParent (parentMesh->QuerySceneNode ());
Then the relative position of the nodes will be automatically kept constant. The sectors of the child node will also be updated when the parent is added/removed from a sector.

It seems that the XML loader cannot handle that, although this feature should not be hard to add.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.256 seconds with 15 queries.