auto-git:
[change] src/entities/entity-instances.ts [change] src/runtime-three/runtime-host.ts
This commit is contained in:
@@ -7,12 +7,20 @@ import {
|
||||
} from "../dialogues/project-dialogues";
|
||||
import { normalizeTimeOfDayHours } from "../document/project-time-settings";
|
||||
import { isHexColorString } from "../document/world-settings";
|
||||
import {
|
||||
resolveNearestPointOnResolvedScenePath,
|
||||
resolveScenePath,
|
||||
type ScenePath
|
||||
} from "../document/paths";
|
||||
|
||||
interface PositionedEntity {
|
||||
interface AuthoredEntityState {
|
||||
id: string;
|
||||
name?: string;
|
||||
visible: boolean;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
interface PositionedEntity extends AuthoredEntityState {
|
||||
position: Vec3;
|
||||
}
|
||||
|
||||
@@ -46,7 +54,7 @@ export interface SceneEntryEntity extends PositionedEntity {
|
||||
yawDegrees: number;
|
||||
}
|
||||
|
||||
export const CAMERA_RIG_TYPES = ["fixed"] as const;
|
||||
export const CAMERA_RIG_TYPES = ["fixed", "rail"] as const;
|
||||
export type CameraRigType = (typeof CAMERA_RIG_TYPES)[number];
|
||||
export const CAMERA_RIG_TARGET_KINDS = [
|
||||
"player",
|
||||
@@ -91,9 +99,8 @@ export interface CameraRigLookAroundSettings {
|
||||
recenterSpeed: number;
|
||||
}
|
||||
|
||||
export interface CameraRigEntity extends PositionedEntity {
|
||||
export interface CameraRigBaseEntity extends AuthoredEntityState {
|
||||
kind: "cameraRig";
|
||||
rigType: CameraRigType;
|
||||
priority: number;
|
||||
defaultActive: boolean;
|
||||
target: CameraRigTargetRef;
|
||||
@@ -103,6 +110,19 @@ export interface CameraRigEntity extends PositionedEntity {
|
||||
lookAround: CameraRigLookAroundSettings;
|
||||
}
|
||||
|
||||
export interface FixedCameraRigEntity
|
||||
extends PositionedEntity,
|
||||
CameraRigBaseEntity {
|
||||
rigType: "fixed";
|
||||
}
|
||||
|
||||
export interface RailCameraRigEntity extends CameraRigBaseEntity {
|
||||
rigType: "rail";
|
||||
pathId: string;
|
||||
}
|
||||
|
||||
export type CameraRigEntity = FixedCameraRigEntity | RailCameraRigEntity;
|
||||
|
||||
export interface CharacterColliderSettings {
|
||||
mode: PlayerStartColliderMode;
|
||||
eyeHeight: number;
|
||||
|
||||
@@ -1614,12 +1614,6 @@ export class RuntimeHost {
|
||||
opacity: nightBackgroundOverlay.opacity,
|
||||
environmentIntensity: nightBackgroundOverlay.environmentIntensity
|
||||
};
|
||||
const environmentState = resolveWorldEnvironmentState(
|
||||
resolvedWorld.background,
|
||||
backgroundTexture,
|
||||
backgroundOverlayState,
|
||||
this.environmentBlendCache
|
||||
);
|
||||
const celestialBodiesState = resolveWorldCelestialBodiesState(
|
||||
this.currentWorld.showCelestialBodies,
|
||||
resolvedWorld.sunLight,
|
||||
@@ -1631,6 +1625,14 @@ export class RuntimeHost {
|
||||
resolvedTime,
|
||||
this.runtimeScene.time
|
||||
);
|
||||
if (this.currentWorld.background.mode === "shader") {
|
||||
this.shaderSkyEnvironmentCache?.syncPhaseTextures(
|
||||
resolveWorldShaderSkyEnvironmentPhaseStates(
|
||||
this.currentWorld,
|
||||
this.runtimeScene.time
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
this.worldBackgroundRenderer.update(
|
||||
resolvedWorld.background,
|
||||
@@ -1639,6 +1641,14 @@ export class RuntimeHost {
|
||||
celestialBodiesState,
|
||||
shaderSkyState
|
||||
);
|
||||
const environmentState = resolveWorldEnvironmentState(
|
||||
resolvedWorld.background,
|
||||
backgroundTexture,
|
||||
backgroundOverlayState,
|
||||
this.environmentBlendCache,
|
||||
shaderSkyState,
|
||||
this.shaderSkyEnvironmentCache
|
||||
);
|
||||
this.scene.background = null;
|
||||
this.scene.environment = environmentState.texture;
|
||||
this.scene.environmentIntensity = environmentState.intensity;
|
||||
|
||||
Reference in New Issue
Block a user