Files
sbox-public/engine/Sandbox.Engine/Scene/Components/Game/PlayerController/Modes/MoveMode.Camera.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

25 lines
578 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.BodyHeight - Controller.EyeDistanceFromTop);
transform.Rotation = Controller.EyeAngles.ToRotation();
return transform;
}
/// <summary>
/// Called to update the camera each frame
/// </summary>
public void UpdateCamera( CameraComponent cam )
{
}
}