/** * Creates a PointLight at the given position, with the given color and the * given radius * @param position the position in world space * @param color the light color * @param radius the light radius */ public PointLight(Vector3f position, ColorRGBA color, float radius) { this(position, color); setRadius(radius); }
/** * Creates a SpotLight at the given position and with the given direction. * @param position the position in world space. * @param direction the direction of the light. */ public SpotLight(Vector3f position, Vector3f direction) { this(); setPosition(position); setDirection(direction); }
/** * Creates a PointLight at the given position * @param position the position in world space */ public PointLight(Vector3f position) { setPosition(position); }
/** * Creates a SpotLight at the given position, with the given direction and * the given color. * @param position the position in world space. * @param direction the direction of the light. * @param color the light's color. */ public SpotLight(Vector3f position, Vector3f direction, ColorRGBA color) { super(color); computeAngleParameters(); setPosition(position); setDirection(direction); }
/** * Creates a DirectionalLight with the given direction * @param direction the light's direction */ public DirectionalLight(Vector3f direction) { setDirection(direction); }
private void checkFilteredLights(int expected) { geom.updateGeometricState(); filter.setCamera(cam); // setCamera resets the intersection cache list.clear(); filter.filterLights(geom, list); assert list.size() == expected; }
/** * Removes the given light from the LightList. * * @param l the light to remove */ public void remove(Light l){ for (int i = 0; i < listSize; i++){ if (list[i] == l){ remove(i); return; } } }
/** * Adds a light to the list. List size is doubled if there is no room. * * @param l * The light to add. */ public void add(Light l) { if (listSize == list.length) { doubleSize(); } list[listSize] = l; distToOwner[listSize++] = Float.NEGATIVE_INFINITY; }
public void setAreaType(AreaType type){ switch (type){ case Spherical: area = new SphereProbeArea(Vector3f.ZERO, 1.0f); break; case OrientedBox: area = new OrientedBoxProbeArea(new Transform()); area.setCenter(position); break; } }
/** * Creates a SpotLight. */ public SpotLight() { super(); computeAngleParameters(); }
@Override public void setRadius(float radius) { this.radius = radius; updateMatrix(); }
@Override public boolean intersectsFrustum(Camera camera, TempVars vars) { return area.intersectsFrustum(camera, vars); }
@Override public boolean intersectsSphere(BoundingSphere sphere, TempVars vars) { return area.intersectsSphere(sphere, vars); }
@Override protected OrientedBoxProbeArea clone() throws CloneNotSupportedException { return new OrientedBoxProbeArea(transform); }
@Override public boolean intersectsBox(BoundingBox box, TempVars vars) { return area.intersectsBox(box, vars); }
/** * Creates a DirectionalLight with the given direction and the given color * @param direction the light's direction * @param color the light's color */ public DirectionalLight(Vector3f direction, ColorRGBA color) { super(color); setDirection(direction); }
/** * Creates a PointLight at the given position, with the given radius * @param position the position in world space * @param radius the light radius */ public PointLight(Vector3f position, float radius) { this(position); setRadius(radius); }
/** * Creates a PointLight at the given position and with the given color * @param position the position in world space * @param color the light color */ public PointLight(Vector3f position, ColorRGBA color) { super(color); setPosition(position); }
private void setDir(Vector3f v) { l.setDirection(v); } }