feat: Replace crypto.randomUUID with generateUniqueId in MaterialSpawner and reduce spawnCount to 10
This commit is contained in:
@@ -5,6 +5,7 @@ import { MaterialModel } from '../../simulation/materials/instances/material/mat
|
||||
import { useThree } from '@react-three/fiber';
|
||||
import * as THREE from 'three';
|
||||
import { CameraControls } from '@react-three/drei';
|
||||
import { generateUniqueId } from '../../../functions/generateUniqueId';
|
||||
|
||||
type MaterialSpawnerProps = {
|
||||
position: [number, number, number];
|
||||
@@ -39,7 +40,7 @@ function MaterialSpawner({ position, spawnInterval, spawnCount }: MaterialSpawne
|
||||
return [
|
||||
...prev,
|
||||
{
|
||||
id: crypto.randomUUID(),
|
||||
id: generateUniqueId(),
|
||||
position,
|
||||
ref: React.createRef<RapierRigidBody>(),
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Co
|
||||
<MaterialSpawner
|
||||
position={[-21, 3, -8]}
|
||||
spawnInterval={1000}
|
||||
spawnCount={50}
|
||||
spawnCount={10}
|
||||
/>
|
||||
</Physics>
|
||||
<Visualization />
|
||||
|
||||
Reference in New Issue
Block a user