package electrosphere.renderer.actor;

import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils;

/**
 * Utils for dealing with actors
 */
public class ActorUtils {
    
    /**
     * Creates an actor object and queues the model path
     * @param modelPath The model path
     * @return The actor object
     */
    public static Actor createActorFromModelPath(String modelPath){
        Actor rVal = new Actor(modelPath);
        Globals.assetManager.addModelPathToQueue(modelPath);
        return rVal;
    }

    public static Actor createActorOfLoadingModel(String modelPath){
        Actor rVal = new Actor(modelPath);
        return rVal;
    }
    
    @Deprecated
    public static void applyBlenderTransformer(Entity actorEntity){
        // Actor entityActor = EntityUtils.getActor(actorEntity);
        // entityActor.setAnimationScalar(60f); //should be the value of the fps i think
    }
    
    public static void applyBlenderRotation(Entity actorEntity){
        EntityUtils.getRotation(actorEntity).rotateLocalX((float)-Math.PI/2);
    }

    public static ActorStaticMorph getStaticMorph(Entity actorEntity){
        Actor entityActor = EntityUtils.getActor(actorEntity);
        return entityActor.getStaticMorph();
    }
    
    
}
