Difference between node, trimesh and spatial

What makes an .obj becomes a node, a trimesh or a spatial?

the converter

From the code in ObjToJme:


    private Spatial buildStructure() {
        Node toReturn = new Node("obj file");
 ...
        return toReturn;
}



So it should always return a Node, which is always a Spatial. for convenience, since some other concerter could return a TriMesh instead of a Node (due to internal hierarchy), it is better to expect always a Spatial.

sorry for not answering before.

But I want to known what makes a converter to define a mesh as trimesh, spatial or node.

You should better Look for the Depency of Spatial Trimesh and Node.

Because TriMesh and Node are always also Spatials. So You can use all SpatialThings.



Thats not so Complicated like it rings.

Because A Node is Only a SpatialList (.getChildren returns an ArrayList)

in this List all importet Objects are inside.



when you now want direktly call a Trimesh. You have to ask with instanceof for example these Objects, and when you find a Node then you should call their children again.



But I wouldn't import many Trimeshs not with one import. Better import every Trimesh you want to use extra, also to import extra.

So it would't matter what object this is



hope that helped



(If You want to know more about this principle have a look for Keywords "SceneGraph" and "Composite Pattern")