Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: polish block distances #916

Merged
merged 6 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions client/src/features/visualizer-threejs/VisualizerInstance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ import React, { useEffect, useRef } from "react";
import { RouteComponentProps } from "react-router-dom";
import * as THREE from "three";
import { Box3 } from "three";
import { ACCEPTED_BLOCK_COLORS, PENDING_BLOCK_COLOR, TIME_DIFF_COUNTER, ZOOM_DEFAULT } from "./constants";
import {
ACCEPTED_BLOCK_COLORS,
MAX_X_BLOCK_DISTANCE,
PENDING_BLOCK_COLOR,
TIME_DIFF_COUNTER,
ZOOM_DEFAULT,
} from './constants'
begonaalvarezd marked this conversation as resolved.
Show resolved Hide resolved
import Emitter from "./Emitter";
import { useTangleStore, useConfigStore } from "./store";
import { getGenerateY, randomIntFromInterval, timer } from "./utils";
import { generateXbyShift, getGenerateY, randomIntFromInterval, timer } from "./utils";
import { BPSCounter } from "./BPSCounter";
import { VisualizerRouteProps } from "../../app/routes/VisualizerRouteProps";
import { ServiceFactory } from "../../factories/serviceFactory";
Expand Down Expand Up @@ -137,7 +143,7 @@ const VisualizerInstance: React.FC<RouteComponentProps<VisualizerRouteProps>> =
const position: [number, number, number] = [
randomIntFromInterval(emitterBox.min.x, emitterBox.max.x),
Y,
randomIntFromInterval(emitterBox.min.z, emitterBox.max.z)
generateXbyShift(-0.5),
begonaalvarezd marked this conversation as resolved.
Show resolved Hide resolved
];

bpsCounter.addBlock();
Expand Down
4 changes: 2 additions & 2 deletions client/src/features/visualizer-threejs/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Color } from "three";

// steps
export const STEP_Y_PX = 10;
export const STEP_X_PX = 100;
export const STEP_Y_PX = 20;
export const STEP_X_PX = 250;
export const STEP_CAMERA_SHIFT_PX = 100;

export const MAX_BLOCK_INSTANCES = 5000;
Expand Down