Java 类com.badlogic.gdx.graphics.g3d.environment.BaseLight 实例源码

项目:GdxDemo3D    文件:GameRenderer.java   
public void setEnvironmentLights(Array<BaseLight<?>> lights, Vector3 sunDirection) {
    environment = new Environment();
    environment.add((shadowLight = new DirectionalShadowLight(
            GameSettings.SHADOW_MAP_WIDTH,
            GameSettings.SHADOW_MAP_HEIGHT,
            GameSettings.SHADOW_VIEWPORT_WIDTH,
            GameSettings.SHADOW_VIEWPORT_HEIGHT,
            GameSettings.SHADOW_NEAR,
            GameSettings.SHADOW_FAR))
            .set(GameSettings.SHADOW_INTENSITY,
                    GameSettings.SHADOW_INTENSITY,
                    GameSettings.SHADOW_INTENSITY,
                    sunDirection.nor()));
    environment.shadowMap = shadowLight;

    float ambientLight = GameSettings.SCENE_AMBIENT_LIGHT;
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, ambientLight, ambientLight, ambientLight, 1));
    for (BaseLight<?> light : lights) {
        environment.add(light);
    }
}
项目:libgdxcn    文件:Environment.java   
public Environment add (BaseLight light) {
    if (light instanceof DirectionalLight)
        directionalLights.add((DirectionalLight)light);
    else if (light instanceof PointLight)
        pointLights.add((PointLight)light);
    else
        throw new GdxRuntimeException("Unknown light type");
    return this;
}
项目:libgdxcn    文件:Environment.java   
public Environment remove (BaseLight light) {
    if (light instanceof DirectionalLight)
        directionalLights.removeValue((DirectionalLight)light, false);
    else if (light instanceof PointLight)
        pointLights.removeValue((PointLight)light, false);
    else
        throw new GdxRuntimeException("Unknown light type");
    return this;
}
项目:libgdxcn    文件:Environment.java   
public Environment add (final BaseLight... lights) {
    for (final BaseLight light : lights)
        add(light);
    return this;
}
项目:libgdxcn    文件:Environment.java   
public Environment add (final Array<BaseLight> lights) {
    for (final BaseLight light : lights)
        add(light);
    return this;
}
项目:libgdxcn    文件:Environment.java   
public Environment remove (final BaseLight... lights) {
    for (final BaseLight light : lights)
        remove(light);
    return this;
}
项目:libgdxcn    文件:Environment.java   
public Environment remove (final Array<BaseLight> lights) {
    for (final BaseLight light : lights)
        remove(light);
    return this;
}