Add interaction reach distance to player start entity and runtime scene build
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
createCameraRigPlayerTargetRef,
|
||||
createCameraRigWorldPointTargetRef,
|
||||
DEFAULT_PLAYER_START_GAMEPAD_BINDINGS,
|
||||
DEFAULT_PLAYER_START_INTERACTION_REACH_METERS,
|
||||
DEFAULT_PLAYER_START_KEYBOARD_BINDINGS,
|
||||
createNpcAlwaysPresence,
|
||||
createNpcEntity,
|
||||
@@ -3299,6 +3300,11 @@ function readPlayerStartEntity(value: unknown, label: string): EntityInstance {
|
||||
value.navigationMode,
|
||||
`${label}.navigationMode`
|
||||
),
|
||||
interactionReachMeters: readOptionalPositiveFiniteNumber(
|
||||
value.interactionReachMeters,
|
||||
`${label}.interactionReachMeters`,
|
||||
DEFAULT_PLAYER_START_INTERACTION_REACH_METERS
|
||||
),
|
||||
movementTemplate: readPlayerStartMovementTemplate(
|
||||
value.movementTemplate,
|
||||
`${label}.movementTemplate`
|
||||
|
||||
@@ -278,6 +278,7 @@ export interface RuntimePlayerStart {
|
||||
position: Vec3;
|
||||
yawDegrees: number;
|
||||
navigationMode: RuntimeNavigationMode;
|
||||
interactionReachMeters: number;
|
||||
movement: RuntimePlayerMovement;
|
||||
inputBindings: PlayerStartInputBindings;
|
||||
collider: FirstPersonPlayerShape;
|
||||
@@ -1591,6 +1592,7 @@ function buildRuntimeSceneCollections(
|
||||
position: cloneVec3(entity.position),
|
||||
yawDegrees: entity.yawDegrees,
|
||||
navigationMode: entity.navigationMode,
|
||||
interactionReachMeters: entity.interactionReachMeters,
|
||||
movement: buildRuntimePlayerMovement(entity.movementTemplate),
|
||||
inputBindings: clonePlayerStartInputBindings(entity.inputBindings),
|
||||
collider: buildRuntimePlayerShape(entity)
|
||||
@@ -1987,6 +1989,7 @@ export function buildRuntimeSceneFromDocument(
|
||||
position: cloneVec3(playerStartEntity.position),
|
||||
yawDegrees: playerStartEntity.yawDegrees,
|
||||
navigationMode,
|
||||
interactionReachMeters: playerStartEntity.interactionReachMeters,
|
||||
movement: cloneRuntimePlayerMovement(playerMovement),
|
||||
inputBindings: clonePlayerStartInputBindings(playerInputBindings),
|
||||
collider: playerCollider
|
||||
|
||||
Reference in New Issue
Block a user