mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 19:38:24 -05:00
25 lines
581 B
C#
25 lines
581 B
C#
namespace Sandbox.Movement;
|
|
|
|
partial class MoveMode
|
|
{
|
|
/// <summary>
|
|
/// Get the position of the player's eye
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual Transform CalculateEyeTransform()
|
|
{
|
|
var transform = new Transform();
|
|
transform.Position = Controller.WorldPosition + Vector3.Up * (Controller.CurrentHeight - Controller.EyeDistanceFromTop);
|
|
transform.Rotation = Controller.EyeAngles.ToRotation();
|
|
return transform;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called to update the camera each frame
|
|
/// </summary>
|
|
public void UpdateCamera( CameraComponent cam )
|
|
{
|
|
|
|
}
|
|
}
|