Search in sources :

Example 1 with JmeGen

use of org.twak.tweed.gen.JmeGen in project chordatlas by twak.

the class SkelGen method calculate.

@Override
public void calculate() {
    for (Spatial s : gNode.getChildren()) s.removeFromParent();
    Node pNode = new Node();
    if (toRender != null)
        for (int i = 0; i < toRender.faces.size(); i++) try {
            HalfFace f = toRender.faces.get(i);
            SuperFace sf = (SuperFace) f;
            PlanSkeleton skel = calc(sf);
            if (skel != null)
                setSkel(skel, skel.output, sf);
        } catch (Throwable th) {
            th.printStackTrace();
        }
    if (!pNode.getChildren().isEmpty())
        tweed.frame.addGen(new JmeGen("sProfs", tweed, pNode), false);
    gNode.updateModelBound();
    gNode.updateGeometricState();
    super.calculate();
}
Also used : PlanSkeleton(org.twak.siteplan.campskeleton.PlanSkeleton) Spatial(com.jme3.scene.Spatial) Node(com.jme3.scene.Node) HalfFace(org.twak.utils.geom.HalfMesh2.HalfFace) JmeGen(org.twak.tweed.gen.JmeGen) SuperFace(org.twak.tweed.gen.SuperFace)

Aggregations

Node (com.jme3.scene.Node)1 Spatial (com.jme3.scene.Spatial)1 PlanSkeleton (org.twak.siteplan.campskeleton.PlanSkeleton)1 JmeGen (org.twak.tweed.gen.JmeGen)1 SuperFace (org.twak.tweed.gen.SuperFace)1 HalfFace (org.twak.utils.geom.HalfMesh2.HalfFace)1