Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where coordinate system changing is not being applied. #960

Merged
merged 2 commits into from
Sep 27, 2023
Merged
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
15 changes: 15 additions & 0 deletions Dev/Editor/EffekseerCoreGUI/GUI/Viewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ public bool Initialize(swig.DeviceType deviceType)
ViewMode_OnChanged(null, null);
Core.Option.ViewerMode.OnChanged += ViewMode_OnChanged;

CoordinateSystem_OnChanged(null, null);
Core.Option.Coordinate.OnChanged += CoordinateSystem_OnChanged;

Core.Option.RenderingMode.OnChanged += RenderingMode_OnChanged;
RenderingMode_OnChanged(null, null);

Expand All @@ -288,6 +291,14 @@ public bool Initialize(swig.DeviceType deviceType)
return true;
}

private void CoordinateSystem_OnChanged(object sender, ChangedValueEventArgs e)
{
ViewPointController.SetCoordinateSystem(
Core.Option.Coordinate.Value == Data.OptionValues.CoordinateType.Right ? swig.CoordinateSystemType.RH : swig.CoordinateSystemType.LH);
effectSetting.SetCoordinateSyatem(
Core.Option.Coordinate.Value == Data.OptionValues.CoordinateType.Right ? swig.CoordinateSystemType.RH : swig.CoordinateSystemType.LH);
}

private void RenderingMode_OnChanged(object sender, ChangedValueEventArgs e)
{
var renderParam = EffectRenderer.GetParameter();
Expand All @@ -309,6 +320,8 @@ public void HideViewer()
Core.Environment.PostEffect.TonemapReinhard.Exposure.OnChanged -= Tonemap_OnChanged;

Core.Option.ViewerMode.OnChanged -= ViewMode_OnChanged;

Core.Option.Coordinate.OnChanged -= CoordinateSystem_OnChanged;
}

public override void OnAfterClear()
Expand Down Expand Up @@ -757,6 +770,8 @@ unsafe void Export()

EffectRenderer.SetStep((int)Core.Option.FPS.Value);

ViewPointController.SetCoordinateSystem(
Core.Option.Coordinate.Value == Data.OptionValues.CoordinateType.Right ? swig.CoordinateSystemType.RH : swig.CoordinateSystemType.LH);
effectSetting.SetCoordinateSyatem(
Core.Option.Coordinate.Value == Data.OptionValues.CoordinateType.Right ? swig.CoordinateSystemType.RH : swig.CoordinateSystemType.LH);

Expand Down
Loading