private void spawnLight(BlenderLight bLight) {
Vector3 direction = new Vector3(V3_DOWN);
direction.rotate(Vector3.X, bLight.rotation.x);
direction.rotate(Vector3.Z, bLight.rotation.z);
direction.rotate(Vector3.Y, bLight.rotation.y);
float intensity = bLight.lamp_energy;
float cutoffAngle = bLight.lamp_falloff;
float exponent = 1;
if (bLight.type.equals("PointLamp")) {
BaseLight<?> light = new PointLight().set(
bLight.lamp_color.r, bLight.lamp_color.g, bLight.lamp_color.b,
bLight.position, bLight.lamp_energy);
lights.add(light);
} else if (bLight.type.equals("SpotLamp")) {
BaseLight<?> light = new SpotLight().set(bLight.lamp_color, bLight.position,
direction, intensity, cutoffAngle, exponent);
lights.add(light);
} else if (bLight.type.equals("SunLamp")) {
BaseLight<?> light = new DirectionalLight().set(
bLight.lamp_color.r,
bLight.lamp_color.g,
bLight.lamp_color.b,
direction.x, direction.y, direction.z);
lights.add(light);
shadowCameraDirection.set(direction);
}
}