Skip to content

Commit

Permalink
Add useYuka
Browse files Browse the repository at this point in the history
  • Loading branch information
Supun-ascentic committed Dec 29, 2023
1 parent e195057 commit d4d98f0
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions useYuka.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
OnPathBehavior,
Vector3,
} from "yuka";
import { useNavMesh } from "../stores/useNavMesh";
import { useNavMesh } from "./useNavMesh";
import { useFrame } from "@react-three/fiber";

const context = createContext();
Expand Down Expand Up @@ -45,16 +45,6 @@ export function Manager({ children }) {
followPathBehavior: followPathBehavior,
onPathBehavior: onPathBehavior,
});

// // Set up ghost
// const seekBehavior = new OffsetPursuitBehavior(
// player,
// new Vector3(1, 0, 1)
// );

// ghost.steering.add(seekBehavior);
// ghost.maxSpeed = 2;
// ghost.position.z = -5;
});

useNavMesh.subscribe(
Expand All @@ -77,10 +67,6 @@ export function Manager({ children }) {
playerDate.followPathBehavior.active = true;
playerDate.followPathBehavior.path.clear();

// refs.pathHelper.visible = true;
// refs.pathHelper.geometry.dispose();
// refs.pathHelper.geometry = new THREE.BufferGeometry().setFromPoints(path);

for (const point of path) {
playerDate.followPathBehavior.path.add(point);
playerDate.onPathBehavior.path.add(point);
Expand Down

0 comments on commit d4d98f0

Please sign in to comment.