public void generateDebugTangents(Material mat) { for (int x = children.size(); --x >= 0;) { Spatial child = children.get(x); if (child instanceof TerrainQuad) { ((TerrainQuad)child).generateDebugTangents(mat); } else if (child instanceof TerrainPatch) { Geometry debug = new Geometry( "Debug " + name, TangentBinormalGenerator.genTbnLines( ((TerrainPatch)child).getMesh(), 0.8f)); attachChild(debug); debug.setLocalTranslation(child.getLocalTranslation()); debug.setCullHint(CullHint.Never); debug.setMaterial(mat); } } }
quad1.setLocalTranslation(origin1); quad1.quadrant = 1; this.attachChild(quad1); quad2.setLocalTranslation(origin2); quad2.quadrant = 2; this.attachChild(quad2); quad3.setLocalTranslation(origin3); quad3.quadrant = 3; this.attachChild(quad3); quad4.setLocalTranslation(origin4); quad4.quadrant = 4; this.attachChild(quad4);
offsetAmount); patch1.setQuadrant((short) 1); this.attachChild(patch1); patch1.setModelBound(new BoundingBox()); patch1.updateModelBound(); offsetAmount); patch2.setQuadrant((short) 2); this.attachChild(patch2); patch2.setModelBound(new BoundingBox()); patch2.updateModelBound(); offsetAmount); patch3.setQuadrant((short) 3); this.attachChild(patch3); patch3.setModelBound(new BoundingBox()); patch3.updateModelBound(); offsetAmount); patch4.setQuadrant((short) 4); this.attachChild(patch4); patch4.setModelBound(new BoundingBox()); patch4.updateModelBound();
public void generateDebugTangents(Material mat) { for (int x = children.size(); --x >= 0;) { Spatial child = children.get(x); if (child instanceof TerrainQuad) { ((TerrainQuad)child).generateDebugTangents(mat); } else if (child instanceof TerrainPatch) { Geometry debug = new Geometry( "Debug " + name, TangentBinormalGenerator.genTbnLines( ((TerrainPatch)child).getMesh(), 0.8f)); attachChild(debug); debug.setLocalTranslation(child.getLocalTranslation()); debug.setCullHint(CullHint.Never); debug.setMaterial(mat); } } }
quad1.setLocalTranslation(origin1); quad1.quadrant = 1; this.attachChild(quad1); quad2.setLocalTranslation(origin2); quad2.quadrant = 2; this.attachChild(quad2); quad3.setLocalTranslation(origin3); quad3.quadrant = 3; this.attachChild(quad3); quad4.setLocalTranslation(origin4); quad4.quadrant = 4; this.attachChild(quad4);
offsetAmount); patch1.setQuadrant((short) 1); this.attachChild(patch1); patch1.setModelBound(new BoundingBox()); patch1.updateModelBound(); offsetAmount); patch2.setQuadrant((short) 2); this.attachChild(patch2); patch2.setModelBound(new BoundingBox()); patch2.updateModelBound(); offsetAmount); patch3.setQuadrant((short) 3); this.attachChild(patch3); patch3.setModelBound(new BoundingBox()); patch3.updateModelBound(); offsetAmount); patch4.setQuadrant((short) 4); this.attachChild(patch4); patch4.setModelBound(new BoundingBox()); patch4.updateModelBound();