Examples of Vec


Examples of com.jogamp.opencl.demos.julia3d.structs.Vec

    private void updateCamera() {

        Camera camera = config.getCamera();

        Vec dir    = camera.getDir();
        Vec target = camera.getTarget();
        Vec camX   = camera.getX();
        Vec camY   = camera.getY();
        Vec orig   = camera.getOrig();

        vsub(dir, target, orig);
        vnorm(dir);

        Vec up = Vec.create().setX(0).setY(1).setZ(0);
        vxcross(camX, dir, up);
        vnorm(camX);
        vmul(camX, config.getWidth() * .5135f / config.getHeight(), camX);

        vxcross(camY, camX, dir);
View Full Code Here

Examples of com.jogamp.opencl.demos.julia3d.structs.Vec

        component.addMouseMotionListener(mouseAdapter);
        component.addMouseWheelListener(mouseAdapter);

    }
    private void zoom(float zoom) {
        Vec orig = model.getCamera().getOrig();
        orig.setX(orig.getX()+zoom)
            .setY(orig.getY()+zoom)
            .setZ(orig.getZ()+zoom);
    }
View Full Code Here

Examples of com.jogamp.opencl.demos.julia3d.structs.Vec

        light[2] = (float) (x * sin(k) + z * cos(k));
        model.setLight(light);
    }

    private void rotateCameraXbyOrig(double k) {
        Vec orig = model.getCamera().getOrig();
        float y = orig.getY();
        float z = orig.getZ();
        orig.setY((float) ( y * cos(k) + z * sin(k)));
        orig.setZ((float) (-y * sin(k) + z * cos(k)));
    }
View Full Code Here

Examples of com.jogamp.opencl.demos.julia3d.structs.Vec

        orig.setY((float) ( y * cos(k) + z * sin(k)));
        orig.setZ((float) (-y * sin(k) + z * cos(k)));
    }

    private void rotateCameraYbyOrig(double k) {
        Vec orig = model.getCamera().getOrig();
        float x = orig.getX();
        float z = orig.getZ();
        orig.setX((float) (x * cos(k) - z * sin(k)));
        orig.setZ((float) (x * sin(k) + z * cos(k)));
    }
View Full Code Here

Examples of pr.lib.Vec

        int lastRow = this.getWidth()+startRow;
        int lastCol = this.getHeight()+startCol;
        Iterator<Vec> iterator = new VecIterator(startRow, lastRow, startCol, lastCol);
       
        while(iterator.hasNext()) {
            Vec p = iterator.next();
            BlockType t = this.getBlockFor(p);

            if (t != null) {
                world.makeBlock(t, p);
            }
View Full Code Here

Examples of pr.lib.Vec

        }

        @Override
        public Vec next() {

            Vec v = new Vec(col, row);
            //Debug.log(v.toString());
            col++;
            if (col > endCol) {
                col = startCol;
                row++;
View Full Code Here

Examples of pr.lib.Vec

   
    public boolean move(Dir d) {
        if (!moveFreqLimiter.Can()) {
            return false;
        }
        Vec tp = p.InDirection(d);
        if (world.get(tp) == null) {
            boolean moveSucceeded = moveTo(p.InDirection(d));
            if (moveSucceeded) {
                moveFreqLimiter.Do();
            }
View Full Code Here

Examples of pr.lib.Vec

    public boolean moveBackwards() {
        return move(d.Back);
    }

    public boolean build() {
        Vec tp = posInFront();
        if (world.get(tp) != null) {
            return false;
        }
        world.makeBlock(BlockType.IRON, tp);
        return true;
View Full Code Here

Examples of pr.lib.Vec

    }

    @Override
    public void gen(World world) {
        for (int x = 0; x < width; x++) {
            world.makeBlock(blockType, southWestCorner.plus(new Vec(x, 0)));
            world.makeBlock(blockType, southWestCorner.plus(new Vec(x, width - 1)));
        }
        for (int y = 0; y < height; y++) {
            world.makeBlock(blockType, southWestCorner.plus(new Vec(0, y)));
            world.makeBlock(blockType, southWestCorner.plus(new Vec(height - 1, y)));
        }
    }
View Full Code Here

Examples of pr.lib.Vec

public class BoundingBox implements IGen{

    public final BlockType blockType = BlockType.BEDROCK;
    public void gen(World w) {
        for (int x = -1; x <= w.width; x++) {
            w.makeBlock(blockType, new Vec(x, -1));
            w.makeBlock(blockType, new Vec(x, w.width));
        }
        for (int y = -1; y <= w.height; y++) {
            w.makeBlock(blockType, new Vec(-1, y));
            w.makeBlock(blockType, new Vec(w.height, y));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.