/** * Set the texture to be displayed on the given face of the skybox. Replaces any existing texture on that face. * * @param face * the face to set * @param texture * The texture for that side to assume. * @throws IllegalArgumentException * if face is null. */ public void setTexture(final Face face, final Texture texture) { if (face == null) { throw new IllegalArgumentException("Face can not be null."); } _skyboxQuads[face.ordinal()].clearRenderState(RenderState.StateType.Texture); setTexture(face, texture, 0); }
_skyboxQuads[Face.North.ordinal()] = new Quad("north", _xExtent * 2, _yExtent * 2); _skyboxQuads[Face.North.ordinal()].setRotation(new Matrix3().fromAngles(0, Math.toRadians(180), 0)); _skyboxQuads[Face.North.ordinal()].setTranslation(new Vector3(0, 0, _zExtent)); _skyboxQuads[Face.South.ordinal()] = new Quad("south", _xExtent * 2, _yExtent * 2); _skyboxQuads[Face.South.ordinal()].setTranslation(new Vector3(0, 0, -_zExtent)); _skyboxQuads[Face.East.ordinal()] = new Quad("east", _zExtent * 2, _yExtent * 2); _skyboxQuads[Face.East.ordinal()].setRotation(new Matrix3().fromAngles(0, Math.toRadians(90), 0)); _skyboxQuads[Face.East.ordinal()].setTranslation(new Vector3(-_xExtent, 0, 0)); _skyboxQuads[Face.West.ordinal()] = new Quad("west", _zExtent * 2, _yExtent * 2); _skyboxQuads[Face.West.ordinal()].setRotation(new Matrix3().fromAngles(0, Math.toRadians(270), 0)); _skyboxQuads[Face.West.ordinal()].setTranslation(new Vector3(_xExtent, 0, 0)); _skyboxQuads[Face.Up.ordinal()] = new Quad("up", _xExtent * 2, _zExtent * 2); _skyboxQuads[Face.Up.ordinal()] .setRotation(new Matrix3().fromAngles(Math.toRadians(90), Math.toRadians(270), 0)); _skyboxQuads[Face.Up.ordinal()].setTranslation(new Vector3(0, _yExtent, 0)); _skyboxQuads[Face.Down.ordinal()] = new Quad("down", _xExtent * 2, _zExtent * 2); _skyboxQuads[Face.Down.ordinal()].setRotation(new Matrix3().fromAngles(Math.toRadians(270), Math.toRadians(270), 0)); _skyboxQuads[Face.Down.ordinal()].setTranslation(new Vector3(0, -_yExtent, 0));
_skyboxQuads[Face.North.ordinal()] = new Quad("north", _xExtent * 2, _yExtent * 2); _skyboxQuads[Face.North.ordinal()].setRotation(new Matrix3().fromAngles(0, Math.toRadians(180), 0)); _skyboxQuads[Face.North.ordinal()].setTranslation(new Vector3(0, 0, _zExtent)); _skyboxQuads[Face.South.ordinal()] = new Quad("south", _xExtent * 2, _yExtent * 2); _skyboxQuads[Face.South.ordinal()].setTranslation(new Vector3(0, 0, -_zExtent)); _skyboxQuads[Face.East.ordinal()] = new Quad("east", _zExtent * 2, _yExtent * 2); _skyboxQuads[Face.East.ordinal()].setRotation(new Matrix3().fromAngles(0, Math.toRadians(90), 0)); _skyboxQuads[Face.East.ordinal()].setTranslation(new Vector3(-_xExtent, 0, 0)); _skyboxQuads[Face.West.ordinal()] = new Quad("west", _zExtent * 2, _yExtent * 2); _skyboxQuads[Face.West.ordinal()].setRotation(new Matrix3().fromAngles(0, Math.toRadians(270), 0)); _skyboxQuads[Face.West.ordinal()].setTranslation(new Vector3(_xExtent, 0, 0)); _skyboxQuads[Face.Up.ordinal()] = new Quad("up", _xExtent * 2, _zExtent * 2); _skyboxQuads[Face.Up.ordinal()] .setRotation(new Matrix3().fromAngles(Math.toRadians(90), Math.toRadians(270), 0)); _skyboxQuads[Face.Up.ordinal()].setTranslation(new Vector3(0, _yExtent, 0)); _skyboxQuads[Face.Down.ordinal()] = new Quad("down", _xExtent * 2, _zExtent * 2); _skyboxQuads[Face.Down.ordinal()] .setRotation(new Matrix3().fromAngles(Math.toRadians(270), Math.toRadians(270), 0)); _skyboxQuads[Face.Down.ordinal()].setTranslation(new Vector3(0, -_yExtent, 0));
/** * Set the texture to be displayed on the given side of the skybox. Only replaces the texture at the index specified * by textureUnit. * * @param face * the face to set * @param texture * The texture for that side to assume. * @param textureUnit * The texture unite of the given side's TextureState the texture will assume. */ public void setTexture(final Face face, final Texture texture, final int textureUnit) { // Validate if (face == null) { throw new IllegalArgumentException("Face can not be null."); } TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); } // Initialize the texture state ts.setTexture(texture, textureUnit); ts.setEnabled(true); texture.setWrap(WrapMode.EdgeClamp); // Set the texture to the quad _skyboxQuads[face.ordinal()].setRenderState(ts); return; }
/** * Set the texture to be displayed on the given side of the skybox. Only replaces the texture at the index specified * by textureUnit. * * @param face * the face to set * @param texture * The texture for that side to assume. * @param textureUnit * The texture unite of the given side's TextureState the texture will assume. */ public void setTexture(final Face face, final Texture texture, final int textureUnit) { // Validate if (face == null) { throw new IllegalArgumentException("Face can not be null."); } TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts == null) { ts = new TextureState(); } // Initialize the texture state ts.setTexture(texture, textureUnit); ts.setEnabled(true); texture.setWrap(WrapMode.EdgeClamp); // Set the texture to the quad _skyboxQuads[face.ordinal()].setRenderState(ts); return; }
/** * Set the texture to be displayed on the given face of the skybox. Replaces any existing texture on that face. * * @param face * the face to set * @param texture * The texture for that side to assume. * @throws IllegalArgumentException * if face is null. */ public void setTexture(final Face face, final Texture texture) { if (face == null) { throw new IllegalArgumentException("Face can not be null."); } _skyboxQuads[face.ordinal()].clearRenderState(RenderState.StateType.Texture); setTexture(face, texture, 0); }
/** * Retrieve the quad indicated by the given side. * * @param face * One of Skybox.Face.North, Skybox.Face.South, and so on... * @return The Quad that makes up that side of the Skybox. */ public Quad getFace(final Face face) { return _skyboxQuads[face.ordinal()]; }
/** * Retrieve the quad indicated by the given side. * * @param face * One of Skybox.Face.North, Skybox.Face.South, and so on... * @return The Quad that makes up that side of the Skybox. */ public Quad getFace(final Face face) { return _skyboxQuads[face.ordinal()]; }
public Texture getTexture(final Face face) { if (face == null) { throw new IllegalArgumentException("Face can not be null."); } return ((TextureState) _skyboxQuads[face.ordinal()].getLocalRenderState(RenderState.StateType.Texture)) .getTexture(); }
public void preloadTexture(final Face face, final Renderer r) { final TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts != null) { r.applyState(StateType.Texture, ts); } }
public Texture getTexture(final Face face) { if (face == null) { throw new IllegalArgumentException("Face can not be null."); } return ((TextureState) _skyboxQuads[face.ordinal()].getLocalRenderState(RenderState.StateType.Texture)) .getTexture(); }
public void preloadTexture(final Face face, final Renderer r) { final TextureState ts = (TextureState) _skyboxQuads[face.ordinal()] .getLocalRenderState(RenderState.StateType.Texture); if (ts != null) { r.applyState(StateType.Texture, ts); } }