-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
layout: adr | ||
adr: 257 | ||
title: Player rotation | ||
date: 2025-01-03 | ||
status: Draft | ||
type: RFC | ||
spdx-license: CC0-1.0 | ||
authors: | ||
- nearnshaw | ||
--- | ||
|
||
# Abstract | ||
|
||
We propose to add a new field to the `movePlayerTo()` to determine the avatar rotation. This field will be a Vector3 for the point in space that the player looks at. | ||
|
||
# Context | ||
|
||
Today we can reposition a player with he `movePlayerTo()` function, but we **can’t set the avatar’s rotation**. We can set the camera rotation, which is good enough if the player is in 1st person, but when the player is in 3rd person the camera and the avatar rotation are two separate things. So if we want the player to align perfectly for an animation, the avatar’s rotation is out of our control. | ||
|
||
This is key for use cases like making the player sit on a chair, where we first need to alight the user properly with the chair. | ||
|
||
# Proposal | ||
|
||
The `movePlayerTo()` will have one more _optional_ field named `avatarTarget`. This Vector3 refers to a position in the scene that will be faced by the avatar. This is consistent with the already existing field `cameraTarget`, in most cases you'll likely want to set both fields to the same point. | ||
|
||
Setting the look target instead of the literal rotation as a quaternion is easier to calculate, and often more accurate to the desired behavior. For example, for respawning you might want to randomize the position within a certain range, but always want the rotation to face the start of the path. | ||
|
||
# Conclusion | ||
|
||
This minor addition enables some very desired use cases, like sitting, or making the player perform an avatar animation when pulling a lever, etc. |