Examples of sub()


Examples of org.luaj.vm2.LuaValue.sub()

    switch (op) {
    case OP_ADD:
      r = v1.add(v2);
      break;
    case OP_SUB:
      r = v1.sub(v2);
      break;
    case OP_MUL:
      r = v1.mul(v2);
      break;
    case OP_DIV:
View Full Code Here

Examples of org.newdawn.slick.geom.Vector2f.sub()

    if (ray != null) {
      Entity pl = ME.world.find(Player.PLAYER);
      ray.update(e, pl);
      Vector2f point = ray.line.getEnd();
      Vector2f cur = new Vector2f(e.x, e.y);
      cur = cur.sub(point);
      cur = cur.normalise();
      e.x -= cur.x;
      e.y -= cur.y;
    }
View Full Code Here

Examples of org.openmali.vecmath2.Vector3f.sub()

     */
    private void actionSearchToCopulate(long frameTime) {
        if (focusedPartner != null) {
           
            Vector3f path = new Vector3f();
            path.sub(focusedPartner.getPos(), pos);
            angle = Angle.angle(path.getX(), path.getY());
           
            // not even necessary to check if near enough here
            // we will be kindly notified of every collision by
            // our own World. see the notifyCollision(Digibot) method
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.sub()

        if (intersectionPoint == null)
            return null;
        else
            //return distance form base to target position
            return intersectionPoint.sub(targetPos);
    }

    /**
     * Gathers possible move directions - perpendicular to the selected segment
     * and parallel to neighboring segments.
View Full Code Here

Examples of org.rascalmpl.library.vis.util.vector.Vector2D.sub()

  public Vector2D repulsiveForceWall(Vector2D wallVector) {
    Vector2D thisVector = new Vector2D(getCenter());
    double distance2 = thisVector.distance2(wallVector);

    if (distance2 > 0) {
      return thisVector.sub(wallVector).mul(G.EDGE_LENGTH_2).div(distance2).mul(10 * G.REPEL);
    }
    return (new Vector2D(0, 0));
  }

  private final static double Deg45 = Math.toDegrees(Math.PI/4);
View Full Code Here

Examples of org.spout.api.geo.discrete.Point.sub()

  public static BlockFace getBlockFacing(Block block, Entity entity) {
    Point position;
    EntityHead head = entity.get(EntityHead.class);
    position = head != null ? head.getPosition() : entity.getPhysics().getPosition();

    Vector3f diff = position.sub(block.getX(), block.getY(), block.getZ());
    if (Math.abs(diff.getX()) < 2.0f && Math.abs(diff.getZ()) < 2.0f) {
      if (diff.getY() > 1.8f) {
        return BlockFace.TOP;
      } else if (diff.getY() < -0.2f) {
        return BlockFace.BOTTOM;
View Full Code Here

Examples of org.spout.math.vector.Vector3f.sub()

    PhysicsComponent sc = player.getPhysics();

    Vector3f offset = Vector3f.ZERO;
    float speed = 50;
    if (inputState.getForward()) {
      offset = offset.sub(ts.forwardVector().mul(speed * dt));
    }
    if (inputState.getBackward()) {
      offset = offset.add(ts.forwardVector().mul(speed * dt));
    }
    if (inputState.getLeft()) {
View Full Code Here

Examples of org.terasology.math.Vector2i.sub()

    @Override
    public void processMousePosition(Vector2i position) {
        if (clickedRegion != null) {
            Vector2i relPos = new Vector2i(position);
            relPos.sub(clickedRegion.offset);
            clickedRegion.listener.onMouseDrag(relPos);
        }

        Set<InteractionRegion> newMouseOverRegions = Sets.newLinkedHashSet();
        Iterator<InteractionRegion> iter = interactionRegions.descendingIterator();
View Full Code Here

Examples of org.terasology.math.Vector3i.sub()

    }

    @Override
    public void setDirtyAround(Region3i region) {
        Vector3i minPos = new Vector3i(region.min());
        minPos.sub(1, 1, 1);
        Vector3i maxPos = new Vector3i(region.max());
        maxPos.add(1, 1, 1);

        Vector3i minChunk = TeraMath.calcChunkPos(minPos, chunkPower);
        Vector3i maxChunk = TeraMath.calcChunkPos(maxPos, chunkPower);
View Full Code Here

Examples of org.vmmagic.unboxed.Address.sub()

        final VmArchitecture arch = VmUtils.getVm().getArch();
        helper.bootArchitecture(true);

        final Address bootImgStart = helper.getBootImageStart();
        final Address bootImgEnd = helper.getBootImageEnd();
        final int bootImgSize = bootImgEnd.sub(bootImgStart.toWord()).toInt();
        LazyMmapper.boot(bootImgStart, bootImgSize);

        final Extent heapSize = helper.getHeapSize();
        HeapGrowthManager.boot(heapSize, heapSize);
        bootPlan();
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.