changed: altered camera settings
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -147,7 +147,7 @@ public class Vector3CameraValueGroupDrawer : ObjectDrawer<Vector3CameraValueGrou
|
|||||||
|
|
||||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
GUILayout.Label(_instance.ToString(), labelOptions);
|
GUILayout.Label(_instance.label, labelOptions);
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
|
|
||||||
// Create the x settings enum
|
// Create the x settings enum
|
||||||
@@ -220,7 +220,7 @@ public class Vector2CameraValueGroupDrawer : ObjectDrawer<Vector2CameraValueGrou
|
|||||||
|
|
||||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
GUILayout.Label(_instance.ToString(), labelOptions);
|
GUILayout.Label(_instance.label, labelOptions);
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
|
|
||||||
// Create the x settings enum
|
// Create the x settings enum
|
||||||
@@ -327,7 +327,8 @@ namespace NodeCanvas.Tasks.Actions {
|
|||||||
[ParadoxNotion.Design.Header("Main Settings")]
|
[ParadoxNotion.Design.Header("Main Settings")]
|
||||||
public FloatCameraValueGroup fieldOfView = new (newLabel: "FOV");
|
public FloatCameraValueGroup fieldOfView = new (newLabel: "FOV");
|
||||||
|
|
||||||
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings")]
|
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings"), Space (5)]
|
||||||
|
public Vector3CameraValueGroup orbitPositionDamping = new(newLabel: "Position Damping");
|
||||||
public OrbitalFollowValueGroup orbitFollowTop = new (newLabel: "Top");
|
public OrbitalFollowValueGroup orbitFollowTop = new (newLabel: "Top");
|
||||||
public OrbitalFollowValueGroup orbitFollowCenter = new (newLabel: "Center");
|
public OrbitalFollowValueGroup orbitFollowCenter = new (newLabel: "Center");
|
||||||
public OrbitalFollowValueGroup orbitFollowBottom = new (newLabel: "Bottom");
|
public OrbitalFollowValueGroup orbitFollowBottom = new (newLabel: "Bottom");
|
||||||
@@ -336,7 +337,7 @@ namespace NodeCanvas.Tasks.Actions {
|
|||||||
public Vector2CameraValueGroup screenPosition = new (newLabel: "Screen Position");
|
public Vector2CameraValueGroup screenPosition = new (newLabel: "Screen Position");
|
||||||
|
|
||||||
[ParadoxNotion.Design.Header("Camera Offset Settings")]
|
[ParadoxNotion.Design.Header("Camera Offset Settings")]
|
||||||
public Vector3CameraValueGroup cameraOffset = new (newLabel: "Screen Position");
|
public Vector3CameraValueGroup cameraOffset = new (newLabel: "Offset");
|
||||||
|
|
||||||
//Use for initialization. This is called only once in the lifetime of the task.
|
//Use for initialization. This is called only once in the lifetime of the task.
|
||||||
//Return null if init was successfull. Return an error string otherwise
|
//Return null if init was successfull. Return an error string otherwise
|
||||||
@@ -461,6 +462,34 @@ namespace NodeCanvas.Tasks.Actions {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Position Damping
|
||||||
|
switch (orbitPositionDamping.changeX) {
|
||||||
|
case CameraSettingsToggle.NewValue:
|
||||||
|
CameraSettingsProcessor.values.orbitPositionDamping.targetValue.x = orbitPositionDamping.newValue.x;
|
||||||
|
break;
|
||||||
|
case CameraSettingsToggle.ResetValue:
|
||||||
|
CameraSettingsProcessor.values.orbitPositionDamping.targetValue.x = CameraSettingsProcessor.values.orbitPositionDamping.originalValue.x;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (orbitPositionDamping.changeY) {
|
||||||
|
case CameraSettingsToggle.NewValue:
|
||||||
|
CameraSettingsProcessor.values.orbitPositionDamping.targetValue.y = orbitPositionDamping.newValue.y;
|
||||||
|
break;
|
||||||
|
case CameraSettingsToggle.ResetValue:
|
||||||
|
CameraSettingsProcessor.values.orbitPositionDamping.targetValue.y = CameraSettingsProcessor.values.orbitPositionDamping.originalValue.y;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (orbitPositionDamping.changeZ) {
|
||||||
|
case CameraSettingsToggle.NewValue:
|
||||||
|
CameraSettingsProcessor.values.orbitPositionDamping.targetValue.z = orbitPositionDamping.newValue.z;
|
||||||
|
break;
|
||||||
|
case CameraSettingsToggle.ResetValue:
|
||||||
|
CameraSettingsProcessor.values.orbitPositionDamping.targetValue.z = CameraSettingsProcessor.values.orbitPositionDamping.originalValue.z;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
EndAction(true);
|
EndAction(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public struct CameraSettingSingleValue<T>{
|
|||||||
public struct CameraSettingValues{
|
public struct CameraSettingValues{
|
||||||
public CameraSettingSingleValue<float> mainFieldOfView;
|
public CameraSettingSingleValue<float> mainFieldOfView;
|
||||||
|
|
||||||
|
public CameraSettingSingleValue<Vector3> orbitPositionDamping;
|
||||||
|
|
||||||
public CameraSettingSingleValue<float> orbitFollowTopHeight;
|
public CameraSettingSingleValue<float> orbitFollowTopHeight;
|
||||||
public CameraSettingSingleValue<float> orbitFollowTopRadius;
|
public CameraSettingSingleValue<float> orbitFollowTopRadius;
|
||||||
public CameraSettingSingleValue<float> orbitFollowCenterHeight;
|
public CameraSettingSingleValue<float> orbitFollowCenterHeight;
|
||||||
@@ -43,6 +45,8 @@ public struct CameraSettingValues{
|
|||||||
public CameraSettingValues(float defaultSmoothing){
|
public CameraSettingValues(float defaultSmoothing){
|
||||||
mainFieldOfView = new CameraSettingSingleValue<float>(defaultSmoothing);
|
mainFieldOfView = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||||
|
|
||||||
|
orbitPositionDamping = new CameraSettingSingleValue<Vector3>(defaultSmoothing);
|
||||||
|
|
||||||
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||||
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing);
|
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||||
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||||
@@ -86,6 +90,7 @@ public class CameraSettingsProcessor : MonoBehaviour{
|
|||||||
values = new CameraSettingValues{
|
values = new CameraSettingValues{
|
||||||
cameraOffsetOffset = new CameraSettingSingleValue<Vector3>(defaultSmoothing: .2f, offset.Offset),
|
cameraOffsetOffset = new CameraSettingSingleValue<Vector3>(defaultSmoothing: .2f, offset.Offset),
|
||||||
mainFieldOfView = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, main.Lens.FieldOfView),
|
mainFieldOfView = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, main.Lens.FieldOfView),
|
||||||
|
orbitPositionDamping = new CameraSettingSingleValue<Vector3>(defaultSmoothing: .2f, orbit.TrackerSettings.PositionDamping),
|
||||||
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Top.Height),
|
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Top.Height),
|
||||||
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Top.Radius),
|
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Top.Radius),
|
||||||
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Center.Height),
|
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Center.Height),
|
||||||
@@ -101,6 +106,10 @@ public class CameraSettingsProcessor : MonoBehaviour{
|
|||||||
values.mainFieldOfView.targetValue, ref values.mainFieldOfView.velocityRef,
|
values.mainFieldOfView.targetValue, ref values.mainFieldOfView.velocityRef,
|
||||||
values.mainFieldOfView.smoothing);
|
values.mainFieldOfView.smoothing);
|
||||||
|
|
||||||
|
orbit.TrackerSettings.PositionDamping = Vector3.SmoothDamp(orbit.TrackerSettings.PositionDamping,
|
||||||
|
values.orbitPositionDamping.targetValue, ref values.orbitPositionDamping.velocityRefV3,
|
||||||
|
values.orbitPositionDamping.smoothing);
|
||||||
|
|
||||||
orbit.Orbits.Top.Height = Mathf.SmoothDamp(orbit.Orbits.Top.Height,
|
orbit.Orbits.Top.Height = Mathf.SmoothDamp(orbit.Orbits.Top.Height,
|
||||||
values.orbitFollowTopHeight.targetValue, ref values.orbitFollowTopHeight.velocityRef,
|
values.orbitFollowTopHeight.targetValue, ref values.orbitFollowTopHeight.velocityRef,
|
||||||
values.orbitFollowTopHeight.smoothing);
|
values.orbitFollowTopHeight.smoothing);
|
||||||
|
|||||||
Reference in New Issue
Block a user