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

Add Camera Settings tab and features #91

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix distance not getting reset reopening previewer
The camera distance wasn't getting reset when closing and reopening the model previewer form
  • Loading branch information
Minon committed Feb 4, 2024
commit 1a1850e3551a4bf606c823010c4d0bc47687c2e4
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ModelPanelViewportInfo GetInfo()
_spotExponent = _spotExponent,
_transFactor = _transFactor,
_type = _type,
_viewDistance = _viewDistance,
//_viewDistance = _viewDistance,
_zoomFactor = _zoomFactor,
_allowSelection = _allowSelection,
_showCamCoords = _showCamCoords,
Expand Down Expand Up @@ -1276,6 +1276,12 @@ public Vector3 ProjectCameraSphere(Vector2 mousePoint, Vector3 center, float rad
out xy, out yz, out xz);
}

public override void ResetCamera()
{
_viewDistance = 0;
base.ResetCamera();
}

public override void SetProjectionType(ViewportProjection type)
{
_viewDistance = 0;
Expand Down Expand Up @@ -1462,7 +1468,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
public float _rotFactor = 0.4f;
public float _transFactor = 0.05f;
public float _zoomFactor = 2.5f;
public float _viewDistance = 5.0f;
public float _viewDistance = 0.0f;
public float _spotCutoff = 180.0f;
public float _spotExponent = 100.0f;
private const float v = 1.0f / 255.0f;
Expand Down Expand Up @@ -1519,7 +1525,7 @@ public ModelPanelViewport AsViewport()
v._spotCutoff = _spotCutoff;
v._spotExponent = _spotExponent;
v._transFactor = _transFactor;
v._viewDistance = _viewDistance;
//v._viewDistance = _viewDistance;
v._zoomFactor = _zoomFactor;
v._lightEnabled = _lightEnabled;
v._renderSCN0Controls = _renderSCN0Controls;
Expand Down
2 changes: 1 addition & 1 deletion BrawlLib/OpenGL/GLViewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ internal void SetPercentageIndex(int p, float v, bool resize = true)
}
}

public void ResetCamera()
public virtual void ResetCamera()
{
_camera.Reset();
}
Expand Down