auto-git:
[change] src/app/App.tsx [change] src/commands/commit-transform-session-command.ts [change] src/core/transform-session.ts [change] src/document/migrate-scene-document.ts [change] src/entities/entity-instances.ts [change] src/runtime-three/runtime-host.ts
This commit is contained in:
@@ -747,7 +747,10 @@ export class RuntimeHost {
|
||||
string,
|
||||
Mesh<BufferGeometry, Material[]>
|
||||
>();
|
||||
private readonly terrainMeshes = new Map<string, RuntimeTerrainRenderObjects>();
|
||||
private readonly terrainMeshes = new Map<
|
||||
string,
|
||||
RuntimeTerrainRenderObjects
|
||||
>();
|
||||
private volumeTime = 0;
|
||||
private readonly volumeAnimatedUniforms: Array<{ value: number }> = [];
|
||||
private readonly runtimeWaterContactUniforms: RuntimeWaterContactUniformBinding[] =
|
||||
@@ -4126,7 +4129,11 @@ export class RuntimeHost {
|
||||
const group = new Group();
|
||||
const chunks: RuntimeTerrainRenderChunkObjects[] = [];
|
||||
|
||||
group.position.set(terrain.position.x, terrain.position.y, terrain.position.z);
|
||||
group.position.set(
|
||||
terrain.position.x,
|
||||
terrain.position.y,
|
||||
terrain.position.z
|
||||
);
|
||||
group.visible = terrain.visible;
|
||||
|
||||
for (const chunk of lodMeshData.chunks) {
|
||||
@@ -4214,7 +4221,9 @@ export class RuntimeHost {
|
||||
});
|
||||
}
|
||||
|
||||
private createRuntimeTerrainDistantMaterial(terrain: RuntimeTerrain): Material {
|
||||
private createRuntimeTerrainDistantMaterial(
|
||||
terrain: RuntimeTerrain
|
||||
): Material {
|
||||
const layerColors = terrain.layers.map((layer) =>
|
||||
getTerrainLayerPreviewColor(layer.material)
|
||||
) as [number, number, number, number];
|
||||
@@ -5948,7 +5957,9 @@ export class RuntimeHost {
|
||||
}
|
||||
|
||||
private resolveRuntimePlayerInputBindings() {
|
||||
return createPlayerStartInputBindings(this.runtimeScene?.playerInputBindings);
|
||||
return createPlayerStartInputBindings(
|
||||
this.runtimeScene?.playerInputBindings
|
||||
);
|
||||
}
|
||||
|
||||
private resolveRuntimeTargetVisibilityClearance(target: {
|
||||
@@ -6033,8 +6044,7 @@ export class RuntimeHost {
|
||||
const sampleClearance =
|
||||
Math.max(radius, TARGETING_VISIBILITY_TARGET_CLEARANCE) +
|
||||
TARGETING_VISIBILITY_TARGET_CLEARANCE_PADDING;
|
||||
const yAt = (factor: number) =>
|
||||
npc.position.y + height * factor;
|
||||
const yAt = (factor: number) => npc.position.y + height * factor;
|
||||
|
||||
return [
|
||||
{
|
||||
@@ -6060,13 +6070,9 @@ export class RuntimeHost {
|
||||
z: collider.size.z * npc.scale.z
|
||||
};
|
||||
const sampleClearance =
|
||||
clampScalar(
|
||||
Math.max(size.x, size.y, size.z) * 0.25,
|
||||
0.35,
|
||||
0.75
|
||||
) + TARGETING_VISIBILITY_TARGET_CLEARANCE_PADDING;
|
||||
const yAt = (factor: number) =>
|
||||
npc.position.y + size.y * factor;
|
||||
clampScalar(Math.max(size.x, size.y, size.z) * 0.25, 0.35, 0.75) +
|
||||
TARGETING_VISIBILITY_TARGET_CLEARANCE_PADDING;
|
||||
const yAt = (factor: number) => npc.position.y + size.y * factor;
|
||||
|
||||
return [
|
||||
{
|
||||
@@ -6272,7 +6278,9 @@ export class RuntimeHost {
|
||||
return false;
|
||||
}
|
||||
|
||||
const screenPoint = this.resolveRuntimeTargetScreenPoint(candidate.center);
|
||||
const screenPoint = this.resolveRuntimeTargetScreenPoint(
|
||||
candidate.center
|
||||
);
|
||||
|
||||
return (
|
||||
screenPoint !== null &&
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import type { Vec3 } from "../core/vector";
|
||||
import { Euler, Quaternion, Vector3 } from "three";
|
||||
import type { ControlEffect } from "../controls/control-surface";
|
||||
import {
|
||||
type InteractionLink
|
||||
} from "../interactions/interaction-links";
|
||||
import { type InteractionLink } from "../interactions/interaction-links";
|
||||
import {
|
||||
getInteractionLinkImpulseSteps,
|
||||
type ImpulseSequenceStep,
|
||||
@@ -380,7 +378,9 @@ function resolveEffectiveInteractionTrigger(
|
||||
runtimeScene.entities.interactables.some(
|
||||
(entity) => entity.entityId === link.sourceEntityId
|
||||
) ||
|
||||
runtimeScene.entities.npcs.some((entity) => entity.entityId === link.sourceEntityId)
|
||||
runtimeScene.entities.npcs.some(
|
||||
(entity) => entity.entityId === link.sourceEntityId
|
||||
)
|
||||
) {
|
||||
return "click";
|
||||
}
|
||||
@@ -402,10 +402,7 @@ function getInteractableTargetRadius(
|
||||
return Math.min(DEFAULT_INTERACTABLE_TARGET_RADIUS, interactable.radius);
|
||||
}
|
||||
|
||||
function getNpcDialoguePrompt(
|
||||
npc: RuntimeNpc,
|
||||
hasClickLinks: boolean
|
||||
): string {
|
||||
function getNpcDialoguePrompt(npc: RuntimeNpc, hasClickLinks: boolean): string {
|
||||
const trimmedName = npc.name?.trim() ?? "";
|
||||
const hasNpcDialogue =
|
||||
npc.defaultDialogueId !== null || npc.dialogues.length > 0;
|
||||
@@ -451,10 +448,7 @@ function getNpcDialogueTargetBounds(npc: RuntimeNpc): {
|
||||
y: npc.position.y + height * 0.5,
|
||||
z: npc.position.z
|
||||
},
|
||||
range: Math.max(
|
||||
DEFAULT_NPC_DIALOGUE_TARGET_RADIUS,
|
||||
height * 0.5
|
||||
)
|
||||
range: Math.max(DEFAULT_NPC_DIALOGUE_TARGET_RADIUS, height * 0.5)
|
||||
};
|
||||
}
|
||||
case "box": {
|
||||
@@ -558,10 +552,9 @@ function getNpcHorizontalTargetRadius(
|
||||
) * 0.5
|
||||
);
|
||||
case "none":
|
||||
return Math.max(
|
||||
bounds.max.x - bounds.min.x,
|
||||
bounds.max.z - bounds.min.z
|
||||
) * 0.5;
|
||||
return (
|
||||
Math.max(bounds.max.x - bounds.min.x, bounds.max.z - bounds.min.z) * 0.5
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +576,10 @@ function collectRuntimeInteractionTargetSources(
|
||||
continue;
|
||||
}
|
||||
|
||||
const distance = distanceBetweenVec3(interactionOrigin, interactable.position);
|
||||
const distance = distanceBetweenVec3(
|
||||
interactionOrigin,
|
||||
interactable.position
|
||||
);
|
||||
const horizontalDistance = distanceBetweenVec2(
|
||||
{
|
||||
x: interactionOrigin.x,
|
||||
@@ -708,7 +704,10 @@ export function resolveRuntimeTargetCandidates(options: {
|
||||
const interactionDistanceScore =
|
||||
1 / (1 + source.distance / Math.max(source.range, 0.001));
|
||||
const acquisitionDistanceScore =
|
||||
1 - clampUnitInterval(source.distance / Math.max(source.acquisitionRange, 0.001));
|
||||
1 -
|
||||
clampUnitInterval(
|
||||
source.distance / Math.max(source.acquisitionRange, 0.001)
|
||||
);
|
||||
const cameraDistanceScore = 1 / (1 + cameraDistance * 0.12);
|
||||
const stabilityBonus = source.entityId === previousId ? 0.12 : 0;
|
||||
const score =
|
||||
@@ -919,7 +918,8 @@ export class RuntimeInteractionSystem {
|
||||
const offsetX = candidate.center.x - interactionOrigin.x;
|
||||
const offsetZ = candidate.center.z - interactionOrigin.z;
|
||||
const forwardDistance =
|
||||
offsetX * horizontalViewDirection.x + offsetZ * horizontalViewDirection.y;
|
||||
offsetX * horizontalViewDirection.x +
|
||||
offsetZ * horizontalViewDirection.y;
|
||||
const lateralDistance =
|
||||
offsetX * -horizontalViewDirection.y +
|
||||
offsetZ * horizontalViewDirection.x;
|
||||
@@ -930,7 +930,8 @@ export class RuntimeInteractionSystem {
|
||||
coneSlope * paddedForwardDistance +
|
||||
candidate.horizontalRadius;
|
||||
const minForwardDistance =
|
||||
-DEFAULT_INTERACTION_PROMPT_NEAR_FIELD_RADIUS - candidate.horizontalRadius;
|
||||
-DEFAULT_INTERACTION_PROMPT_NEAR_FIELD_RADIUS -
|
||||
candidate.horizontalRadius;
|
||||
const maxForwardDistance =
|
||||
interactionReachMeters +
|
||||
DEFAULT_INTERACTION_PROMPT_NEAR_FIELD_RADIUS +
|
||||
@@ -1009,7 +1010,10 @@ export class RuntimeInteractionSystem {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const step of getInteractionLinkImpulseSteps(link, runtimeScene.sequences)) {
|
||||
for (const step of getInteractionLinkImpulseSteps(
|
||||
link,
|
||||
runtimeScene.sequences
|
||||
)) {
|
||||
this.dispatchSequenceStep(step, link, runtimeScene, dispatcher);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user