/** * <code>setLocation</code> sets the position of the light. * * @param location * the position of the light. */ public void setLocation(final ReadOnlyVector3 location) { _location.set(location); }
/** * @param direction * the direction the light is traveling in. */ public void setDirection(final ReadOnlyVector3 direction) { _direction.set(direction); }
/** * Used to determine particle orientation (only if cameraFacing is false.) * * @param vector */ public void setFacingLeftVector(final ReadOnlyVector3 vector) { _facingLeftVector.set(vector); }
/** * setA sets the first point of the rectangle. * * @param a * the first point of the rectangle. */ public void setA(final ReadOnlyVector3 a) { _a.set(a); }
/** * setB sets the second point of the rectangle. * * @param b * the second point of the rectangle. */ public void setB(final ReadOnlyVector3 b) { _b.set(b); }
/** * Sets the line's origin point to the values of the given vector. * * @param origin * @throws NullPointerException * if normal is null. */ public void setOrigin(final ReadOnlyVector3 origin) { _origin.set(origin); }
/** * Sets the line's direction to the values of the given vector. * * @param direction * @throws NullPointerException * if direction is null. */ public void setDirection(final ReadOnlyVector3 direction) { _direction.set(direction); }
/** * Sets the plane normal to the values of the given vector. * * @param normal * @throws NullPointerException * if normal is null. */ public void setNormal(final ReadOnlyVector3 normal) { _normal.set(normal); }
/** * @param direction * the direction the spot light is pointing. */ public void setDirection(final ReadOnlyVector3 direction) { _direction.set(direction); }
/** * Sets the new direction this camera is facing. This does not change left or up axes, so make sure those vectors * are properly set as well. * * @param direction * the new direction this camera is facing. */ public void setDirection(final ReadOnlyVector3 direction) { _direction.set(direction); onFrameChange(); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _extent.set((Vector3) capsule.readSavable("extent", new Vector3(Vector3.ZERO))); _border.set((Vector3) capsule.readSavable("border", new Vector3(Vector3.ZERO))); _slope.set((Vector3) capsule.readSavable("slope", new Vector3(Vector3.ZERO))); } }
public static void drawOBB(final OrientedBoundingBox box, final Renderer r) { boundingOB.getCenter().set(box.getCenter()); boundingOB.getxAxis().set(box.getXAxis()); boundingOB.getYAxis().set(box.getYAxis()); boundingOB.getZAxis().set(box.getZAxis()); boundingOB.getExtent().set(box.getExtent()); boundingOB.computeInformation(); boundingOB.draw(r); }
/** * Internally modifies the values of this vector by dividing them each by the given scale values. * * @param x * @param y * @param z * @return this vector for chaining */ public Vector3 divideLocal(final double x, final double y, final double z) { return set(getX() / x, getY() / y, getZ() / z); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _direction.set((Vector3) capsule.readSavable("direction", new Vector3(Vector3.UNIT_Z))); _angle = capsule.readFloat("angle", 0); _exponent = capsule.readFloat("exponent", 0); }
public Vector3 getPositiveEnd(final Vector3 store) { Vector3 result = store; if (result == null) { result = new Vector3(); } result.set(getDirection()).multiplyLocal(_extent); result.addLocal(getOrigin()); return result; }
public Vector3 getNegativeEnd(final Vector3 store) { Vector3 result = store; if (result == null) { result = new Vector3(); } result.set(getDirection()).multiplyLocal(-_extent); result.addLocal(getOrigin()); return result; }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _strength = capsule.readDouble("strength", 1.0); _windDirection.set((Vector3) capsule.readSavable("windDirection", new Vector3(Vector3.UNIT_X))); _random = capsule.readBoolean("random", false); _rotateWithScene = capsule.readBoolean("rotateWithScene", true); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _xExtent = capsule.readDouble("xExtent", 0); _yExtent = capsule.readDouble("yExtent", 0); _zExtent = capsule.readDouble("zExtent", 0); _center.set((Vector3) capsule.readSavable("center", new Vector3(Vector3.ZERO))); } }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _xExtent = capsule.readDouble("xExtent", 0); _yExtent = capsule.readDouble("yExtent", 0); _zExtent = capsule.readDouble("zExtent", 0); _center.set((Vector3) capsule.readSavable("center", new Vector3(Vector3.ZERO))); } }
@Override public boolean intersectsSphere(final BoundingSphere bs) { if (!Vector3.isValid(_center) || !Vector3.isValid(bs._center)) { return false; } final Vector3 diff = _compVect1.set(getCenter()).subtractLocal(bs.getCenter()); final double rsum = getRadius() + bs.getRadius(); return (diff.dot(diff) <= rsum * rsum); }