auto-git:
[change] src/runtime-three/runtime-host.ts
This commit is contained in:
@@ -306,6 +306,9 @@ const RUNTIME_CLOCK_PUBLISH_INTERVAL_SECONDS = 1 / 30;
|
|||||||
const WATER_REFLECTION_UPDATE_INTERVAL_MS = 96;
|
const WATER_REFLECTION_UPDATE_INTERVAL_MS = 96;
|
||||||
const CAMERA_RIG_POINTER_LOOK_SENSITIVITY = 0.004;
|
const CAMERA_RIG_POINTER_LOOK_SENSITIVITY = 0.004;
|
||||||
const CAMERA_RIG_GAMEPAD_LOOK_SPEED = 2.2;
|
const CAMERA_RIG_GAMEPAD_LOOK_SPEED = 2.2;
|
||||||
|
const DIALOGUE_ATTENTION_CAMERA_TRANSITION_DURATION_SECONDS = 0.35;
|
||||||
|
const DIALOGUE_ATTENTION_PLAYER_FOCUS_HEIGHT_FACTOR = 0.82;
|
||||||
|
const DIALOGUE_ATTENTION_NPC_FOCUS_HEIGHT_FACTOR = 0.88;
|
||||||
|
|
||||||
function dampScalar(current: number, target: number, rate: number, dt: number) {
|
function dampScalar(current: number, target: number, rate: number, dt: number) {
|
||||||
return current + (target - current) * Math.min(1, dt * rate);
|
return current + (target - current) * Math.min(1, dt * rate);
|
||||||
@@ -344,10 +347,13 @@ export interface RuntimeDialogueState {
|
|||||||
|
|
||||||
export interface RuntimePauseState {
|
export interface RuntimePauseState {
|
||||||
paused: boolean;
|
paused: boolean;
|
||||||
source: "manual" | "control" | "mixed" | null;
|
source: "manual" | "control" | "dialogue" | "mixed" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
type RuntimeCameraSourceKey = "gameplay" | `rig:${string}`;
|
type RuntimeCameraSourceKey =
|
||||||
|
| "gameplay"
|
||||||
|
| `rig:${string}`
|
||||||
|
| `dialogue:${string}`;
|
||||||
|
|
||||||
interface RuntimeCameraPose {
|
interface RuntimeCameraPose {
|
||||||
position: Vector3;
|
position: Vector3;
|
||||||
@@ -362,6 +368,24 @@ interface RuntimeCameraTransitionState {
|
|||||||
destinationSourceKey: RuntimeCameraSourceKey;
|
destinationSourceKey: RuntimeCameraSourceKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface RuntimeDialogueAttentionState {
|
||||||
|
npcEntityId: string;
|
||||||
|
sideSign: DialogueAttentionSideSign;
|
||||||
|
}
|
||||||
|
|
||||||
|
type RuntimeResolvedCameraSource =
|
||||||
|
| {
|
||||||
|
kind: "gameplay";
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
kind: "rig";
|
||||||
|
rig: RuntimeCameraRig;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
kind: "dialogue";
|
||||||
|
state: RuntimeDialogueAttentionState;
|
||||||
|
};
|
||||||
|
|
||||||
export class RuntimeHost {
|
export class RuntimeHost {
|
||||||
private readonly scene = new Scene();
|
private readonly scene = new Scene();
|
||||||
private readonly worldBackgroundRenderer = new WorldBackgroundRenderer();
|
private readonly worldBackgroundRenderer = new WorldBackgroundRenderer();
|
||||||
|
|||||||
Reference in New Issue
Block a user