feat: integrate the cinematic nightdrive scene
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import * as THREE from 'three';
|
||||
import type { SceneResourceBag } from '@/scene/resources';
|
||||
import type { SceneDetailMode } from '@/scene/types';
|
||||
|
||||
export interface CarWorld {
|
||||
group: CarGroup;
|
||||
setDetail(detail: 'full' | 'reduced'): void;
|
||||
setDetail(detail: SceneDetailMode): void;
|
||||
update(speed: number, acceleration: number, elapsedSeconds: number): void;
|
||||
}
|
||||
|
||||
@@ -246,12 +247,12 @@ export function createCar(resources: SceneResourceBag): CarWorld {
|
||||
}
|
||||
group.add(secondary);
|
||||
|
||||
let detail: 'full' | 'reduced' = 'full';
|
||||
let detail: SceneDetailMode = 'full';
|
||||
let squat = 0;
|
||||
let squatVelocity = 0;
|
||||
let previousElapsed: number | null = null;
|
||||
|
||||
const setDetail = (nextDetail: 'full' | 'reduced'): void => {
|
||||
const setDetail = (nextDetail: SceneDetailMode): void => {
|
||||
if (detail === nextDetail) return;
|
||||
detail = nextDetail;
|
||||
secondary.visible = detail === 'full';
|
||||
|
||||
Reference in New Issue
Block a user