Browse Source

tracks logic revamp.

refactor/modularize
RUSHIL AMBARISH KADU 8 months ago
parent
commit
50447d70b2
  1. 7
      steps/src/main.js
  2. 6
      steps/src/p5/radarSketch.js

7
steps/src/main.js

@ -779,6 +779,7 @@ document.addEventListener("keydown", (event) => {
"p",
"a",
"s",
"m",
];
if (!appState.vizData || !recognizedKeys.includes(key)) {
@ -847,7 +848,13 @@ document.addEventListener("keydown", (event) => {
toggleDebug2Overlay.click();
}
if (key === "m") {
if (collapsibleMenu.classList.contains("-translate-x-full")) {
// If the menu is hidden (closed), trigger a click on the OPEN button.
toggleMenuBtn.click();
} else {
// If the menu is not hidden (it's open), trigger a click on the CLOSE button.
closeMenuBtn.click();
}
}
});

6
steps/src/p5/radarSketch.js

@ -12,6 +12,7 @@ import {
toggleTracks,
togglePredictedPos,
toggleCovariance,
toggleVelocity
} from "../dom.js";
import {
drawStaticRegionsToBuffer,
@ -94,10 +95,11 @@ export const radarSketch = function (p) {
const frameData = appState.vizData.radarFrames[appState.currentFrame];
if (frameData) {
// Draw object trajectories and markers if enabled
if (toggleVelocity.checked){
drawTrackMarkers(p, plotScales)
}
if (toggleTracks.checked) {
drawTrajectories(p, plotScales);
drawTrackMarkers(p, plotScales);
if (toggleCovariance.checked) {
for (const track of appState.vizData.tracks) {
const log = track.historyLog.find(

Loading…
Cancel
Save