Skip to content

Commit

Permalink
2024/01/11 - Setting up debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FadiShawki committed Jan 11, 2024
1 parent 5d80b4c commit c33942c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/@orbitmines/explorer/debug/DebugCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import IEventListener from "../../js/react/IEventListener";
import {VisualizationCanvas} from "../Visualization";
import React, {useEffect, useReducer, useRef, useState} from "react";
import {useHotkeys} from "../../js/react/hooks/useHotkeys";
import {Ray, RayType} from "../Ray";
import {DebugResult, Ray, RayType} from "../Ray";
import {_Continuation, _Vertex, add, AutoVertex, circle, InterfaceOptions, Line, torus} from "../OrbitMinesExplorer";
import {HotkeyConfig} from "@blueprintjs/core/src/hooks/hotkeys/hotkeyConfig";
import {useThree} from "@react-three/fiber";
Expand Down Expand Up @@ -88,6 +88,8 @@ const DebugInterface = ({ scale = 1.5 }: InterfaceOptions) => {
// },
{
combo: "/", global: true, label: "", onKeyDown: () => {
console.log('---------')
console.log(`Debugging: ${Interface.any.selection.self.label} (type=${Interface.any.selection.type})`)
console.log(`rays.length at pos=[${Interface.any.selection.render_options.position}]: ${Interface.any.rays.filter((ray: Ray) =>
_.isEqual(
Interface.any.selection.render_options.position,
Expand All @@ -96,6 +98,13 @@ const DebugInterface = ({ scale = 1.5 }: InterfaceOptions) => {
).length} / ${Interface.any.rays.length}`)
console.log('ref', Interface.any.selection)
console.log('ref.self', Interface.any.selection.self)

const debug: DebugResult = {};
Interface.any.selection.self.debug(debug);
console.log('ref.debug', debug);
Interface.any.rays.forEach((ray: Ray) => ray.debug(debug));
console.log('rays.debug', debug);

}
},
{
Expand Down

0 comments on commit c33942c

Please sign in to comment.