Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Mesh.updateModelBound()


            recurse.set(true);
            return clone((Node) source);
        } else if (source instanceof Mesh) {
            final Mesh result = clone((Mesh) source);
            result.setMeshData(((Mesh) source).getMeshData());
            result.updateModelBound();
            return result;
        }
        return null;
    }
View Full Code Here


            GeometryTool.minimizeVerts(mesh, groupData);

            applyCurrentMaterial(mesh);
            mapToGroups(mesh);

            mesh.updateModelBound();

            _root.attachChild(mesh);
            _meshManager = null;
            _totalMeshes++;
        }
View Full Code Here

        final double requiredDistance = (maxSize / 2)
                / Math.tan(_canvas.getCanvasRenderer().getCamera().getFovY() * MathUtils.DEG_TO_RAD * 0.5);

        final Mesh multiStripMesh = createMultiStripMesh();
        multiStripMesh.setRenderState(ts);
        multiStripMesh.updateModelBound();
        multiStripMesh.setTranslation(-xSize * 0.5, -ySize * 0.5, -requiredDistance);
        _root.attachChild(multiStripMesh);

        final Mesh degenerateStripMesh = createDegenerateStripMesh();
        degenerateStripMesh.setRenderState(ts);
View Full Code Here

        multiStripMesh.setTranslation(-xSize * 0.5, -ySize * 0.5, -requiredDistance);
        _root.attachChild(multiStripMesh);

        final Mesh degenerateStripMesh = createDegenerateStripMesh();
        degenerateStripMesh.setRenderState(ts);
        degenerateStripMesh.updateModelBound();
        degenerateStripMesh.setTranslation(-xSize * 0.5, -ySize * 0.5, -requiredDistance);
        _root.attachChild(degenerateStripMesh);

        degenerateStripMesh.getSceneHints().setCullHint(CullHint.Always);

View Full Code Here

        final IndexMode[] indexModes = new IndexMode[] { IndexMode.TriangleStrip, IndexMode.TriangleStrip,
                IndexMode.Quads, IndexMode.Triangles };
        meshData.setIndexModes(indexModes);

        mesh.updateModelBound();

        _root.attachChild(mesh);
    }
}
View Full Code Here

        _lightState.setTwoSidedLighting(true);
    }

    private Mesh createFloor() {
        final Mesh floor = new Quad("Floor", 100, 100);
        floor.updateModelBound();
        // set the color to green using a single color value
        floor.setDefaultColor(ColorRGBA.GREEN);
        // move back from camera.
        floor.setTranslation(0, -5, -20);
        // rotate to point up
View Full Code Here

        globesNode.setRotation(new Quaternion().fromAngleAxis(-MathUtils.HALF_PI, Vector3.UNIT_X));
        int startX = -globesNode.getChildren().size() / 2;
        for (final Spatial s : globesNode.getChildren()) {
            final Mesh m = (Mesh) s;
            m.updateModelBound();
            startX += ((BoundingSphere) m.getModelBound(null)).getRadius() * 2;
            s.setTranslation(startX, 0, 0);
        }

        _root.attachChild(globesNode);
View Full Code Here

        teapot.setScale(20);
        teapot.updateModelBound();
        teapot.setRandomColors();

        final Mesh multiStrip = createMultiStrip();
        multiStrip.updateModelBound();
        multiStrip.setTranslation(0, 0, -30);

        originalNode = new Node("originalNode");
        originalNode.attachChild(torus);
        originalNode.attachChild(quad);
View Full Code Here

                IndexMode.Quads, IndexMode.Triangles };
        meshData.setIndexModes(indexModes);

        final WireframeState ws = new WireframeState();
        mesh.setRenderState(ws);
        mesh.updateModelBound();

        return mesh;
    }
}
View Full Code Here

            final VertMap map = GeometryTool.minimizeVerts(polyMesh, _optimizeSettings);
            _dataCache.setMeshVertMap(polyMesh, map);
        }

        // update bounds
        polyMesh.updateModelBound();

        // return
        return polyMesh;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.