public DogCharacter(Model model, String name, Vector3 location, Vector3 rotation, Vector3 scale, btCollisionShape shape, float mass, short belongsToFlag, short collidesWithFlag, boolean callback, boolean noDeactivate) { super(model, name, location, rotation, scale, shape, mass, belongsToFlag, collidesWithFlag, callback, noDeactivate, new DogSteerSettings()); // Create behavior tree through the library BehaviorTreeLibraryManager btlm = BehaviorTreeLibraryManager.getInstance(); this.tree = btlm.createBehaviorTree("btrees/dog.btree", this); // Create animation controller animations = new AnimationController(modelInstance); // Create path follower followPathSteerer = new FollowPathSteerer(this); // Create wander steerer wanderSteerer = new WanderSteerer(this); // Init flags humanWantToPlay = false; stickThrown = false; alreadyCriedForHumanDeath = false; humanIsDead = false; }
@Override public Actor createActor (Skin skin) { BehaviorTreeLibraryManager libraryManager = BehaviorTreeLibraryManager.getInstance(); libraryManager.setLibrary(new BehaviorTreeLibrary(BehaviorTreeParser.DEBUG_HIGH)); String name = lazy ? "data/dogIncludeLazy.tree" : "data/dogInclude.tree"; BehaviorTree<Dog> tree = libraryManager.createBehaviorTree(name, new Dog("Buddy")); BehaviorTreeViewer<?> treeViewer = createTreeViewer(tree.getObject().name, tree, true, skin); return new ScrollPane(treeViewer, skin); }
@Override public Actor createActor (Skin skin) { BehaviorTreeLibraryManager libraryManager = BehaviorTreeLibraryManager.getInstance(); BehaviorTreeLibrary library = new BehaviorTreeLibrary(BehaviorTreeParser.DEBUG_HIGH); registerDogBehavior(library); libraryManager.setLibrary(library); BehaviorTree<Dog> tree = libraryManager.createBehaviorTree("dog", new Dog("Buddy")); BehaviorTreeViewer<?> treeViewer = createTreeViewer(tree.getObject().name, tree, true, skin); return new ScrollPane(treeViewer, skin); }
private Task<E> createSubtreeRootTask () { return BehaviorTreeLibraryManager.getInstance().createRootTask(subtree); }