/** * Gets the current point in world coordinates. * @return the current point in world coordinates. */ public Point3 getPointWorld() { return new Point3(_pointWorld); }
/** * Gets the current point in pixel coordinates. * @return the current point in pixel coordinates. */ public Point3 getPointPixel() { return new Point3(_pointPixel); }
/** * Gets the picked point in world coordinates. * @return the picked point in world coordinates. */ public Point3 getPointWorld() { return new Point3(_pointWorld); }
/** * Gets the endpoint A of this segment. * @return the endpoint A. */ public Point3 getA() { return new Point3(_a); }
/** * Returns the point q = p-v, for this point p and the specified vector v. * @param v the vector v. * @return the point q = p-v. */ public Point3 minus(Vector3 v) { return new Point3(x-v.x,y-v.y,z-v.z); }
/** * Returns an affine combination of this point p and the specified point q. * @param a the weight of the point q. * @param q the point q. * @return the affine combination (1-a)*p + a*q. */ public Point3 affine(double a, Point3 q) { double b = 1.0-a; Point3 p = this; return new Point3(b*p.x+a*q.x,b*p.y+a*q.y,b*p.z+a*q.z); }
/** * Gets the current point in local coordinates. * @return the current point in local coordinates. */ public Point3 getPointLocal() { return new Point3(_pointLocal); }
/** * Gets the minimum corner point for this frame. * @return the minimum corner point. */ public Point3 getCornerMin() { return new Point3(_p[0]); }
/** * Returns the point q = p+v, for this point p and the specified vector v. * @param v the vector v. * @return the point q = p+v. */ public Point3 plus(Vector3 v) { return new Point3(x+v.x,y+v.y,z+v.z); }
/** * Gets the picked point in pixel coordinates. * @return the picked point in pixel coordinates. */ public Point3 getPointPixel() { return new Point3(_pointPixel); }
/** * Gets the maximum corner point for this frame. * @return the maximum corner point. */ public Point3 getCornerMax() { return new Point3(_p[3]); }
/** * Constructs an empty annotation at a point in space. * * Note: The coordinate is in the world context. * @param x a x-coordinate. * @param y a y-coordinate. * @param z a z-coordinate. */ public Annotation(float x, float y, float z) { this(new Point3(x,y,z)); }
/** * Constructs an annotation at a point in space. * * Note: The coordinate is in the world context. * @param x a x-coordinate. * @param y a y-coordinate. * @param z a z-coordinate. * @param text the text for this annotation. */ public Annotation(float x, float y, float z, String text) { this(new Point3(x,y,z),text); }
/** * Gets the view-independent location of the center of this handle. * @return the center point. */ public Point3 getLocation() { return _transform.times(new Point3()); }
BoundingSphere computeBoundingSphereOfFrame(boolean finite) { double dx = _p[3].x-_p[0].x; double dy = _p[3].y-_p[0].y; double dz = _p[3].z-_p[0].z; double r = sqrt(dx*dx+dy*dy+dz*dz); double x = 0.5*(_p[0].x+_p[3].x); double y = 0.5*(_p[0].y+_p[3].y); double z = 0.5*(_p[0].z+_p[3].z); Point3 c = new Point3(x,y,z); return new BoundingSphere(c,r); }
protected BoundingSphere computeBoundingSphere(boolean finite) { Point3 c = new Point3(0.5,0.5,0.5); double r = 0.5*Math.sqrt(3.0); return new BoundingSphere(c,r); }
private static Point3 randomPoint3() { double x = _random.nextDouble(); double y = _random.nextDouble(); double z = _random.nextDouble(); return new Point3(x,y,z); }
private static Point3 randomPoint3() { double x = _random.nextDouble(); double y = _random.nextDouble(); double z = _random.nextDouble(); return new Point3(x,y,z); }
/** * Gets the sphere center. * @return the center. */ public Point3 getCenter() { Check.state(!isEmpty(),"bounding sphere is not empty"); Check.state(!isInfinite(),"bounding sphere is not infinite"); return new Point3(_x,_y,_z); }