use of com.ardor3d.scenegraph.hint.CullHint in project energy3d by concord-consortium.
the class Roof method setAnnotationsVisible.
@Override
public void setAnnotationsVisible(final boolean visible) {
super.setAnnotationsVisible(visible);
final CullHint cull = visible ? CullHint.Inherit : CullHint.Always;
if (roofPartsRoot != null) {
for (final Spatial roofPart : roofPartsRoot.getChildren()) {
if (roofPart.getSceneHints().getCullHint() != CullHint.Always) {
((Node) roofPart).getChild(1).getSceneHints().setCullHint(cull);
((Node) roofPart).getChild(2).getSceneHints().setCullHint(cull);
}
}
}
}
use of com.ardor3d.scenegraph.hint.CullHint in project energy3d by concord-consortium.
the class Wall method drawMesh.
@Override
protected void drawMesh() {
final boolean drawable = isDrawable();
final CullHint drawableSolidWall = drawable && type == SOLID_WALL ? CullHint.Inherit : CullHint.Always;
mesh.getSceneHints().setCullHint(drawableSolidWall);
outlineMesh.getSceneHints().setCullHint(drawableSolidWall);
final CullHint drawableSolidNoneFrozenWall = drawable && type == SOLID_WALL ? CullHint.Inherit : CullHint.Always;
backMesh.getSceneHints().setCullHint(drawableSolidNoneFrozenWall);
surroundMesh.getSceneHints().setCullHint(drawableSolidNoneFrozenWall);
windowsSurroundMesh.getSceneHints().setCullHint(drawableSolidNoneFrozenWall);
if (!drawable) {
return;
}
computeNormalAndXYTransform();
wallAndWindowsPoints = computeWallAndWindowPolygon(false);
stretchToRoof(wallAndWindowsPoints.get(0));
switch(type) {
case EMPTY:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Always);
rails.getSceneHints().setCullHint(CullHint.Always);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
break;
case VERTICAL_EDGES_ONLY:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Inherit);
rails.getSceneHints().setCullHint(CullHint.Always);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
drawVerticalEdges(columnRadius);
break;
case COLUMNS_ONLY:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Inherit);
rails.getSceneHints().setCullHint(CullHint.Always);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
drawColumns(10);
break;
case RAILS_ONLY:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Always);
rails.getSceneHints().setCullHint(CullHint.Inherit);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
drawRails(1, false);
break;
case COLUMNS_RAILS:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Inherit);
rails.getSceneHints().setCullHint(CullHint.Inherit);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
drawColumns(10);
drawRails(1, false);
break;
case FENCE:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Always);
rails.getSceneHints().setCullHint(CullHint.Inherit);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
drawRails(1, true);
break;
case STEEL_FRAME:
outlineMesh.getSceneHints().setCullHint(CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Inherit);
rails.getSceneHints().setCullHint(CullHint.Always);
steelFrame.getSceneHints().setCullHint(CullHint.Inherit);
drawVerticalEdges(1);
drawSteelFrame(0.25, 10);
break;
default:
outlineMesh.getSceneHints().setCullHint(drawable && !hideOutline ? CullHint.Inherit : CullHint.Always);
columns.getSceneHints().setCullHint(CullHint.Always);
rails.getSceneHints().setCullHint(CullHint.Always);
steelFrame.getSceneHints().setCullHint(CullHint.Always);
if (Scene.getInstance().isDrawThickness() && isShortWall) {
final Vector3 dir = getAbsPoint(2).subtract(getAbsPoint(0), null).normalizeLocal();
if (neighbors[0] != null && neighbors[0].getNeighborOf(this).isFirstPointInserted()) {
if (isPerpendicularToNeighbor(0)) {
reduceBackMeshWidth(wallAndWindowsPoints.get(0), dir, 0);
}
}
if (neighbors[1] != null && neighbors[1].getNeighborOf(this).isFirstPointInserted()) {
dir.normalizeLocal().negateLocal();
if (isPerpendicularToNeighbor(1)) {
reduceBackMeshWidth(wallAndWindowsPoints.get(0), dir, 1);
}
}
}
drawOutline(wallAndWindowsPoints);
if (isDrawBackMesh()) {
drawBackMesh(computeWallAndWindowPolygon(true));
} else {
backMesh.getSceneHints().setCullHint(CullHint.Always);
}
drawSurroundMesh(thicknessNormal);
drawWindowsSurroundMesh(thicknessNormal);
}
drawPolygon(wallAndWindowsPoints, mesh, true, true, true);
drawPolygon(wallAndWindowsPoints, invisibleMesh, false, false, false);
CollisionTreeManager.INSTANCE.removeCollisionTree(mesh);
CollisionTreeManager.INSTANCE.removeCollisionTree(invisibleMesh);
root.updateWorldBound(true);
}
use of com.ardor3d.scenegraph.hint.CullHint in project energy3d by concord-consortium.
the class HousePart method setAnnotationsVisible.
public void setAnnotationsVisible(final boolean visible) {
final CullHint cull = visible ? CullHint.Inherit : CullHint.Always;
sizeAnnotRoot.getSceneHints().setCullHint(cull);
angleAnnotRoot.getSceneHints().setCullHint(cull);
}
Aggregations