Example usage for com.badlogic.gdx.graphics.g3d.decals Decal translate

List of usage examples for com.badlogic.gdx.graphics.g3d.decals Decal translate

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d.decals Decal translate.

Prototype

public void translate(Vector3 trans) 

Source Link

Usage

From source file:com.github.fauu.helix.displayable.CharacterDisplayable.java

License:Open Source License

public CharacterDisplayable(IntVector3 logicalPosition, String animationSetName, TextureRegion shadowTexture) {
    super(logicalPosition.toVector3().add(DEFAULT_DISPLACEMENT));

    animations = new AnimationSet(animationSetName);

    AnimatedDecal decal = AnimatedDecal.newAnimatedDecal(DEFAULT_DIMENSIONS.x, DEFAULT_DIMENSIONS.y,
            animations.getDefault(), true);

    decal.setKeepSize(true);//from  w w  w. j  a  v a2  s .  c o  m
    decal.setPosition(position);
    decal.rotateX(DEFAULT_ROTATION);

    setMainDecal(decal);

    Decal shadow = new Decal();

    shadow.setPosition(position);
    shadow.translate(DEFAULT_SHADOW_DISPLACEMENT);
    shadow.setDimensions(DEFAULT_SHADOW_DIMENSIONS.x, DEFAULT_SHADOW_DIMENSIONS.y);
    shadow.setColor(1, 1, 1, .35f);
    shadow.setTextureRegion(shadowTexture);
    shadow.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

    setShadowDecal(shadow);
}