VRPlayerController
La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.
public class VRPlayerController : MonoBehaviour, IPlayerControllerNamespace NodeWorld.SDK.Client.XR.
The local player's rig: the XR origin, its character controller and gravity, its avatar, seated mode, freezing, teleports and respawn.
Constants
DefaultRespawnHeight
public const float DefaultRespawnHeight = -200fRespawn height of a world that does not set one (NWWorldRef).
Properties
RespawnHeight
public float RespawnHeight { get; set; }Under this height (world y) the player comes back to its respawn point; set by the client for each world (NWWorldRef).
OriginVelocity
public Vector3 OriginVelocity { get; }The rig's velocity this frame, smoothed, in meters per second.
YawDelta
public float YawDelta { get; }How much the body turned this frame toward the head's heading, in degrees.
BodyForward
public Vector3 BodyForward { get; }The body's forward direction on the ground plane.
BodyRight
public Vector3 BodyRight { get; }The body's right direction on the ground plane.
BodyYaw
public float BodyYaw { get; }The body's heading, in degrees.
IsGrounded
public bool IsGrounded { get; }The character controller stands on the ground.
ActiveAvatar
public global::NWAvatar ActiveAvatar { get; }The local player's avatar, or null.
ActiveViewpointHeight
public float ActiveViewpointHeight { get; }Height of the active avatar's viewpoint above its root, in meters.
CurrentHMDHeight
public float CurrentHMDHeight { get; }Height of the headset above the floor of the rig, in meters.
BodyHeight
public float BodyHeight { get; }Height of the body: the headset's, or the avatar's viewpoint in seated mode.
HeightRatio
public float HeightRatio { get; }BodyHeight relative to the calibrated height.
IsSeated
public bool IsSeated { get; }Seated mode is on: the view is raised to the avatar's standing eye height.
IsFrozen
public bool IsFrozen { get; }The player is frozen: no movement, no collisions.
GroundPosition
public Vector3 GroundPosition { get; }The point on the ground under the body.
BodyCenter
public Vector3 BodyCenter { get; }The center of the body at ground height.
HipPosition
public Vector3 HipPosition { get; }Where the hips are, estimated from the head and the body.
NeckPosition
public Vector3 NeckPosition { get; }Where the neck is, estimated from the head.
LeanOffset
public Vector3 LeanOffset { get; }How far the head leans out of the body, on the ground plane.
Methods
SetRespawnPoint
public void SetRespawnPoint(Vector3 position, Quaternion rotation)Sets where the player comes back to (the world's spawn point).
Respawn
public void Respawn()Brings the player back to the respawn point.
RespawnFromMenu
public void RespawnFromMenu()The respawn the player asks for in the client's menu (the dock's Respawn, Shift+R): what the world imposed on the player (NWPlayerControls: immobilized, speeds, gravity, a velocity, a seat) is undone first, then the player is back at the respawn point (plan Flux B3, « Respawn et Quitter marchent toujours »). The world hears it as any respawn (Respawned), and may set its own settings again then.
SetActiveAvatar
public void SetActiveAvatar(global::NWAvatar avatar)Makes avatar the local player's avatar.
ClearActiveAvatar
public void ClearActiveAvatar()Removes the local player's avatar.
ValidateCameraViewpointAlignment
public void ValidateCameraViewpointAlignment(global::NWAvatar avatar, float tolerance = 0.01f)Throws when the camera is farther than tolerance meters from avatar's viewpoint.
EnableSeatedMode
public void EnableSeatedMode()Seated mode: the view is raised to the avatar's eye height while the player sits.
DisableSeatedMode
public void DisableSeatedMode()Back to standing: the view follows the headset's real height.
Freeze
public void Freeze()Stops the player: no movement and no collisions, until Unfreeze.
Unfreeze
public void Unfreeze()Lets the player move again after Freeze.
TeleportTo
public void TeleportTo(Vector3 position, Quaternion rotation)Moves the player to position, facing rotation, upright.
TeleportTilted
public void TeleportTilted(Vector3 position, Quaternion rotation)As TeleportTo, the play space tilted to rotation: a seat that pitches and rolls with a vehicle (FL# Player.Teleport with a rotation). The view tilts with it; TeleportTo and Respawn set it upright again.
Events
Respawned
public static event Action RespawnedThe local player was brought back to its respawn point (fell under the respawn height, or Respawn).
