Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions HSDRaw/Common/HSD_COBJ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class HSD_Camera : HSDAccessor
public int Unknown3 { get => _s.GetInt32(0x24); set => _s.SetInt32(0x24, value); }
public float NearClip { get => _s.GetFloat(0x28); set => _s.SetFloat(0x28, value); }
public float FarClip { get => _s.GetFloat(0x2C); set => _s.SetFloat(0x2C, value); }
public HSD_Camera SelfReference { get => _s.GetReference<HSD_Camera>(0x30); set => _s.SetReference(0x30, value); }
public float FieldOfView { get => _s.GetFloat(0x34); set => _s.SetFloat(0x34, value); }
public float FieldOfView { get => _s.GetFloat(0x30); set => _s.SetFloat(0x30, value); }
public float AspectRatio { get => _s.GetFloat(0x34); set => _s.SetFloat(0x34, value); }
}

}
2 changes: 1 addition & 1 deletion HSDRawViewer/Rendering/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ protected virtual void UpdateRotationMatrix()
/// </summary>
protected virtual void UpdatePerspectiveMatrix()
{
perspectiveMatrix = Matrix4.CreatePerspectiveFieldOfView(fovRadians, RenderWidth / (float)RenderHeight, nearClipPlane, farClipPlane);
perspectiveMatrix = Matrix4.CreatePerspectiveFieldOfView((float)(2 * Math.Atan(Math.Tan(fovRadians / 2) / Math.Min(AspectRatio,1))), RenderWidth / (float)RenderHeight, nearClipPlane, farClipPlane);
}

/// <summary>
Expand Down