本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.environment.DirectionalLight.set方法的典型用法代码示例。如果您正苦于以下问题:Java DirectionalLight.set方法的具体用法?Java DirectionalLight.set怎么用?Java DirectionalLight.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.g3d.environment.DirectionalLight
的用法示例。
在下文中一共展示了DirectionalLight.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: begin
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight; //导入方法依赖的package包/类
@Override
public void begin (final Camera camera, final RenderContext context) {
super.begin(camera, context);
for (final DirectionalLight dirLight : directionalLights)
dirLight.set(0, 0, 0, 0, -1, 0);
for (final PointLight pointLight : pointLights)
pointLight.set(0, 0, 0, 0, 0, 0, 0);
lightsSet = false;
if (has(u_time)) set(u_time, time += Gdx.graphics.getDeltaTime());
}
示例2: addDirectionalLight
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight; //导入方法依赖的package包/类
public void addDirectionalLight(float r, float g, float b, float x, float y, float z) {
DirectionalLight dl = new DirectionalLight();
dl.set(r, g, b, x, y, z);
env.add(dl);
}
示例3: View
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight; //导入方法依赖的package包/类
public View() {
ModelManager modelManager = new ModelManager();
modelManager.init();
storeSize();
inst = this;
gl = Gdx.graphics.getGL20();
float fov = 67f;
camera = new PerspectiveCamera(fov, width(), height());
// camera.far affects frustrum culling, so a shorter distance can boost performance
camera.far = 60f;
camera.near = 0.01f;
resetCamera();
initShaders();
modelBatch = new ModelBatch(shaderProvider);
environ = new Environment();
basicEnviron = new Environment();
camLight = new PointLight();
float intensity = 100f;
camLight.set(new Color(0.2f, 0.2f, 0.2f, 1f), 0f, 0f, 0f, intensity);
ColorAttribute ambientLight = ColorAttribute.createAmbient(new Color(0.1f, 0.1f, 0.1f, 1f));
environ.set(ambientLight);
ColorAttribute fog = new ColorAttribute(ColorAttribute.Fog);
fog.color.set(fogColor);
environ.set(fog);
environ.add(camLight);
dirLight = new DirectionalLight();
dirLight.set(new Color(0.3f, 0.3f, 0.35f, 1f), -0.25f, -0.75f, 0.25f);
environ.add(dirLight);
basicEnviron.set(ColorAttribute.createAmbient(0.3f, 0.3f, 0.3f, 1f));
if (Toggleable.profileGL()) {
Profiler.enable();
}
hud = new HUD();
Sky.createSkyBox(
Assets.manager.get("textures/skybox/xpos.png", Texture.class),
Assets.manager.get("textures/skybox/xneg.png", Texture.class),
Assets.manager.get("textures/skybox/ypos.png", Texture.class),
Assets.manager.get("textures/skybox/yneg.png", Texture.class),
Assets.manager.get("textures/skybox/zpos.png", Texture.class),
Assets.manager.get("textures/skybox/zneg.png", Texture.class)
);
}