/** * Constructor instantiates a new <code>StripBox</code> object. The minimum and maximum point are provided. These * two points define the shape and size of the box, but not it's orientation or position. You should use the * <code>setTranslation</code> and <code>setLocalRotation</code> for those attributes. * * @param name * the name of the scene element. This is required for identification and comparison purposes. * @param min * the minimum point that defines the box. * @param max * the maximum point that defines the box. */ public StripBox(final String name, final Vector3 min, final Vector3 max) { super(name); setData(min, max); }
/** * Constructor instantiates a new <code>StripBox</code> object. The minimum and maximum point are provided. These * two points define the shape and size of the box, but not it's orientation or position. You should use the * <code>setTranslation</code> and <code>setLocalRotation</code> for those attributes. * * @param name * the name of the scene element. This is required for identification and comparison purposes. * @param min * the minimum point that defines the box. * @param max * the maximum point that defines the box. */ public StripBox(final String name, final Vector3 min, final Vector3 max) { super(name); setData(min, max); }
/** * Constructs a new box. The box has the given center and extends in the x, y, and z out from the center (+ and -) * by the given amounts. So, for example, a box with extent of .5 would be the unit cube. * * @param name * Name of the box. * @param center * Center of the box. * @param xExtent * x extent of the box, in both directions. * @param yExtent * y extent of the box, in both directions. * @param zExtent * z extent of the box, in both directions. */ public StripBox(final String name, final Vector3 center, final double xExtent, final double yExtent, final double zExtent) { super(name); setData(center, xExtent, yExtent, zExtent); }
/** * Constructs a new box. The box has the given center and extends in the x, y, and z out from the center (+ and -) * by the given amounts. So, for example, a box with extent of .5 would be the unit cube. * * @param name * Name of the box. * @param center * Center of the box. * @param xExtent * x extent of the box, in both directions. * @param yExtent * y extent of the box, in both directions. * @param zExtent * z extent of the box, in both directions. */ public StripBox(final String name, final Vector3 center, final double xExtent, final double yExtent, final double zExtent) { super(name); setData(center, xExtent, yExtent, zExtent); }
/** * Changes the data of the box so that the two opposite corners are minPoint and maxPoint. The other corners are * created from those two poitns. If update buffers is flagged as true, the vertex/normal/texture/color/index * buffers are updated when the data is changed. * * @param minPoint * The new minPoint of the box. * @param maxPoint * The new maxPoint of the box. */ public void setData(final Vector3 minPoint, final Vector3 maxPoint) { _center.set(maxPoint).addLocal(minPoint).multiplyLocal(0.5f); final double x = maxPoint.getX() - _center.getX(); final double y = maxPoint.getY() - _center.getY(); final double z = maxPoint.getZ() - _center.getZ(); setData(_center, x, y, z); }
/** * Changes the data of the box so that the two opposite corners are minPoint and maxPoint. The other corners are * created from those two poitns. If update buffers is flagged as true, the vertex/normal/texture/color/index * buffers are updated when the data is changed. * * @param minPoint * The new minPoint of the box. * @param maxPoint * The new maxPoint of the box. */ public void setData(final Vector3 minPoint, final Vector3 maxPoint) { _center.set(maxPoint).addLocal(minPoint).multiplyLocal(0.5f); final double x = maxPoint.getX() - _center.getX(); final double y = maxPoint.getY() - _center.getY(); final double z = maxPoint.getZ() - _center.getZ(); setData(_center, x, y, z); }