Reverted some changes to light classes which was not meant to be committed as part of #314.

experimental
Daniel Johansson 9 years ago
parent 9ba90251d6
commit 88bf9d4580
  1. 16
      jme3-core/src/main/java/com/jme3/light/Light.java
  2. 28
      jme3-core/src/main/java/com/jme3/light/PointLight.java

@ -122,22 +122,6 @@ public abstract class Light implements Savable, Cloneable {
setColor(color);
}
/**
* Default constructor for Light.
*/
public Light() {
}
/**
* Constructor which allows setting of the color.
*
* @param color the color to apply to this light.
*/
public Light(final ColorRGBA color) {
this.color = color;
}
/**
* Returns the color of the light.
*

@ -53,7 +53,7 @@ import java.io.IOException;
* In addition to a position, point lights also have a radius which
* can be used to attenuate the influence of the light depending on the
* distance between the light and the effected object.
*
*
*/
public class PointLight extends Light {
@ -84,7 +84,7 @@ public class PointLight extends Light {
super(color);
setPosition(position);
}
/**
* Creates a PointLight at the given position, with the given color and the
* given radius
@ -96,7 +96,7 @@ public class PointLight extends Light {
this(position, color);
setRadius(radius);
}
/**
* Creates a PointLight at the given position, with the given radius
* @param position the position in world space
@ -119,10 +119,10 @@ public class PointLight extends Light {
/**
* Returns the world space position of the light.
*
*
* @return the world space position of the light.
*
* @see PointLight#setPosition(com.jme3.math.Vector3f)
*
* @see PointLight#setPosition(com.jme3.math.Vector3f)
*/
public Vector3f getPosition() {
return position;
@ -130,7 +130,7 @@ public class PointLight extends Light {
/**
* Set the world space position of the light.
*
*
* @param position the world space position of the light.
*/
public final void setPosition(Vector3f position) {
@ -140,7 +140,7 @@ public class PointLight extends Light {
/**
* Returns the radius of the light influence. A radius of 0 means
* the light has no attenuation.
*
*
* @return the radius of the light
*/
public float getRadius() {
@ -155,9 +155,9 @@ public class PointLight extends Light {
* is greater than the light's radius, then the pixel will not be
* effected by this light, if the distance is less than the radius, then
* the magnitude of the influence is equal to distance / radius.
*
*
* @param radius the radius of the light influence.
*
*
* @throws IllegalArgumentException If radius is negative
*/
public final void setRadius(float radius) {
@ -192,11 +192,11 @@ public class PointLight extends Light {
} else {
// Sphere v. box collision
return FastMath.abs(box.getCenter().x - position.x) < radius + box.getXExtent()
&& FastMath.abs(box.getCenter().y - position.y) < radius + box.getYExtent()
&& FastMath.abs(box.getCenter().z - position.z) < radius + box.getZExtent();
&& FastMath.abs(box.getCenter().y - position.y) < radius + box.getYExtent()
&& FastMath.abs(box.getCenter().z - position.z) < radius + box.getZExtent();
}
}
@Override
public boolean intersectsFrustum(Camera camera, TempVars vars) {
if (this.radius == 0) {
@ -210,7 +210,7 @@ public class PointLight extends Light {
return true;
}
}
@Override
public void write(JmeExporter ex) throws IOException {
super.write(ex);

Loading…
Cancel
Save