use of com.ardor3d.bounding.BoundingBox in project energy3d by concord-consortium.
the class Door method init.
@Override
protected void init() {
super.init();
if (Util.isZero(uValue)) {
uValue = 2;
}
if (Util.isZero(volumetricHeatCapacity)) {
volumetricHeatCapacity = 0.5;
}
mesh = new Mesh("Door");
mesh.getMeshData().setIndexMode(IndexMode.TriangleStrip);
mesh.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(4));
mesh.getMeshData().setNormalBuffer(BufferUtils.createVector3Buffer(4));
mesh.getMeshData().setTextureBuffer(BufferUtils.createVector2Buffer(4), 0);
updateTextureAndColor();
mesh.setModelBound(new BoundingBox());
mesh.setUserData(new UserData(this));
root.attachChild(mesh);
outlineMesh = new Line("Door (Outline)");
outlineMesh.setLineWidth(2);
outlineMesh.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(6 + 2 * 4));
outlineMesh.setDefaultColor(ColorRGBA.BLACK);
outlineMesh.setModelBound(new BoundingBox());
Util.disablePickShadowLight(outlineMesh);
root.attachChild(outlineMesh);
}
use of com.ardor3d.bounding.BoundingBox in project energy3d by concord-consortium.
the class Floor method init.
@Override
protected void init() {
super.init();
mesh = new Mesh("Floor");
root.attachChild(mesh);
mesh.getMeshData().setIndexMode(IndexMode.TriangleStrip);
mesh.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(4));
mesh.setModelBound(new BoundingBox());
mesh.setRenderState(offsetState);
outlineMesh = new Line("Floor (Outline)");
outlineMesh.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(8));
outlineMesh.setDefaultColor(ColorRGBA.BLACK);
outlineMesh.setModelBound(new BoundingBox());
Util.disablePickShadowLight(outlineMesh);
/* no need to attach because floor outline is only need in print preview */
updateTextureAndColor();
mesh.setUserData(new UserData(this));
}
use of com.ardor3d.bounding.BoundingBox in project energy3d by concord-consortium.
the class HousePart method addNewEditPointShape.
private void addNewEditPointShape(final int i) {
final Sphere pointShape = new Sphere("Point", Vector3.ZERO, 8, 8, this instanceof SolarCollector ? 0.05 : 0.1);
pointShape.setUserData(new UserData(this, i, true));
// important
pointShape.updateModelBound();
pointShape.setVisible(false);
pointShape.getSceneHints().setLightCombineMode(LightCombineMode.Off);
pointShape.getSceneHints().setCastsShadows(false);
pointShape.setModelBound(new BoundingBox());
pointsRoot.attachChild(pointShape);
}
use of com.ardor3d.bounding.BoundingBox in project energy3d by concord-consortium.
the class Human method init.
@Override
protected void init() {
super.init();
final double h;
final double w;
switch(humanType) {
case JANE:
w = 2.5;
h = 8;
break;
case JENI:
w = 3;
h = 9;
break;
case JILL:
w = 3;
h = 8;
break;
case JACK:
w = 2.8;
h = 9;
break;
case JOHN:
w = 4;
h = 10;
break;
case JOSE:
w = 8;
h = 8;
break;
default:
w = 2.5;
h = 8;
}
mesh = new Quad("Human Quad", w, h);
mesh.setModelBound(new BoundingBox());
mesh.updateModelBound();
mesh.setRotation(new Matrix3().fromAngles(Math.PI / 2, 0, 0));
// stand on the ground by default
translate(w, h, feetHeight);
mesh.setUserData(new UserData(this, 0, true));
final BlendState bs = new BlendState();
bs.setEnabled(true);
bs.setBlendEnabled(false);
bs.setTestEnabled(true);
bs.setTestFunction(TestFunction.GreaterThan);
bs.setReference(0.7f);
mesh.setRenderState(bs);
mesh.getSceneHints().setRenderBucketType(RenderBucketType.Transparent);
billboard = new BillboardNode("Billboard");
billboard.setAlignment(BillboardAlignment.AxialZ);
billboard.attachChild(mesh);
root.attachChild(billboard);
updateTextureAndColor();
}
use of com.ardor3d.bounding.BoundingBox in project energy3d by concord-consortium.
the class FresnelReflector method addPole.
private void addPole(final Vector3 position, final double poleHeight, final double baseZ) {
final Cylinder pole = new Cylinder("Pole Cylinder", 2, detailed ? 10 : 2, 10, 0);
pole.setRadius(0.6);
pole.setRenderState(offsetState);
// slightly shorter so that the pole won't penetrate the surface of the reflector
pole.setHeight(poleHeight - 0.5 * pole.getRadius());
pole.setModelBound(new BoundingBox());
pole.updateModelBound();
position.setZ(baseZ + pole.getHeight() / 2);
pole.setTranslation(position);
modulesRoot.attachChild(pole);
}
Aggregations