Package javax.vecmath

Examples of javax.vecmath.Vector4f


/*     */   public void writeVector4f(DataOutput out, Vector4f vec) throws IOException {
/* 750 */     writeTuple4f(out, vec);
/*     */   }
/*     */
/*     */   public Vector4f readVector4f(DataInput in) throws IOException {
/* 754 */     return (Vector4f)readTuple4f(in, new Vector4f());
/*     */   }
View Full Code Here


/*    */   }
/*    */
/*    */   public void writeObject(DataOutput out) throws IOException {
/* 58 */     super.writeObject(out);
/* 59 */     TexCoordGeneration attr = (TexCoordGeneration)this.node;
/* 60 */     Vector4f vec = new Vector4f();
/* 61 */     out.writeBoolean(attr.getEnable());
/* 62 */     out.writeInt(attr.getFormat());
/* 63 */     out.writeInt(attr.getGenMode());
/* 64 */     attr.getPlaneR(vec);
/* 65 */     this.control.writeVector4f(out, vec);
View Full Code Here

        if (CoreRegistry.get(Config.class).getRendering().isInscattering()) {
            GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
            DefaultRenderingProcess.getInstance().bindFboTexture("sceneSkyBand1");
            program.setInt("texSceneSkyBand", texId++, true);

            Vector4f skyInscatteringSettingsFrag = new Vector4f();
            skyInscatteringSettingsFrag.y = skyInscatteringStrength;
            skyInscatteringSettingsFrag.z = skyInscatteringLength;
            skyInscatteringSettingsFrag.w = skyInscatteringThreshold;
            program.setFloat4("skyInscatteringSettingsFrag", skyInscatteringSettingsFrag, true);
        }
View Full Code Here

    }

    private void initialize(Vector2f effectsTextureWidth) {
        Vector2f texPos = new Vector2f(0.0f, 0.0f);
        Tessellator tessellator = new Tessellator();
        TessellatorHelper.addBlockMesh(tessellator, new Vector4f(1, 1, 1, 1f), texPos, effectsTextureWidth, 1.001f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f);
        overlayMesh = tessellator.generateMesh();
        tessellator = new Tessellator();
        TessellatorHelper.addBlockMesh(tessellator, new Vector4f(1, 1, 1, .2f), texPos, effectsTextureWidth, 1.001f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f);
        overlayMesh2 = tessellator.generateMesh();
        defaultTextured = Assets.getMaterial("engine:prog.defaultTextured");
    }
View Full Code Here

                glBindTexture(GL11.GL_TEXTURE_2D, terrainHeight.getId());
                program.setInt("textureAtlasHeight", texId++, true);
            }
        }

        Vector4f lightingSettingsFrag = new Vector4f();
        lightingSettingsFrag.z = waterSpecExp;
        program.setFloat4("lightingSettingsFrag", lightingSettingsFrag, true);

        Vector4f waterSettingsFrag = new Vector4f();
        waterSettingsFrag.x = waterNormalBias;
        waterSettingsFrag.y = waterRefraction;
        waterSettingsFrag.z = waterFresnelBias;
        waterSettingsFrag.w = waterFresnelPow;
        program.setFloat4("waterSettingsFrag", waterSettingsFrag, true);

        Vector4f alternativeWaterSettingsFrag = new Vector4f();
        alternativeWaterSettingsFrag.x = waterTint;
        program.setFloat4("alternativeWaterSettingsFrag", alternativeWaterSettingsFrag, true);

        if (CoreRegistry.get(Config.class).getRendering().isAnimateWater()) {
            program.setFloat("waveIntensFalloff", waveIntensFalloff, true);
View Full Code Here

    @Override
    public Vector4f deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        if (json.isJsonArray()) {
            JsonArray array = json.getAsJsonArray();
            if (array.size() == 4) {
                return new Vector4f(array.get(0).getAsFloat(), array.get(1).getAsFloat(), array.get(2).getAsFloat(), array.get(3).getAsFloat());
            } else if (array.size() == 3) {
                return new Vector4f(array.get(0).getAsFloat(), array.get(1).getAsFloat(), array.get(2).getAsFloat(), 1);
            }
        }
        return null;
    }
View Full Code Here

    public void initialise() {
        Vector2f texPos = new Vector2f(40.0f * 0.015625f, 32.0f * 0.03125f);
        Vector2f texWidth = new Vector2f(4.0f * 0.015625f, -12.0f * 0.03125f);

        Tessellator tessellator = new Tessellator();
        TessellatorHelper.addBlockMesh(tessellator, new Vector4f(1, 1, 1, 1), texPos, texWidth, 1.0f, 1.0f, 0.9f, 0.0f, 0.0f, 0.0f);
        handMesh = tessellator.generateMesh();
        handTex = Assets.getTexture("engine:char");
    }
View Full Code Here

    }

    protected void renderParticle(Particle particle, Block block, Biome biome, float light) {
        Material mat = Assets.getMaterial("engine:prog.particle");

        Vector4f colorMod = block.calcColorOffsetFor(BlockPart.FRONT, biome);
        mat.setFloat4("colorOffset", particle.color.x * colorMod.x, particle.color.y * colorMod.y, particle.color.z * colorMod.z, particle.color.w * colorMod.w, true);

        mat.setFloat2("texOffset", particle.texOffset.x, particle.texOffset.y, true);
        mat.setFloat2("texScale", particle.texSize.x, particle.texSize.y, true);
        mat.setFloat("light", light, true);
View Full Code Here

public class Vector4fCopyStrategy implements CopyStrategy<Vector4f> {

    @Override
    public Vector4f copy(Vector4f value) {
        if (value != null) {
            return new Vector4f(value);
        }
        return null;
    }
View Full Code Here

        if (block.isDoubleSided()) {
            renderType = ChunkMesh.RenderType.BILLBOARD;
        }

        if (blockAppearance.getPart(BlockPart.CENTER) != null) {
            Vector4f colorOffset = block.calcColorOffsetFor(BlockPart.CENTER, biome);
            blockAppearance.getPart(BlockPart.CENTER).appendTo(mesh, x, y, z, colorOffset, renderType, vertexFlag);
        }

        boolean[] drawDir = new boolean[6];

        for (Side side : Side.values()) {
            drawDir[side.ordinal()] = blockAppearance.getPart(BlockPart.fromSide(side)) != null && isSideVisibleForBlockTypes(adjacentBlocks.get(side), block, side);
        }

        // If the block is lowered, some more faces may have to be drawn
        if (block.isLiquid()) {
            Block bottomBlock = adjacentBlocks.get(Side.BOTTOM);
            // Draw horizontal sides if visible from below
            for (Side side : Side.horizontalSides()) {
                Vector3i offset = side.getVector3i();
                Block adjacentBelow = view.getBlock(x + offset.x, y - 1, z + offset.z);
                Block adjacent = adjacentBlocks.get(side);

                boolean visible = (blockAppearance.getPart(BlockPart.fromSide(side)) != null
                        && isSideVisibleForBlockTypes(adjacentBelow, block, side) && !isSideVisibleForBlockTypes(bottomBlock, adjacent, side.reverse()));
                drawDir[side.ordinal()] |= visible;
            }

            // Draw the top if below a non-lowered block
            // TODO: Don't need to render the top if each side and the block above each side are either liquid or opaque solids.
            Block blockToCheck = adjacentBlocks.get(Side.TOP);
            drawDir[Side.TOP.ordinal()] |= !blockToCheck.isLiquid();

            if (bottomBlock.isLiquid() || bottomBlock.isInvisible()) {
                for (Side dir : Side.values()) {
                    if (drawDir[dir.ordinal()]) {
                        Vector4f colorOffset = block.calcColorOffsetFor(BlockPart.fromSide(dir), biome);
                        block.getLoweredLiquidMesh(dir).appendTo(mesh, x, y, z, colorOffset, renderType, vertexFlag);
                    }
                }
                return;
            }
        }

        for (Side dir : Side.values()) {
            if (drawDir[dir.ordinal()]) {
                Vector4f colorOffset = block.calcColorOffsetFor(BlockPart.fromSide(dir), biome);
                // TODO: Needs review since the new per-vertex flags introduce a lot of special scenarios - probably a per-side setting?
                if (block.isGrass() && dir != Side.TOP && dir != Side.BOTTOM) {
                    blockAppearance.getPart(BlockPart.fromSide(dir)).appendTo(mesh, x, y, z, colorOffset, renderType, ChunkVertexFlag.COLOR_MASK);
                } else {
                    blockAppearance.getPart(BlockPart.fromSide(dir)).appendTo(mesh, x, y, z, colorOffset, renderType, vertexFlag);
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector4f

Copyright © 2018 www.massapicom. 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.