Package aspect.util

Examples of aspect.util.Vector2


            }
        }
    }

    public static void modify2(Complex[][] comp, int w) {
        Vector2 center = new Vector2(w / 2, w / 2);
        for (int i = 0; i < w; i++) {
            for (int j = 0; j < w; j++) {
                Vector2 pos = new Vector2(i, j);
                float f = Vector2.distance(pos, center) + 1;
                comp[i][j].real /= f;
                //comp[i][j].real *= 20;
                comp[i][j].imaginary /= f;
                //comp[i][j].imaginary *= 20;
View Full Code Here


                            ShaderProgram.COLOR.setVar("color", c);
                            entity.render();
                        }
                        ShaderProgram.unlock();

                        Color c = getPixelColor(new Vector2(getCanvasWidth() / 2, getCanvasHeight() / 2));
                        Entity hit = key.get(c);

                        if (hit instanceof Fighter) {
                            Fighter f = (Fighter) hit;
                            if (f.health > 0) {
View Full Code Here

    }

    public void render() {
        setRenderMode(RenderMode.ORTHOGONAL);
        loadIdentity();
        translate(new Vector2(getCanvasWidth() / 2, getCanvasHeight() / 2));

        drawModel.render();
    }
View Full Code Here

        terrain.render();
        //world.draw();
        //water.draw();
        fbo.stop();
        fbo.render();
        draw2D(crosshair, new Vector2(Mouse.getX(), Mouse.getY()), 0);
    }
View Full Code Here

        float m = 2 * Trig.PI / w;
        for (int k = 1; k < 50; k++) {
            float phase = r.nextFloat() * 2 * Trig.PI;
            for (int a = 0; a < 10; a++) {
                Vector2 vec = Vector2.fromAngle(r.nextFloat() * 360, 1.0f);
                for (int i = 0; i < w; i++) {
                    for (int j = 0; j < w; j++) {
                        //floats[i][j] += noise(i, j, k, m, xphase, zphase);
                        floats[i][j] += noise(i, j, k, m, phase, vec);
                    }
View Full Code Here

        moon.render();
        ship.render();

        if (hud) {
            RigidBody rb = ship.rigidBody();
            Vector2 v = Vector2.fromAngle(-ship.ang.roll, 50 / viewpoint.scale);
            Vector2 a1 = Vector2.fromAngle(-ship.ang.roll + 140, 10 / viewpoint.scale);
            Vector2 a2 = Vector2.fromAngle(-ship.ang.roll - 140, 10 / viewpoint.scale);
            glColor3f(1, 0, 0);
            glBegin(GL_LINES);
            glVertex2f(ship.pos.x, ship.pos.y);
            glVertex2f(ship.pos.x + v.x, ship.pos.y + v.y);
            glVertex2f(ship.pos.x + v.x, ship.pos.y + v.y);
View Full Code Here

    }

    public boolean crossed(Vector2 l1, Vector2 l2) {
        Matrix4x4 m = entity.transform.getMdlMatrix();
       
        Vector2 v3 = m.transformPoint(v1).xz();
        Vector2 v4 = m.transformPoint(v2).xz();
       
        return Vector2.checkIntersection(l1, l2, v3, v4);
    }
View Full Code Here

            minz = Math.min(minz, z);
            maxx = Math.max(maxx, x);
            maxy = Math.max(maxy, y);
            maxz = Math.max(maxz, z);
        }
        float w = new Vector2(maxx - minx, maxz - minz).mag();
        for (int i = 0; i < points.length; i++) {
            float x = (new Vector2(points[i].x - minx, points[i].z - minz).mag() / w) * hRepeat;
            float y = ((points[i].y - miny) / (maxy - miny)) * vRepeat;
            dest[i * 2 + start + 0] = x;
            dest[i * 2 + start + 1] = y;
        }
    }
View Full Code Here

                    break;
                }
                case "vt": {
                    float x = Float.parseFloat(parts[1]);
                    float y = Float.parseFloat(parts[2]);
                    allTexCoords.add(new Vector2(x, y));
                    break;
                }
                case "vn": {
                    float x = Float.parseFloat(parts[1]);
                    float y = Float.parseFloat(parts[2]);
View Full Code Here

       
        int index = start;
        for (int i = 0; i < lod; i++) {
            float tex = i * texStep;
           
            Vector2 tex1 = new Vector2(tex * hRepeat, vRepeat);
            Vector2 tex2 = new Vector2(tex * hRepeat, 0);
            Vector2 tex3 = new Vector2((tex + texStep) * hRepeat, 0);
            Vector2 tex4 = new Vector2((tex + texStep) * hRepeat, vRepeat);

            index += copyVector2(tex1, dest, index, 1);
            index += copyVector2(tex2, dest, index, 1);
            index += copyVector2(tex3, dest, index, 1);
            index += copyVector2(tex4, dest, index, 1);
View Full Code Here

TOP

Related Classes of aspect.util.Vector2

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.