src/de/voidplus/leapmotion/LeapMotion.java
/**
     * Convert/map the Vector data to sketch PVector data with world settings.
     *
     * @param position Instance of class Vector
     * @return PVector  version of instance Vector
     */
Convert/map the Vector data to sketch PVector data with world settings.
@param position Instance of class Vector
@return PVector  version of instance Vector
Convert / map the Vector data to sketch PVector data with world settings . @param position Instance of class Vector @return PVector version of instance Vector
protected PVector map(Vector position) {
        PVector response = new PVector();
        if (position.getX() > 0) {
            response.x = PApplet.lerp(
                    (this.parent.width * 0.5f),
                    this.parent.width,
                    (position.getX() / this.world.x)
            );
        } else {
            response.x = PApplet.lerp(
                    (this.parent.width * 0.5f),
                    0.0f,
                    (-position.getX() / this.world.x)
            );
        }
        response.y = PApplet.lerp(
                this.parent.height,
                0.0f,
                (position.getY() / world.y)
        );
        response.z = PApplet.lerp(
                50.0f,
                0.0f,
                (position.getZ() / world.z)
        );
        return this.move(response);
    }
protected PVector map ( Vector position ) { PVector response = new PVector ( ) ; if ( position . getX ( ) > 0 ) { response . x = PApplet . lerp ( ( this . parent . width * 0.5f ) , this . parent . width , ( position . getX ( ) / this . world . x ) ) ; } else { response . x = PApplet . lerp ( ( this . parent . width * 0.5f ) , 0.0f , ( - position . getX ( ) / this . world . x ) ) ; } response . y = PApplet . lerp ( this . parent . height , 0.0f , ( position . getY ( ) / world . y ) ) ; response . z = PApplet . lerp ( 50.0f , 0.0f , ( position . getZ ( ) / world . z ) ) ; return this . move ( response ) ; }
Convert/map the Vector data to sketch PVector data with world settings.
Convert / map the Vector data to sketch PVector data with world settings .
//		InteractionBox box = this.frame.interactionBox(); //		Vector normalized = box.normalizePoint(position); //		PVector response = new PVector( //			(normalized.getX()*this.parent.width), //			(this.parent.height-normalized.getY()*this.parent.height) //		); // WIDTH // HEIGHT // DEPTH