Package processing.core

Examples of processing.core.PVector.sub()


   
    if(projection == null || being1==being2) {
      return false// if they aren't colliding
    }
    if(projection.x==0 && Math.abs(projection.y)<smallerBeingHeight) {
      projection.sub(makeVector(0, smallerBeingHeight * sign(projection.y)));
      MassedBeing.addImpulseCollision(biggerBeing, smallerBeing, projection);
      return true;
    } else if (projection.y==0 && Math.abs(projection.x)<smallerBeingWidth) {
      projection.sub(makeVector(smallerBeingWidth * sign(projection.x), 0));
      MassedBeing.addImpulseCollision(biggerBeing, smallerBeing, projection);
View Full Code Here


    if(projection.x==0 && Math.abs(projection.y)<smallerBeingHeight) {
      projection.sub(makeVector(0, smallerBeingHeight * sign(projection.y)));
      MassedBeing.addImpulseCollision(biggerBeing, smallerBeing, projection);
      return true;
    } else if (projection.y==0 && Math.abs(projection.x)<smallerBeingWidth) {
      projection.sub(makeVector(smallerBeingWidth * sign(projection.x), 0));
      MassedBeing.addImpulseCollision(biggerBeing, smallerBeing, projection);
      return true;
    }
    else
      return false;
View Full Code Here

   *
   * @return
   */
  public PVector getTranslation() {
    PVector translation = vectorToPVector(getFrame().translation(getLastFrame()));
    translation.sub(velocityOffset());
    return translation;
  }

  /**
   * returns averaged translation of all points tracked by the leap in comparison to the frame you
View Full Code Here

   *
   * @return
   */
  public PVector getTranslation(Frame frame) {
    PVector translation = vectorToPVector(getFrame().translation(frame));
    translation.sub(velocityOffset());
    return translation;
  }

  /**
   * returns the pitch of the hand you passed
View Full Code Here

   * @return PVector direction of the hand
   */
  public PVector getDirection(Hand hand) {

    PVector dir = vectorToPVector(hand.direction());
    dir.sub(positionOffset());
    return dir;
  }

  /**
   * returns a PVector containing the position of the hand
View Full Code Here

   * @param hand the hand you want the normal of the handpalm of
   * @return a PVector containing the normal of thepalm of the hand
   */
  public PVector getNormal(Hand hand) {
    PVector normal = vectorToPVector(hand.palmNormal());
    normal.sub(positionOffset());
    return normal;
  }

  /**
   * returns the velocity of the palm of the hand you passed in
View Full Code Here

   * @param hand the hand of which palm you want the velocity of
   * @return a PVector containing the velocity of the hand
   */
  public PVector getVelocity(Hand hand) {
    PVector velo = vectorToPVector(hand.palmVelocity());
    velo.sub(velocityOffset());
    return velo;
  }

  /**
   * access to the acceleration of the hand you passed in.
View Full Code Here

   * @param pointable the pointable you want the velocity of
   * @return a PVector containing the velocity of the tip of the pointble
   */
  public PVector getVelocity(Pointable pointable) {
    PVector velo = vectorToPVector(pointable.tipVelocity());
    velo.sub(velocityOffset());
    return velo;
  }



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.