public void init(Nhg nhg) { this.nhg = nhg; fsm = new DefaultStateMachine<>(this, AssetsStates.IDLE); assetManager = new AssetManager(); syncAssetManager = new AssetManager(); FileHandleResolver resolver = assetManager.getFileHandleResolver(); FileHandleResolver syncResolver = syncAssetManager.getFileHandleResolver(); assetManager.setLoader(Scene.class, new SceneLoader(nhg, resolver)); assetManager.setLoader(InputProxy.class, new InputLoader(resolver)); assetManager.setLoader(JsonValue.class, new JsonLoader(resolver)); assetManager.setLoader(HDRData2.class, new HDRLoader(resolver)); assetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this, new UBJsonReader(), resolver)); syncAssetManager.setLoader(Scene.class, new SceneLoader(nhg, syncResolver)); syncAssetManager.setLoader(InputProxy.class, new InputLoader(syncResolver)); syncAssetManager.setLoader(JsonValue.class, new JsonLoader(syncResolver)); syncAssetManager.setLoader(HDRData2.class, new HDRLoader(syncResolver)); syncAssetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this, new UBJsonReader(), syncResolver)); assetManager.setErrorListener(this); syncAssetManager.setErrorListener(this); assetQueue = new Array<>(); assetCache = new ArrayMap<>(); Texture.setAssetManager(assetManager); }
public HumanCharacter(Model model, String name, Vector3 location, Vector3 rotation, Vector3 scale, btCollisionShape shape, float mass, short belongsToFlag, short collidesWithFlag, boolean callback, boolean noDeactivate, Array<BlenderEmpty> ragdollEmpties, String armatureNodeId) { super(model, name, location, rotation, scale, shape, mass, belongsToFlag, collidesWithFlag, callback, noDeactivate, ragdollEmpties, armatureNodeId, new HumanSteerSettings()); // Create path follower followPathSteerer = new FollowPathSteerer(this); // Create the animation controllers animations = new AnimationController(modelInstance); // Create animation listeners for states that need one stateAnimationListeners = new EnumMap<HumanState, AnimationListener>(HumanState.class); stateAnimationListeners.put(HumanState.THROW, new AnimationListener()); // Create the state machine stateMachine = new DefaultStateMachine<HumanCharacter, HumanState>(this); // Set the steering variables associated with default move state (walking) stateMachine.changeState(moveState); // Then make the character idle stateMachine.changeState(moveState.idleState); }
public Entity(final GraphicsProcessor graphics, final PhysicsProcessor physics, final AudioProcessor audio, final State<Entity> initialState) { this.graphics = graphics; this.physics = physics; this.audio = audio; stateMachine = new DefaultStateMachine<Entity>(this, initialState); }
public Bob (Elsa elsa) { this.elsa = elsa; location = Location.SHACK; goldCarried = 0; moneyInBank = 0; thirst = 0; fatigue = 0; stateMachine = new DefaultStateMachine<Bob, BobState>(this, BobState.GO_HOME_AND_SLEEP_TILL_RESTED); }
void init(NhgEntry nhgEntry) { fsm = new DefaultStateMachine<>(nhgEntry, EngineStates.START); }
public GhostAgent(GhostComponent ghostComponent) { this.ghostComponent = ghostComponent; stateMachine = new DefaultStateMachine<>(this); timer = 0; }
public PlayerAgent(PlayerComponent playerComponent) { this.playerComponent = playerComponent; stateMachine = new DefaultStateMachine<>(this); timer = 0; }
public FSMComponent init (Entity entity) { stateMachine = new DefaultStateMachine<Entity>(entity); return this; }
public Elsa (Bob bob) { stateMachine = new DefaultStateMachine<Elsa, ElsaState>(this, ElsaState.DO_HOUSE_WORK, ElsaState.GLOBAL_STATE); this.bob = bob; }