/** * Constructs a PickPoint using a default point. * The point is initialized to (0,0,0). */ public PickPoint() { location = new Point3d(); }
/** * Constructs a PickPoint from the specified parameter. * @param location the pick point. */ public PickPoint(Point3d location) { this.location = new Point3d(location); }
/** * Constructs an empty PickCylinderSegment. * The origin and end points of the cylindrical segment are * initialized to (0,0,0). The radius is initialized * to 0. */ public PickCylinderSegment() { this.end = new Point3d(); }
/** * Constructs an empty PickConeSegment. * The origin and end point of the cone are * initialized to (0,0,0). The spread angle is initialized * to <code>PI/64</code> radians. */ public PickConeSegment() { end = new Point3d(); }
public Point3d computeCenterOfMass() { final Point3d v = new Point3d(); for (int i=0; i<length; i++) { v.x += x[i]/length; v.y += y[i]/length; v.z += z[i]/length; } return v; } /** Create a new VectorString for the given range. If last < first, it will be created as reversed. */
/** * Constructs and initializes a 2X bounding box about the origin. The lower * corner is initialized to (-1.0d, -1.0d, -1.0d) and the upper corner is * initialized to (1.0d, 1.0d, 1.0d). */ public BoundingBox() { boundId = BOUNDING_BOX; lower = new Point3d(-1.0d, -1.0d, -1.0d); upper = new Point3d( 1.0d, 1.0d, 1.0d); boundsIsEmpty = false; boundsIsInfinite = false; }
/** * Constructs and initializes a BoundingBox given min,max in x,y,z. * @param lower the "small" corner * @param upper the "large" corner */ public BoundingBox(Point3d lower, Point3d upper) { boundId = BOUNDING_BOX; this.lower = new Point3d(lower); this.upper = new Point3d(upper); updateBoundsStates(); }
/** * @deprecated Use scaleAdd(double,Tuple3d) instead */ public final void scaleAdd(double s, Tuple3f t1) { scaleAdd(s, new Point3d(t1)); }
/** * Constructs an infinite cone pick shape from the specified * parameters. * @param origin the origin of the cone * @param direction the direction of the cone * @param spreadAngle the spread angle of the cone in radians */ public PickConeRay(Point3d origin, Vector3d direction, double spreadAngle) { this.origin = new Point3d(origin); this.direction = new Vector3d(direction); this.spreadAngle = spreadAngle; }
/** * Constructs an empty PickCone. * The origin and direction of the cone are * initialized to (0,0,0). The spread angle is initialized * to <code>PI/64</code>. */ public PickCone() { this.origin = new Point3d(); this.direction = new Vector3d(); this.spreadAngle = Math.PI / 64.0; }
public CustomTriangleMesh(final List<Point3f> mesh, final Color3f col, final float trans) { super(mesh, col, trans); if (mesh != null) { final Point3d center = new Point3d(); final double[][] inertia = new double[3][3]; volume = MeshProperties.compute(mesh, center, inertia); } }
/** * Constructs and initializes a BoundingSphere from a center and radius. * @param center the center of the bounding sphere * @param radius the radius of the bounding sphere */ public BoundingSphere(Point3d center, double radius) { boundId = BOUNDING_SPHERE; this.center = new Point3d(center); this.radius = radius; updateBoundsStates(); }
/** * Constructs an empty PickCylinder. * The origin of the cylinder is * initialized to (0,0,0). The radius is initialized * to 0. */ public PickCylinder() { origin = new Point3d(); direction = new Vector3d(); radius = 0.0; }
@Override Point3d getCenter() { Point3d cent = new Point3d(); cent.add(upper, lower); cent.scale(0.5d); return cent; }
public void getMin(final Point3d min) { min.set(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE); final Point3d tmp = new Point3d(); for (final ContentInstant c : contents.values()) { c.getContent().getMin(tmp); if (tmp.x < min.x) min.x = tmp.x; if (tmp.y < min.y) min.y = tmp.y; if (tmp.z < min.z) min.z = tmp.z; } }
public void getMax(final Point3d max) { max.set(Double.MIN_VALUE, Double.MIN_VALUE, Double.MIN_VALUE); final Point3d tmp = new Point3d(); for (final ContentInstant c : contents.values()) { c.getContent().getMax(tmp); if (tmp.x > max.x) max.x = tmp.x; if (tmp.y > max.y) max.y = tmp.y; if (tmp.z > max.z) max.z = tmp.z; } }
static boolean intersectRay(Point3d coordinates[], PickRay ray, PickIntersection pi) { Point3d origin = new Point3d(); Vector3d direction = new Vector3d(); boolean result; ray.get (origin, direction); result = intersectRayOrSegment(coordinates, direction, origin, pi, false); return result; }
/** * @see PointList.PointListListener#moved */ @Override public void moved(final BenesNamedPoint p) { final int i = points.indexOf(p); if (i >= 0 && i < points.size()) updatePositionInGeometry(i, new Point3d( p.x, p.y, p.z)); }
public void transform(final Transform3D t) { final Point3d p = new Point3d(); if (null != x) transform(t, x, y, z, length, p); if (null != vx) transform(t, vx, vy, vz, length, p); if (null != rvx) transform(t, rvx, rvy, rvz, length, p); }