当前位置: 首页>>代码示例>>Java>>正文


Java Decal.rotateX方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.decals.Decal.rotateX方法的典型用法代码示例。如果您正苦于以下问题:Java Decal.rotateX方法的具体用法?Java Decal.rotateX怎么用?Java Decal.rotateX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.g3d.decals.Decal的用法示例。


在下文中一共展示了Decal.rotateX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: inserted

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
@Override
public void inserted(int entityId, RenderSystem renderSystem) {
    RenderComponent render = renderSystem.getMapperRender().get(entityId);
    PositionComponent position = renderSystem.getMapperPosition().get(entityId);
    if (render.animations.size == 0) {
        for (Map.Entry<String, RenderComponent.RenderTemplate.AnimationTemplate> entry : render.renderTemplate.animationTemplates.entrySet()) {
            TextureRegion texture = renderSystem.getLevelAssets().get(entry.getValue().texture);

            TextureRegion[][] tmp = texture.split(
                    +texture.getRegionWidth() / entry.getValue().frameColumns,
                    +texture.getRegionHeight() / entry.getValue().frameRows);
            TextureRegion[] frames = new TextureRegion[entry.getValue().frameColumns * entry.getValue().frameRows];
            int index = 0;
            for (int i = 0; i < entry.getValue().frameRows; i++) {
                for (int j = 0; j < entry.getValue().frameColumns; j++) {
                    frames[index++] = tmp[i][j];
                }
            }
            render.animations.put(entry.getKey(), new Animation<TextureRegion>(entry.getValue().frameDuration, new Array<>(frames), Animation.PlayMode.LOOP));
        }
    }
    Decal decal = Decal.newDecal(render.width, render.height, render.getCurrentKeyFrame(renderSystem.getStateTime()), render.transparent);
    decal.rotateX(renderSystem.getWorldDegree());
    decal.setPosition(position.position.x, position.position.y, 0);
    renderSystem.getDecalMap().put(entityId, decal);
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:27,代码来源:BulletRenderer.java

示例2: LayeredEntity

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public LayeredEntity(float x, float y, float z, String texturePath, int numberOfLayers){
	setPosition(x,y,z);
	this.numberOfLayers = numberOfLayers;
	
	tag = "";
	
	decalList = new ArrayList<Decal>();
	Texture t = MyGdxGame.assetManager.get(texturePath, Texture.class);
	width = t.getWidth() / numberOfLayers;
	depth = t.getHeight();
	height = numberOfLayers;
	TextureRegion tr = new TextureRegion(t);
	for(int i = 0; i < numberOfLayers; i++){
		tr.setRegion(i * width, 0, width, depth);
		Decal decal = Decal.newDecal(tr, true);
		decal.setPosition(x, y + i * LAYER_SIZE, z);
		decal.rotateX(-90);
		decalList.add(decal);
	}
	velocity = new Vector3();
	maxVelocity = new Vector3();
	drag = new Vector3();
	
}
 
开发者ID:MisterYO1122,项目名称:utilsLibGDX,代码行数:25,代码来源:LayeredEntity.java

示例3: sonarDecal

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public Decal sonarDecal() {
  Decal decal = Decal.newDecal(this.effectsAtlas.findRegion("sonar_ping"), true);
  decal.setWidth(1);
  decal.setHeight(1);
  decal.rotateX(90);
  return decal;
}
 
开发者ID:macbury,项目名称:BotLogic,代码行数:8,代码来源:SpritesManager.java

示例4: inserted

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
@Override
public void inserted(int entityId, RenderSystem renderSystem) {
    if (cameraBar == null) {
        cameraBar = new OrthographicCamera(renderSystem.getLevelAssets().health_bar_gradient.getWidth(),
                renderSystem.getLevelAssets().health_bar_gradient.getHeight());
        uiCamera = new OrthographicCamera(UI_WIDTH, UI_HEIGHT);
    }

    RenderComponent render = renderSystem.getMapperRender().get(entityId);
    PositionComponent position = renderSystem.getMapperPosition().get(entityId);
    if (render.animations.size == 0) {
        for (Map.Entry<String, RenderComponent.RenderTemplate.AnimationTemplate> entry : render.renderTemplate.animationTemplates.entrySet()) {
            TextureRegion texture = renderSystem.getLevelAssets().get(entry.getValue().texture);

            TextureRegion[][] tmp = texture.split(
                    +texture.getRegionWidth() / entry.getValue().frameColumns,
                    +texture.getRegionHeight() / entry.getValue().frameRows);
            TextureRegion[] frames = new TextureRegion[entry.getValue().frameColumns * entry.getValue().frameRows];
            int index = 0;
            for (int i = 0; i < entry.getValue().frameRows; i++) {
                for (int j = 0; j < entry.getValue().frameColumns; j++) {
                    frames[index++] = tmp[i][j];
                }
            }
            render.animations.put(entry.getKey(), new Animation<>(entry.getValue().frameDuration, new Array<>(frames), entry.getValue().playMode));
            render.stateTimes.put(entry.getKey(), 0f);
        }
    }
    Decal decal = Decal.newDecal(render.width, render.height, render.getCurrentKeyFrame(renderSystem.getStateTime()), render.transparent);
    decal.rotateX(renderSystem.getWorldDegree());
    decal.setPosition(position.position.x, position.position.y, 0);
    renderSystem.getDecalMap().put(entityId, decal);

    FrameBuffer buffer = new FrameBuffer(Pixmap.Format.RGBA8888, UI_WIDTH, UI_HEIGHT, false);
    Assets.LevelAssets levelAssets = renderSystem.getLevelAssets();
    FrameBuffer healthBuffer = new FrameBuffer(Pixmap.Format.RGBA8888, levelAssets.health_bar_gradient.getWidth(), levelAssets.health_bar_gradient.getHeight(), false);
    TextureRegion healthBar = new TextureRegion(healthBuffer.getColorBufferTexture());
    healthBar.flip(false, true);
    FrameBuffer resourceBuffer = new FrameBuffer(Pixmap.Format.RGBA8888, levelAssets.health_bar_gradient.getWidth(), levelAssets.health_bar_gradient.getHeight(), false);
    TextureRegion resourceBar = new TextureRegion(resourceBuffer.getColorBufferTexture());
    resourceBar.flip(false, true);

    healthBars.put(entityId, healthBar);
    resourceBars.put(entityId, resourceBar);

    healthBuffers.put(entityId, healthBuffer);
    resourceBuffers.put(entityId, resourceBuffer);

    buffer.getColorBufferTexture().setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
    renderSystem.getBuffers().put(entityId, buffer);

    TextureRegion uiTextureRegion = new TextureRegion(buffer.getColorBufferTexture());
    uiTextureRegion.flip(false, true);
    Decal uiDecal = Decal.newDecal(1.8f, 1f, uiTextureRegion, true);
    uiDecal.setPosition(position.position.x, position.position.y, 1);
    renderSystem.getUiMap().put(entityId, uiDecal);
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:58,代码来源:CharacterRenderer.java


注:本文中的com.badlogic.gdx.graphics.g3d.decals.Decal.rotateX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。