/** * Get the 2D offset to the touch. * */ public PVector getTouchOffset() { return touchOffset.copy(); }
public PVector getCaptureSize() { return captureSize.copy(); }
public PVector getCaptureSizeMM() { return captureSizeMM.copy(); }
public PVector getSize() { return drawingSize.copy(); }
@Deprecated public PVector get() { return copy(); }
/** * Linear interpolate between two vectors (returns a new PVector object) * @param v1 the vector to start from * @param v2 the vector to lerp to */ public static PVector lerp(PVector v1, PVector v2, float amt) { PVector v = v1.copy(); v.lerp(v2, amt); return v; }
/** * @param position in mm in the paper screen * @return position in px in the cameratracking. */ public PVector computePxPosition(PVector position) { PVector p = position.copy(); // Invert Y p.y = p.y - drawingSize.y; p.y = -p.y; // get a copy of the position PMatrix3D mat = this.getLocation(getCameraTracking()).get(); mat.translate(p.x, p.y, 0); PVector pos3D = new PVector(mat.m03, mat.m13, mat.m23); PVector camCoord = cameraTracking.getProjectiveDevice().worldToPixelCoord(pos3D); return camCoord; }