Example usage for com.badlogic.gdx.graphics.g3d.particles ParticleEffect rotate

List of usage examples for com.badlogic.gdx.graphics.g3d.particles ParticleEffect rotate

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d.particles ParticleEffect rotate.

Prototype

public void rotate(Vector3 axis, float angle) 

Source Link

Document

Applies the rotation by the given angle around the given axis to the current transformation matrix of each controller.

Usage

From source file:com.mygdx.game.scene.GameScene.java

License:Apache License

private GameObject spawnFromBlueprint(GameObjectBlueprint bp) {
    if (bp.pfx != null) {
        ParticleEffect originalEffect = assets.getAsset(bp.pfx, ParticleEffect.class);
        // we cannot use the originalEffect, we must make a copy each time we create new particle effect
        ParticleEffect effect = originalEffect.copy();
        particleEffects.add(effect);/*from   w  ww  .j  a v  a  2 s. c o  m*/
        effect.translate(bp.position);
        effect.rotate(Vector3.X, 180);
        effect.init();
        effect.start();
        ParticleSystem particleSystem = ParticleSystem.get();
        particleSystem.add(effect);
        return null;
    }
    if (bp.model != null && bp.shape != null) {

        return spawnGameModelBody(bp, bp.position);

    } else if (bp.model == null && bp.shape != null) {
        InvisibleBody obj = new InvisibleBody(bp.name, bp.shape, bp.mass, bp.position, bp.rotation,
                bp.belongsToFlag, bp.collidesWithFlag, bp.callback, bp.noDeactivate);
        addGameObject(obj);
        return obj;

    } else if (bp.model != null) {
        GameModel obj = new GameModel(bp.model, bp.name, bp.position, bp.rotation, bp.scale);
        obj.visibleOnLayers.clear();
        obj.visibleOnLayers.or(bp.visibleOnLayers);
        addGameObject(obj);
        return obj;
    } else {
        throw new GdxRuntimeException("Could not read blueprint " + bp);
    }
}