OSDN Git Service

- add name to camera and light (not being part of the scenegraph is no reason to...
authornormen667 <normen667@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Mon, 4 Apr 2011 13:00:12 +0000 (13:00 +0000)
committernormen667 <normen667@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Mon, 4 Apr 2011 13:00:12 +0000 (13:00 +0000)
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7181 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

engine/src/core/com/jme3/light/Light.java
engine/src/core/com/jme3/renderer/Camera.java

index ef4c5ed..41cc23b 100644 (file)
@@ -77,6 +77,9 @@ public abstract class Light implements Savable, Cloneable {
      */
     protected boolean enabled = true;
 
+    /** The light's name. */
+    protected String name;
+
     /**
      * @return The color of the light.
      */
@@ -84,6 +87,22 @@ public abstract class Light implements Savable, Cloneable {
         return color;
     }
 
+    /**
+     * This method sets the light's name.
+     * @param name the light's name
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * This method returns the light's name.
+     * @return the light's name
+     */
+    public String getName() {
+        return name;
+    }
+
     public void setLastDistance(float lastDistance){
         this.lastDistance = lastDistance;
     }
index 01048b7..0c4ae0a 100644 (file)
@@ -208,6 +208,9 @@ public class Camera implements Savable, Cloneable {
     protected Matrix4f viewProjectionMatrix = new Matrix4f();
     private BoundingBox guiBounding = new BoundingBox();
 
+    /** The camera's name. */
+    protected String name;
+
     /**
      * Constructor instantiates a new <code>Camera</code> object. All
      * values of the camera are set to default.
@@ -285,6 +288,22 @@ public class Camera implements Savable, Cloneable {
     }
 
     /**
+     * This method sets the cameras name.
+     * @param name the cameras name
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * This method returns the cameras name.
+     * @return the cameras name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
      * Sets a clipPlane for this camera.
      * The cliPlane is used to recompute the projectionMatrix using the plane as the near plane
      * This technique is known as the oblique near-plane clipping method introduced by Eric Lengyel