- add name to camera and light (not being part of the scenegraph is no reason to be nameless)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7181 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 041f47157d
commit d5db0aef1f
  1. 19
      engine/src/core/com/jme3/light/Light.java
  2. 19
      engine/src/core/com/jme3/renderer/Camera.java

@ -77,6 +77,9 @@ public abstract class Light implements Savable, Cloneable {
*/ */
protected boolean enabled = true; protected boolean enabled = true;
/** The light's name. */
protected String name;
/** /**
* @return The color of the light. * @return The color of the light.
*/ */
@ -84,6 +87,22 @@ public abstract class Light implements Savable, Cloneable {
return color; 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){ public void setLastDistance(float lastDistance){
this.lastDistance = lastDistance; this.lastDistance = lastDistance;
} }

@ -208,6 +208,9 @@ public class Camera implements Savable, Cloneable {
protected Matrix4f viewProjectionMatrix = new Matrix4f(); protected Matrix4f viewProjectionMatrix = new Matrix4f();
private BoundingBox guiBounding = new BoundingBox(); private BoundingBox guiBounding = new BoundingBox();
/** The camera's name. */
protected String name;
/** /**
* Constructor instantiates a new <code>Camera</code> object. All * Constructor instantiates a new <code>Camera</code> object. All
* values of the camera are set to default. * values of the camera are set to default.
@ -284,6 +287,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. * Sets a clipPlane for this camera.
* The cliPlane is used to recompute the projectionMatrix using the plane as the near plane * The cliPlane is used to recompute the projectionMatrix using the plane as the near plane

Loading…
Cancel
Save