Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Vector4f


    return new Vector3f((float)x, (float)y, (float)z);
  }

  @SideOnly(Side.CLIENT)
  public Vector4f vector4f() {
    return new Vector4f((float)x, (float)y, (float)z, 1);
  }
View Full Code Here


    }

    @SideOnly(Side.CLIENT)
    public Vector4f vector4f()
    {
        return new Vector4f((float)x, (float)y, (float)z, 1);
    }
View Full Code Here

            Matrix4f scaleVec = new Matrix4f();
            scaleVec.m00 = matrix0.m00;
            scaleVec.m11 = matrix0.m11;
            scaleVec.m22 = matrix0.m22;
            Vector4f newVec = Matrix4f.transform(scaleVec, new Vector4f(2, -2, 0, 0), null);
            float iconSize = (newVec.y * (Minecraft.getMinecraft().displayHeight / 2.0F)) * (e.getKey() instanceof Star ? 2 : 1) * (e.getKey() == this.selectedBody ? 1.5F : 1.0F);

            this.planetPosMap.put(e.getKey(), new Vector3f(vec.x, vec.y, iconSize)); // Store size on-screen in Z-value for ease
        }

View Full Code Here

  }

  @SideOnly(Side.CLIENT)
  public Vector4f vector4f() {

    return new Vector4f((float) x, (float) y, (float) z, 1);
  }
View Full Code Here

        mul(lhs, rhs, result);
        return result;
    }
   
    public static Vector3 transformPoint(Matrix4x4 mat, Vector3 vec) {
        Vector4f vec4 = new Vector4f(vec.x, vec.y, vec.z, 1.0f);
        Vector4f result = new Vector4f();
        transform(mat, vec4, result);
        return new Vector3(result.x, result.y, result.z);
    }
View Full Code Here

        transform(mat, vec4, result);
        return new Vector3(result.x, result.y, result.z);
    }
   
    public static Vector3 transformVector(Matrix4x4 mat, Vector3 vec) {
        Vector4f vec4 = new Vector4f(vec.x, vec.y, vec.z, 0.0f);
        Vector4f result = new Vector4f();
        transform(mat, vec4, result);
        return new Vector3(result.x, result.y, result.z);
    }
View Full Code Here

       
        Function quad = new Function(square,false) {
            @Override
            public Material getMaterial(float u, float v) {
                Material result = new Material();
                result.ambient = new Vector4f(0.1f,0.1f,0.1f, 1f);
                result.diffuse = new Vector4f(0.7f, 0f, 0.7f, 1f);
                result.specular = new Vector4f(1f, 1f, 1f, 1f);
                result.shininess = 100;
                return result;               
            }
           
            @Override
            public Vector4f getCoords(float u, float v) {
                return new Vector4f(u, v, 0, 1);
            }
           
            @Override
            Vector3f uDerivative(float u, float v) {
                return new Vector3f(1, 0, 0);
            }
           
            @Override
            Vector3f vDerivative(float u, float v) {
                return new Vector3f(0, 1, 0);
            }
        };
       
        Function fold = new Function(square,false) {
            @Override
            public Vector4f getCoords(float u, float v) {
                return new Vector4f(u, v, u * u * u + u * v, 1);
            }

            @Override
            Vector3f uDerivative(float u, float v) {
                return new Vector3f(1, 0, 3 * u * u + v);
            }

            @Override
            Vector3f vDerivative(float u, float v) {
                return new Vector3f(0, 1, u);
            }

            @Override
            public Material getMaterial(float u, float v) {
                Material result = new Material();
                result.ambient = new Vector4f(0.1f, 0.1f, 0.1f, 1f);
                result.diffuse = new Vector4f(Math.abs(u) / 2f, Math.abs(v) / 2f, 1, 1f);
                result.specular = new Vector4f(1f, 1f, 1f, 1f);
                result.shininess = 100;
                return result;
            }
        };


        Rectangle[] fourSquares = {new Rectangle(-2, true, 0, false, -2, true, 0, false),
            new Rectangle(0, false, 2, true, -2, true, 0, false),
            new Rectangle(-2, true, 0, false, 0, false, 2, true),
            new Rectangle(0, false, 2, true, 0, false, 2, true)};

        Rectangle[] fourDistantSquares = {new Rectangle(-2, true, -0.5f, true, -2, true, -0.5f, true),
            new Rectangle(0.5f, true, 2, true, -2, true, -0.5f, true),
            new Rectangle(-2, true, -0.5f, true, 0.5f, true, 2, true),
            new Rectangle(0.5f, true, 2, true, 0.5f, true, 2, true)};


        Function hyperboloid = new Function(fourSquares,false) {
            @Override
            public Vector4f getCoords(float u, float v) {
                return new Vector4f(u, v, 1 / (u * v), 1);
            }

            @Override
            Vector3f uDerivative(float u, float v) {
                return new Vector3f(1, 0, 3 * u * u + v);
            }

            @Override
            Vector3f vDerivative(float u, float v) {
                return new Vector3f(0, 1, u);
            }

            @Override
            public Material getMaterial(float u, float v) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }
        };
       
        Rectangle[] squareSphere = {new Rectangle(-(float)Math.PI/2, true, (float) Math.PI/2, true, 0, true, 2*(float)Math.PI, true)};
        Function sphere = new Function(squareSphere,true) {
            @Override
            public Material getMaterial(float u, float v) {
                Material result = new Material();
                result.ambient = new Vector4f(0.1f, 0.1f, 0.1f, 1f);
                result.diffuse = new Vector4f((float)((u+Math.PI/2)/Math.PI),(float)(v/(2*Math.PI)), 1, 1f);
                result.specular = new Vector4f(1f, 1f, 1f, 1f);
                result.shininess = 200;
                return result;
            }
           
            @Override
            public Vector4f getCoords(float u, float v) {
                return new Vector4f((float)(Math.cos(u)*Math.cos(v)),(float)(Math.cos(u)*Math.sin(v)), (float)Math.sin(u), 1);
            }
           
            @Override
            Vector3f uDerivative(float u, float v) {
                return new Vector3f((float)(-Math.sin(u)*Math.cos(v)), (float)(-Math.sin(u)*Math.sin(v)), (float)Math.cos(u));
View Full Code Here

TOP

Related Classes of org.lwjgl.util.vector.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.