本文整理匯總了Java中com.badlogic.gdx.graphics.g3d.ModelBatch.render方法的典型用法代碼示例。如果您正苦於以下問題:Java ModelBatch.render方法的具體用法?Java ModelBatch.render怎麽用?Java ModelBatch.render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.graphics.g3d.ModelBatch
的用法示例。
在下文中一共展示了ModelBatch.render方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch, Environment environment) {
if (drawShapes) {
batch.render(hub.modelInstance, environment);
batch.render(rim.modelInstance, environment);
for (int i = 0; i < spokesToDraw; i++) {
spokes.get(i).updateSpokeRender();
batch.render(spokes.get(i).modelInstance, environment);
}
// spokes.forEach(s -> batch.render(s.modelInstance, environment));
// bulletWorld.updateAabbs();
}
if (debugDrawer.getDebugMode() > 0) {
Camera camera = batch.getCamera();
batch.flush();
debugDrawer.begin(camera);
bulletWorld.debugDrawWorld();
debugDrawer.end();
}
}
示例2: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch, Environment environment) {
if (drawShapes) {
for (WorldEntity entity : entities) {
batch.render(entity.instance, environment);
}
batch.render(instances);
}
if (getDebugMode() > 0) {
Camera camera = batch.getCamera();
batch.flush();
debugDrawer.begin(camera);
bulletWorld.debugDrawWorld();
debugDrawer.end();
// batch.begin(camera);
}
}
示例3: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
@Override
protected void render (ModelBatch batch, Array<ModelInstance> instances) {
final float delta = Gdx.graphics.getDeltaTime();
dirLight.direction.rotate(Vector3.X, delta * 45f);
dirLight.direction.rotate(Vector3.Y, delta * 25f);
dirLight.direction.rotate(Vector3.Z, delta * 33f);
pointLight.position.sub(transformedCenter);
pointLight.position.rotate(Vector3.X, delta * 50f);
pointLight.position.rotate(Vector3.Y, delta * 13f);
pointLight.position.rotate(Vector3.Z, delta * 3f);
pointLight.position.add(transformedCenter.set(center).mul(transform));
pLight.worldTransform.setTranslation(pointLight.position);
batch.render(pLight);
super.render(batch, instances);
}
示例4: draw
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
@Override
public void draw(ModelBatch modelBatch, Environment environment,
boolean pourOmbre) {
if (model == null)
return;
if (InGame.wallhack && !pourOmbre) {
InGame.shapeRenderer.setTransformMatrix(model.transform);
InGame.shapeRenderer.box(-sizeBox.x * 0.5f, 0, sizeBox.z * 0.5f,
sizeBox.x, sizeBox.y, sizeBox.z);
}
//
transform.scale(size.x, size.y, size.z);
// System.out.println(this);
model.transform.rotate(Vector3.X, -baseRotationY);
transform.rotate(Vector3.Z, angleY);
modelBatch.render(model, environment);
transform.rotate(Vector3.Z, -angleY);
model.transform.rotate(Vector3.X, baseRotationY);
transform.scale(1f / size.x, 1f / size.y, 1f / size.z);
//
// transform.rotate(Vector3.X, -anglePenche);
}
示例5: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch) {
update();
fbo().begin();
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
batch.begin(camera());
batch.render(world.renderables());
batch.end();
if(Gdx.input.isKeyJustPressed(Input.Keys.F2))
ScreenshotFactory.saveScreenshot(fbo().getWidth(), fbo().getHeight(), "Light");
fbo().end();
}
示例6: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch) {
if (model != null) {
// TODO: support subtle action. need to create instance every time?
ModelInstance instance = new ModelInstance(model);
instance.materials.get(0).set(TextureAttribute.createDiffuse(texture));
instance.transform.translate(position.getX(), position.getY(), position.getZ());
batch.render(instance);
}
}
示例7: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch, Environment environment){
batch.render(l1,environment);
batch.render(l2,environment);
batch.render(l3,environment);
batch.render(l4,environment);
batch.render(l5,environment);
batch.render(l6,environment);
}
示例8: renderShadow
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
@Override
public void renderShadow(ModelBatch batch, Environment environment){
batch.render(e(),environment);
batch.render(f(),environment);
batch.render(g(), environment);
batch.render(h(),environment);
batch.render(e2,environment);
batch.render(f2,environment);
batch.render(g2, environment);
batch.render(h2,environment);
}
示例9: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch, Environment environment, boolean planetOnly, Vector3 rocketPosition) {
for (Map.Entry<Point, PlanetPart> entry : planetPartBuffer.entrySet()) {
PlanetPart planetPart = entry.getValue();
renderEnv(planetPart.getModelInstance(), batch, environment);
}
waterModelInstance.transform.setToTranslation(rocketPosition.x, rocketPosition.y, infiniteWaterHeight);
renderEnv(waterModelInstance, batch, environment);
if (planetOnly) {
return;
}
planetPortal.render(batch, environment);
environmentSphere.transform.idt();
environmentSphere.transform.setToTranslation(rocketPosition.x, rocketPosition.y, 0);
environmentSphere.transform.scl(1000);
batch.render(environmentSphere);
for (Collectible c : currentVisibleCollectibles) {
renderEnv(c.getModelInstance(), batch, environment);
}
for (ArtifactObject o : currentVisibleArtifacts) {
renderEnv(o.getModelInstance(), batch, environment);
}
for (RaceWayPoint r : currentlyVisibleRaceWayPoints) {
if (r.getTrigger() != null) {
renderEnv(r.getModelInstance(), batch, null);
}
}
}
示例10: renderEnv
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
private void renderEnv(ModelInstance model, ModelBatch batch, Environment environment) {
if (environment != null) {
batch.render(model, environment);
} else {
batch.render(model);
}
}
示例11: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void render(ModelBatch batch, Environment environment) {
batch.render(planetPortal, environment);
rot01++;
planetPortalTorus01.transform.setToRotation(0, 1, 0, 30);
planetPortalTorus01.transform.rotate(1, 0, 0, rot01);
planetPortalTorus01.transform.trn(ppt01Position);
rot02--;
planetPortalTorus02.transform.setToRotation(0, 1, 0, 30);
planetPortalTorus02.transform.rotate(1, 0, 0, rot02);
planetPortalTorus02.transform.trn(ppt02Position);
rot03++;
planetPortalTorus03.transform.setToRotation(0, 1, 0, 30);
planetPortalTorus03.transform.rotate(1, 0, 0, rot03);
planetPortalTorus03.transform.trn(ppt03Position);
rot04--;
planetPortalTorus04.transform.setToRotation(0, 1, 0, 30);
planetPortalTorus04.transform.rotate(1, 0, 0, rot04);
planetPortalTorus04.transform.trn(ppt04Position);
batch.render(planetPortalTorus01, environment);
batch.render(planetPortalTorus02, environment);
batch.render(planetPortalTorus03, environment);
batch.render(planetPortalTorus04, environment);
}
示例12: drawModel
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
public void drawModel(ModelBatch modelBatch, Environment environment, ParticleEffect[] thrustEffect,
ParticleEffect effectExplosion) {
if (!exploded) {
modelBatch.render(rocketModelInstance, environment);
long damageDelay = System.currentTimeMillis() - lastDamageTime;
if (damageDelay < MIN_DAMAGE_DELAY_MILLIS) {
float opacity = (float) damageDelay / (float) (MIN_DAMAGE_DELAY_MILLIS);
((BlendingAttribute) shieldModelInstance.materials.get(0).get(BlendingAttribute.Type)).opacity = opacity;
modelBatch.render(shieldModelInstance, environment);
}
if (tractorBeamVisible) {
modelBatch.render(tractorBeamModelInstance, environment);
}
}
thrustMatrix1.set(rocketModelInstance.transform);
tmpMatrix.setToRotation(0, 1, 0, drill);
tmpMatrix.trn(0, 1, 0.35f);
thrustMatrix1.mul(tmpMatrix);
thrustEffect[0].setTransform(thrustMatrix1);
thrustMatrix2.set(rocketModelInstance.transform);
tmpMatrix.setToRotation(0, 1, 0, drill);
tmpMatrix.trn(-0.35f, 1, -0.20f);
thrustMatrix2.mul(tmpMatrix);
thrustEffect[1].setTransform(thrustMatrix2);
thrustMatrix3.set(rocketModelInstance.transform);
tmpMatrix.setToRotation(0, 1, 0, drill);
tmpMatrix.trn(0.350f, 1, -0.25f);
thrustMatrix3.mul(tmpMatrix);
thrustEffect[2].setTransform(thrustMatrix3);
effectExplosion.setTransform(rocketModelInstance.transform);
}
示例13: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
@Override
protected void render (ModelBatch batch, Array<ModelInstance> instances) {
if (lighting) {
batch.render(instances, environment);
} else {
batch.render(instances);
}
}
示例14: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
/**
* Model rendering.
*/
@Override
public void render(ModelBatch modelBatch, float alpha, double t) {
mc.touch();
mc.setTransparency(alpha * cc[3] * opacity);
modelBatch.render(mc.instance, mc.env);
}
示例15: render
import com.badlogic.gdx.graphics.g3d.ModelBatch; //導入方法依賴的package包/類
/**
* Model rendering
*/
@Override
public void render(ModelBatch modelBatch, float alpha, double t) {
mc.touch();
float opct = (float) MathUtilsd.lint(closestDist, modelDist / 50f, modelDist, 1f, 0f);
if (alpha * opct > 0) {
mc.setTransparency(alpha * opct);
float[] col = closestCol;
((ColorAttribute) mc.env.get(ColorAttribute.AmbientLight)).color.set(col[0], col[1], col[2], 1f);
((FloatAttribute) mc.env.get(FloatAttribute.Shininess)).value = (float) t;
// Local transform
mc.instance.transform.idt().translate((float) closestPos.x, (float) closestPos.y, (float) closestPos.z).scl((float) (getRadius(active[0]) * 2d));
modelBatch.render(mc.instance, mc.env);
}
}