Home | History | Annotate | Download | only in control

Lines Matching refs:light

36 import com.jme3.light.DirectionalLight;
37 import com.jme3.light.Light;
38 import com.jme3.light.PointLight;
57 * Means, that the Light's transform is "copied"
63 * to the Transform of the light.
67 private Light light;
77 * @param light The light to be synced.
79 public LightControl(Light light) {
80 this.light = light;
84 * @param light The light to be synced.
86 public LightControl(Light light, ControlDirection controlDir) {
87 this.light = light;
91 public Light getLight() {
92 return light;
95 public void setLight(Light light) {
96 this.light = light;
110 if (spatial != null && light != null) {
113 spatialTolight(light);
116 lightToSpatial(light);
122 private void spatialTolight(Light light) {
123 if (light instanceof PointLight) {
124 ((PointLight) light).setPosition(spatial.getWorldTranslation());
128 if (light instanceof DirectionalLight) {
129 ((DirectionalLight) light).setDirection(vars.vect1.set(spatial.getWorldTranslation()).multLocal(-1.0f));
132 //TODO add code for Spot light here when it's done
133 // if( light instanceof SpotLight){
134 // ((SpotLight)light).setPosition(spatial.getWorldTranslation());
135 // ((SpotLight)light).setRotation(spatial.getWorldRotation());
140 private void lightToSpatial(Light light) {
142 if (light instanceof PointLight) {
144 PointLight pLight = (PointLight) light;
150 if (light instanceof DirectionalLight) {
151 DirectionalLight dLight = (DirectionalLight) light;
157 //TODO add code for Spot light here when it's done
169 LightControl control = new LightControl(light, controlDir);