cleared consoles
This commit is contained in:
@@ -13,8 +13,8 @@ interface NavMesh {
|
|||||||
raw: RawNavMesh;
|
raw: RawNavMesh;
|
||||||
}
|
}
|
||||||
export default function Agv({ lines, plane }: any) {
|
export default function Agv({ lines, plane }: any) {
|
||||||
console.log("planes: ", plane);
|
|
||||||
console.log("lines: ", lines);
|
|
||||||
const { scene } = useThree();
|
const { scene } = useThree();
|
||||||
const groupRef = useRef<THREE.Group | null>(null);
|
const groupRef = useRef<THREE.Group | null>(null);
|
||||||
const [navMesh, setNavMesh] = useState<RecastNavMesh | null>(null);
|
const [navMesh, setNavMesh] = useState<RecastNavMesh | null>(null);
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ type Point = {
|
|||||||
type LineData = {
|
type LineData = {
|
||||||
type: string;
|
type: string;
|
||||||
line: Point[];
|
line: Point[];
|
||||||
|
_id: {};
|
||||||
|
layer: number;
|
||||||
|
__v: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PolygonGeneratorProps = {
|
type PolygonGeneratorProps = {
|
||||||
@@ -28,23 +31,8 @@ export default function PolygonGenerator({
|
|||||||
plane,
|
plane,
|
||||||
}: PolygonGeneratorProps) {
|
}: PolygonGeneratorProps) {
|
||||||
const { scene } = useThree();
|
const { scene } = useThree();
|
||||||
console.log(
|
|
||||||
"lines: ",
|
|
||||||
lines.current.map((val: any) => val)
|
|
||||||
);
|
|
||||||
console.log("planes: ", plane);
|
|
||||||
// console.log("storedFloorItems: ", lines);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!groupRef?.current) return;
|
|
||||||
// const groundGeometry = new THREE.BoxGeometry(80, 1, 60);
|
|
||||||
// const groundMaterial = new THREE.MeshBasicMaterial({ color: "#99ff99" });
|
|
||||||
// const groundMesh = new THREE.Mesh(groundGeometry, groundMaterial);
|
|
||||||
// groundMesh.position.set(-10, -0.5, 3);
|
|
||||||
// groundMesh.name = "GroundMesh";
|
|
||||||
groupRef.current.add(plane);
|
|
||||||
scene.add(groupRef.current);
|
|
||||||
}, [groupRef, scene]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!processPoint) return;
|
if (!processPoint) return;
|
||||||
@@ -113,7 +101,7 @@ export default function PolygonGenerator({
|
|||||||
mesh.position.set((minX + maxX) / 2, height / 2, (minZ + maxZ) / 2);
|
mesh.position.set((minX + maxX) / 2, height / 2, (minZ + maxZ) / 2);
|
||||||
|
|
||||||
groupRef?.current?.add(mesh);
|
groupRef?.current?.add(mesh);
|
||||||
scene.add(groupRef.current!);
|
// scene.add(groupRef.current!);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderWallGeometry = (
|
const renderWallGeometry = (
|
||||||
@@ -152,7 +140,7 @@ export default function PolygonGenerator({
|
|||||||
wallMesh.quaternion.copy(quaternion);
|
wallMesh.quaternion.copy(quaternion);
|
||||||
|
|
||||||
groupRef?.current?.add(wallMesh);
|
groupRef?.current?.add(wallMesh);
|
||||||
scene.add(groupRef.current!);
|
// scene.add(groupRef.current!);
|
||||||
|
|
||||||
const lineGeometry = new THREE.BufferGeometry().setFromPoints([
|
const lineGeometry = new THREE.BufferGeometry().setFromPoints([
|
||||||
start,
|
start,
|
||||||
|
|||||||
Reference in New Issue
Block a user