Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitGeslain committed Mar 5, 2024
2 parents ccb8b7a + 69ad813 commit 40a30f2
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ Transform:
m_GameObject: {fileID: 161320810}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 11.27, y: 1.5, z: -2}
m_LocalScale: {x: 2, y: 1, z: 0.3}
m_LocalPosition: {x: 8.25, y: 1.5, z: -2}
m_LocalScale: {x: 1.45, y: 1, z: 0.3}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1199831051}
Expand Down Expand Up @@ -1172,7 +1172,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7088029602675669135, guid: 7e46c8eb8c13fdb429130703b04c8216, type: 3}
propertyPath: scene.aggregateFunction
value: 0
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7088029602675669135, guid: 7e46c8eb8c13fdb429130703b04c8216, type: 3}
propertyPath: scene.strategyDirection.x
Expand Down Expand Up @@ -1338,8 +1338,8 @@ Transform:
m_GameObject: {fileID: 398215666}
serializedVersion: 2
m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 15.45, y: 0.42999998, z: -1.41}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 15.45, y: 0.42999998, z: -1.35}
m_LocalScale: {x: 0.85, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2105458143}
Expand Down Expand Up @@ -3029,112 +3029,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1340611832}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1354001049
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1354001050}
- component: {fileID: 1354001053}
- component: {fileID: 1354001052}
- component: {fileID: 1354001051}
m_Layer: 11
m_Name: Corridor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!4 &1354001050
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1354001049}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0.7071068, z: -0, w: 0.7071068}
m_LocalPosition: {x: -0.020000815, y: -0.05, z: 9.020001}
m_LocalScale: {x: 2, y: 1, z: 0.20518707}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1767219245}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!64 &1354001051
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1354001049}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1354001052
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1354001049}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a301d90d5091345c8810e6cab98f6736, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1354001053
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1354001049}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1362897594
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3733,8 +3627,8 @@ Transform:
m_GameObject: {fileID: 1589834309}
serializedVersion: 2
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
m_LocalPosition: {x: 1, y: 0.42999998, z: -0.5800001}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 1, y: 0.42999998, z: -0.66}
m_LocalScale: {x: 0.85, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1199831051}
Expand Down Expand Up @@ -4384,7 +4278,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1588515907}
- {fileID: 1354001050}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1797502496 stripped
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public class Razzaque2001Hybrid: WorldRedirectionTechnique {
/// <param name="aggregate"></param>
public static Razzaque2001Hybrid Sum() => new((a, b, c) => a + b + c);

/// <summary>
/// Static factory method for using weighted-sum-aggregation.
/// </summary>
public static Razzaque2001Hybrid Weighted(float x, float y, float z) => new((a, b, c) => a * x + b * y + c * z);
/// <summary>
/// Static factory method for using weighted-sum-aggregation.
/// </summary>
public static Razzaque2001Hybrid Weighted(float x, float y, float z) => new((a, b, c) => a * x + b * y + c * z);

public override void Redirect(Scene scene) {
public override void Redirect(Scene scene) {
float angle = aggregate(
scene.enableHybridOverTime ? Razzaque2001OverTimeRotation.GetRedirection(scene) : 0,
scene.enableHybridRotational ? Razzaque2001Rotational.GetRedirection(scene) : 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,9 @@ public override void OnInspectorGUI() {
EditorGUILayout.Space(5);
EditorGUILayout.LabelField("Technique Parameters", EditorStyles.boldLabel);

EditorGUILayout.PropertyField(parameters, new GUIContent("Parameters"));

// WorldRedirection someComponent = target as WorldRedirection;
// // if (someComponent == null)
// // someComponent = CreateInstance<ParametersToolkit>();
// Debug.Log(someComponent.scene);
// Debug.Log(someComponent.scene.parameters);
// Debug.Log(someComponent.scene.parameters.OverTimeRotation);
EditorGUILayout.PropertyField(redirect, new GUIContent("Redirect"));
EditorGUILayout.PropertyField(parameters, new GUIContent("Parameters"));

if (technique.enumNames[technique.enumValueIndex] == "Razzaque2001OverTimeRotation") {
EditorGUILayout.PropertyField(parametersObject.FindProperty("OverTimeRotation"), new GUIContent("Over Time Rotation Rate"));
Expand All @@ -112,13 +107,25 @@ public override void OnInspectorGUI() {
EditorGUILayout.PropertyField(parametersObject.FindProperty("CurvatureRadius"), new GUIContent("Curvature Radius"));
EditorGUILayout.Space(2);
EditorGUILayout.PropertyField(serializedObject.FindProperty("scene.aggregateFunction"), new GUIContent("Aggregate Function"));

WorldRedirection script = target as WorldRedirection;
script.techniqueInstance = script.scene.aggregateFunction switch {
HybridAggregate.Max => Razzaque2001Hybrid.Max(),
HybridAggregate.Sum => Razzaque2001Hybrid.Sum(),
HybridAggregate.WeightedSum => Razzaque2001Hybrid.Weighted(1/3,1/3,1/3), // TODO: add weights inside interface
_ => Razzaque2001Hybrid.Max()
};
switch (script.scene.aggregateFunction) {
case HybridAggregate.Max:
script.techniqueInstance = Razzaque2001Hybrid.Max();
break;
case HybridAggregate.Sum:
script.techniqueInstance = Razzaque2001Hybrid.Sum();
break;
case HybridAggregate.WeightedSum:
EditorGUILayout.PropertyField(parametersObject.FindProperty("HybridWeights"), new GUIContent("HybridWeights"));
script.techniqueInstance = Razzaque2001Hybrid.Weighted(script.scene.parameters.HybridWeights.x,
script.scene.parameters.HybridWeights.y,
script.scene.parameters.HybridWeights.z);
break;
default:
script.techniqueInstance = Razzaque2001Hybrid.Max();
break;
}
}
// if (technique.enumNames[technique.enumValueIndex] == "Azmandian2016World") {
// EditorGUILayout.PropertyField(parametersObject.FindProperty("GainsRotational"), new GUIContent("Gains Rotational"));
Expand All @@ -127,8 +134,6 @@ public override void OnInspectorGUI() {
EditorGUILayout.PropertyField(parametersObject.FindProperty("GainsTranslational"), new GUIContent("Translational Gains"));
}

EditorGUILayout.PropertyField(redirect, new GUIContent("Redirect"));

// Hides targets, dampening and smoothing if
if (strategyTechniques.Contains(technique.enumNames[technique.enumValueIndex])) {
if (targetsStrategies.Contains(strategy.enumNames[strategy.enumValueIndex])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ MonoBehaviour:
same: 1.05
opposite: 0.975
CurvatureRadius: 15
HybridWeights: {x: 1, y: 1, z: 1}
a: {x: 0, y: 0, z: 0}
SwampSquareLength: 0.25
SwampCDRatio: 0.75
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class ParametersToolkit: ScriptableObject {
public Vector2Rotation GainsRotational;
[Tooltip("The maximum gain in translation that can be applied to the user's point of view in rotation. Value is in °/m and is not a percentage.")]
public float CurvatureRadius = 15f;
[Tooltip("The weights used for the Razzaque2001Hybrid technique using the WeightedSum function.")]
public Vector3 HybridWeights = new(1f, 1f, 1f);



Expand Down

0 comments on commit 40a30f2

Please sign in to comment.