diff --git a/jme3-core/src/main/java/com/jme3/light/AmbientLight.java b/jme3-core/src/main/java/com/jme3/light/AmbientLight.java index e147c6590..fb52301f9 100644 --- a/jme3-core/src/main/java/com/jme3/light/AmbientLight.java +++ b/jme3-core/src/main/java/com/jme3/light/AmbientLight.java @@ -32,6 +32,7 @@ package com.jme3.light; import com.jme3.bounding.BoundingBox; +import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; import com.jme3.renderer.Camera; import com.jme3.scene.Spatial; @@ -49,6 +50,21 @@ import com.jme3.util.TempVars; */ public class AmbientLight extends Light { + /** + * Default constructor for AmbientLight. + */ + public AmbientLight() { + } + + /** + * Constructor which allows setting of the color. + * + * @param color the color to apply to this light. + */ + public AmbientLight(final ColorRGBA color) { + super(color); + } + @Override public boolean intersectsBox(BoundingBox box, TempVars vars) { return true; diff --git a/jme3-core/src/main/java/com/jme3/light/DirectionalLight.java b/jme3-core/src/main/java/com/jme3/light/DirectionalLight.java index c4258a67f..7f1541fda 100644 --- a/jme3-core/src/main/java/com/jme3/light/DirectionalLight.java +++ b/jme3-core/src/main/java/com/jme3/light/DirectionalLight.java @@ -36,6 +36,7 @@ import com.jme3.export.InputCapsule; import com.jme3.export.JmeExporter; import com.jme3.export.JmeImporter; import com.jme3.export.OutputCapsule; +import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; import com.jme3.renderer.Camera; import com.jme3.scene.Spatial; @@ -53,6 +54,32 @@ public class DirectionalLight extends Light { protected Vector3f direction = new Vector3f(0f, -1f, 0f); + /** + * Default constructor for DirectionalLight. Direction will be defaulted to -1 on the Y axis. + */ + public DirectionalLight() { + } + + /** + * Constructor which allows setting of the direction. + * + * @param direction the direction vector for the light. + */ + public DirectionalLight(final Vector3f direction) { + this.direction = direction; + } + + /** + * Constructor which allows setting of the color and direction. + * + * @param color the color to apply to this light. + * @param direction the direction vector for the light. + */ + public DirectionalLight(final ColorRGBA color, final Vector3f direction) { + super(color); + this.direction = direction; + } + @Override public void computeLastDistance(Spatial owner) { lastDistance = 0; // directional lights are always closest to their owner diff --git a/jme3-core/src/main/java/com/jme3/light/Light.java b/jme3-core/src/main/java/com/jme3/light/Light.java index 4217e1b62..7738c1721 100644 --- a/jme3-core/src/main/java/com/jme3/light/Light.java +++ b/jme3-core/src/main/java/com/jme3/light/Light.java @@ -115,6 +115,22 @@ public abstract class Light implements Savable, Cloneable { boolean frustumCheckNeeded = true; boolean intersectsFrustum = false; + /** + * 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. * diff --git a/jme3-core/src/main/java/com/jme3/light/PointLight.java b/jme3-core/src/main/java/com/jme3/light/PointLight.java index 55a129275..1e93e1f1e 100644 --- a/jme3-core/src/main/java/com/jme3/light/PointLight.java +++ b/jme3-core/src/main/java/com/jme3/light/PointLight.java @@ -38,6 +38,7 @@ import com.jme3.export.InputCapsule; import com.jme3.export.JmeExporter; import com.jme3.export.JmeImporter; import com.jme3.export.OutputCapsule; +import com.jme3.math.ColorRGBA; import com.jme3.math.FastMath; import com.jme3.math.Plane; import com.jme3.math.Vector3f; @@ -62,6 +63,41 @@ public class PointLight extends Light { protected float radius = 0; protected float invRadius = 0; + /** + * Default constructor for PointLight. + *
+ *
+ *