/** * <code>clone</code> creates a new Box object containing the same data as this one. * * @return the new Box */ @Override public Box clone() { return new Box(getName() + "_clone", _center.clone(), _xExtent, _yExtent, _zExtent); }
/** * <code>clone</code> creates a new Box object containing the same data as this one. * * @return the new Box */ @Override public Box clone() { return new Box(getName() + "_clone", _center.clone(), _xExtent, _yExtent, _zExtent); }
/** * <code>clone</code> creates a new StripBox object containing the same data as this one. * * @return the new StripBox */ @Override public StripBox clone() { return new StripBox(getName() + "_clone", _center.clone(), _xExtent, _yExtent, _zExtent); }
/** * <code>clone</code> creates a new StripBox object containing the same data as this one. * * @return the new StripBox */ @Override public StripBox clone() { return new StripBox(getName() + "_clone", _center.clone(), _xExtent, _yExtent, _zExtent); }
/** * Recalculates the center point of this triangle by averaging the triangle's three points. */ protected void calculateCenter() { if (_center == null) { _center = _pointA.clone(); } else { _center.set(_pointA); } _center.addLocal(_pointB).addLocal(_pointC).multiplyLocal(MathUtils.ONE_THIRD); _dirtyCenter = false; }
/** * Recalculates the center point of this triangle by averaging the triangle's three points. */ protected void calculateCenter() { if (_center == null) { _center = _pointA.clone(); } else { _center.set(_pointA); } _center.addLocal(_pointB).addLocal(_pointC).multiplyLocal(MathUtils.ONE_THIRD); _dirtyCenter = false; }
@Test public void testClone() { final Vector3 vec1 = new Vector3(0, 0, 0); final Vector3 vec2 = vec1.clone(); assertEquals(vec1, vec2); assertNotSame(vec1, vec2); }
/** * Recalculates the surface normal of the triangle by crossing the vectors formed by BA and CA. */ protected void calculateNormal() { if (_normal == null) { _normal = _pointB.clone(); } else { _normal.set(_pointB); } _normal.subtractLocal(_pointA).crossLocal(_pointC.getX() - _pointA.getX(), _pointC.getY() - _pointA.getY(), _pointC.getZ() - _pointA.getZ()); _normal.normalizeLocal(); _dirtyNormal = false; }
/** * Recalculates the surface normal of the triangle by crossing the vectors formed by BA and CA. */ protected void calculateNormal() { if (_normal == null) { _normal = _pointB.clone(); } else { _normal.set(_pointB); } _normal.subtractLocal(_pointA).crossLocal(_pointC.getX() - _pointA.getX(), _pointC.getY() - _pointA.getY(), _pointC.getZ() - _pointA.getZ()); _normal.normalizeLocal(); _dirtyNormal = false; }