Examples of Vector2


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

Examples of be.demmel.jgws.packets.Vector2

  public void handlePacket(ChannelHandlerContext ctx, P129_RequestSpawnPoint packet, GameServerSession serverData, List<QueueAction> actions) throws Exception {
    CharacterData character = serverData.getCurrentCharacter();

    P391_InstanceLoadSpawnPoint instanceLoadSpawnPoint = new P391_InstanceLoadSpawnPoint();
    instanceLoadSpawnPoint.setMapFile(character.getGameFileID());
    Vector2 spawn = new Vector2(character.getPosition().getX(), character.getPosition().getY());
    instanceLoadSpawnPoint.setPosition(spawn);
    instanceLoadSpawnPoint.setPlane(character.getPosition().getZ());
    ctx.write(instanceLoadSpawnPoint);
  }
View Full Code Here

Examples of ca.eandb.jmist.math.Vector2

    public Node(Point2 p, PathInfo pathInfo, double ru, double rv, double rj) {
      super(pathInfo, ru, rv, rj);
      this.pointOnImagePlane = p;

      Vector2 uv = RandomUtil.uniformOnDisc(apertureRadius, ru, rv).toCartesian();
      Point3 origin = new Point3(uv.x(), uv.y(), 0.0);
      Point3 focus = new Point3(
          (pointOnImagePlane.x() - 0.5) * objPlaneWidth,
          (0.5 - pointOnImagePlane.y()) * objPlaneHeight,
          -focusDistance);

View Full Code Here

Examples of com.ardor3d.math.Vector2

        final Texture clockTex = TextureManager.load("images/clock.png", Texture.MinificationFilter.Trilinear, false);

        final TransformedSubTex clockBack = new TransformedSubTex(new SubTex(clockTex, 64, 65, 446, 446));

        final double scale = .333;
        clockBack.setPivot(new Vector2(.5, .5));
        clockBack.getTransform().setScale(scale);
        clockBack.setAlignment(Alignment.MIDDLE);
        clockBack.setPriority(0);
        multiImgBD.addImage(clockBack);

        final TransformedSubTex hour = new TransformedSubTex(new SubTex(clockTex, 27, 386, 27, 126));
        hour.setPivot(new Vector2(.5, 14 / 126f));
        hour.getTransform().setScale(scale);
        hour.setAlignment(Alignment.MIDDLE);
        hour.setPriority(1);
        multiImgBD.addImage(hour);

        final TransformedSubTex minute = new TransformedSubTex(new SubTex(clockTex, 0, 338, 27, 174));
        minute.setPivot(new Vector2(.5, 14 / 174f));
        minute.getTransform().setScale(scale);
        minute.setAlignment(Alignment.MIDDLE);
        minute.setPriority(2);
        multiImgBD.addImage(minute);
View Full Code Here

Examples of com.ardor3d.math.Vector2

        return rVal.set(gridX, height, gridY);
    }

    @Override
    public Vector2 get2DPoint(final ReadOnlyVector3 worldLocation, final Vector2 store) {
        final Vector2 rVal = store != null ? store : new Vector2();

        return rVal.set(worldLocation.getX(), worldLocation.getZ());
    }
View Full Code Here

Examples of com.ardor3d.math.Vector2

        return null;
    }

    private int findClipIndex(final ReadOnlyVector3 pointInEyeSpace) {
        final Vector2 gridPoint = _tracers.get(_minLevel).get2DPoint(pointInEyeSpace, null);
        final int maxDist = Math.max(Math.abs((int) gridPoint.getX()), Math.abs((int) gridPoint.getY()))
                / (_clipmapLevels.get(_minLevel).getClipSideSize() + 1 >> 1);
        int index = (int) MathUtils.floor(Math.log(maxDist) / Math.log(2)) + 1;
        index = MathUtils.clamp(index, _minLevel, _maxLevel);
        return index;
    }
View Full Code Here

Examples of com.ardor3d.math.Vector2

        return rVal.set(gridX, gridY, height);
    }

    @Override
    public Vector2 get2DPoint(final ReadOnlyVector3 worldLocation, final Vector2 store) {
        final Vector2 rVal = store != null ? store : new Vector2();

        return rVal.set(worldLocation.getX(), worldLocation.getY());
    }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

      System.out.println("X: " + x + " Y: " + y);
  //    System.out.println("Y: " + Gdx.input.getAccelerometerY());
  //    System.out.println("Z: " + Gdx.input.getAccelerometerZ());
  //    System.out.println("R: " + Gdx.input.getRotation());
    }
    if(!touched && g.equals(new Vector2(0,0))){
      g = new Vector2();
      gameObject.world.setGravity(g);
    }
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    physics.setBodyType(BodyType.KinematicBody);
  }

  @Override
  public void onTouchStay(Vector2 touchPosition) {
    Vector2 pos = screenToWorld(touchPosition.cpy());
    transform.setLocalPosition(pos.sub(spriteRenderer.getHalfSize()));
    checkSnap();
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

 
  private void checkSnap(){
    snapped = false;
    for (Vector2 pos : snapPositions) {
      diff.set(transform.getLocalPosition());
      diff.add(new Vector2(spriteRenderer.spriteRegion.getRegionWidth()/2
          ,spriteRenderer.spriteRegion.getRegionHeight()/2));
      diff.sub(pos);
      if (diff.len2() < 5000) {
        transform.setLocalPosition(new Vector2(pos).sub(new Vector2(spriteRenderer.spriteRegion.getRegionWidth()/2
            ,spriteRenderer.spriteRegion.getRegionHeight()/2)));
        snapped = true;
        break;
      }
    }
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.