Skip to content
Snippets Groups Projects
Commit e041efeb authored by Paul-Walcher's avatar Paul-Walcher
Browse files

Added SimpleCircleFact

parent 352350f5
No related branches found
No related tags found
No related merge requests found
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3319392661904935552
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7541265271928914416}
- component: {fileID: 1312883106029576503}
- component: {fileID: 5284903402926663935}
- component: {fileID: 2574848627300415222}
- component: {fileID: 7280041197286401157}
m_Layer: 15
m_Name: Mesh Down
m_TagString: SnapZone
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7541265271928914416
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3319392661904935552}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: -0.01, z: 0}
m_LocalScale: {x: 1, y: 0.01, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6787775389045427190}
m_Father: {fileID: 3390467403729316765}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &1312883106029576503
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3319392661904935552}
m_Mesh: {fileID: 0}
--- !u!23 &5284903402926663935
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3319392661904935552}
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: 8ae9adf4dc782964387385c1e8c0eb72, 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: 0
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!64 &2574848627300415222
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3319392661904935552}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 0}
--- !u!114 &7280041197286401157
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3319392661904935552}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2}
Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2}
Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
renderer:
- {fileID: 5284903402926663935}
- {fileID: 1078883255209641429}
--- !u!1 &4682201382595328041
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6787775389045427190}
- component: {fileID: 6626359674163989219}
- component: {fileID: 4818731436791451552}
m_Layer: 15
m_Name: CircleHighlight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6787775389045427190
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4682201382595328041}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.96, y: 1, z: 0.96}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7541265271928914416}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &6626359674163989219
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4682201382595328041}
m_Mesh: {fileID: 0}
--- !u!23 &4818731436791451552
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4682201382595328041}
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: 8ae9adf4dc782964387385c1e8c0eb72, 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!1 &5866155945383417828
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8554957501859850914}
- component: {fileID: 3164742056485930267}
- component: {fileID: 1460740696286669547}
m_Layer: 15
m_Name: CircleHighlight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8554957501859850914
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5866155945383417828}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.96, y: 1, z: 0.96}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 142224692930156368}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3164742056485930267
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5866155945383417828}
m_Mesh: {fileID: 0}
--- !u!23 &1460740696286669547
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5866155945383417828}
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: 8ae9adf4dc782964387385c1e8c0eb72, 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!1 &6262947649539239553
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 142224692930156368}
- component: {fileID: 7167210412035754299}
- component: {fileID: 1078883255209641429}
- component: {fileID: 8526453253978894086}
- component: {fileID: -7239156242830623982}
m_Layer: 15
m_Name: Mesh Up
m_TagString: SnapZone
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &142224692930156368
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6262947649539239553}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0.01, z: 0}
m_LocalScale: {x: 1, y: 0.01, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8554957501859850914}
m_Father: {fileID: 3390467403729316765}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &7167210412035754299
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6262947649539239553}
m_Mesh: {fileID: 0}
--- !u!23 &1078883255209641429
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6262947649539239553}
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: 8ae9adf4dc782964387385c1e8c0eb72, 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: 0
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!64 &8526453253978894086
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6262947649539239553}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 0}
--- !u!114 &-7239156242830623982
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6262947649539239553}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2}
Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2}
Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
renderer:
- {fileID: 1078883255209641429}
- {fileID: 5284903402926663935}
--- !u!1 &6839596689016440457
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3390467403729316765}
- component: {fileID: 1812690906255965161}
- component: {fileID: 6950663371922587874}
m_Layer: 15
m_Name: SimpleCircle
m_TagString: Selectable
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3390467403729316765
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6839596689016440457}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 142224692930156368}
- {fileID: 7541265271928914416}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1812690906255965161
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6839596689016440457}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 405087c38b8537e43bcc99727c5325ec, type: 3}
m_Name:
m_EditorClassIdentifier:
Meshs:
- {fileID: 7167210412035754299}
- {fileID: 3164742056485930267}
- {fileID: 1312883106029576503}
- {fileID: 6626359674163989219}
NormalOffset: []
AlternateNormals: 0
radius: 1
sideCount: 500
--- !u!114 &6950663371922587874
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6839596689016440457}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2}
Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2}
Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
renderer:
- {fileID: 1078883255209641429}
fileFormatVersion: 2
guid: ba4e0d31779023d4d8a5767fd6dccf5c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44100717, g: 0.4898312, b: 0.5698877, a: 1}
m_IndirectSpecularColor: {r: 0.44084534, g: 0.48955458, b: 0.56959116, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -3967,7 +3967,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh103956
m_Name: pb_Mesh97366
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
......@@ -60742,6 +60742,12 @@ PrefabInstance:
value:
objectReference: {fileID: 537518992981541273, guid: 998991ab9f28e764691da393b005cab3,
type: 3}
- target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: SimpleCircle
value:
objectReference: {fileID: 6839596689016440457, guid: ba4e0d31779023d4d8a5767fd6dccf5c,
type: 3}
- target: {fileID: 2885104145836066559, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: m_AnchorMax.y
......@@ -21,6 +21,7 @@ public GameObject
Cone,
Rectangle,
Circle,
SimpleCircle,
Triangle;
private void OnEnable()
......@@ -64,6 +65,8 @@ public void SpawnFactRepresentation(Fact fact)
SpawnTruncatedCone(TruncatedConeVolumeFact); break;
case RectangleFact rectangleFact:
SpawnRectangle(rectangleFact); break;
case SimpleCircleFact simpleCircleFact:
SpawnSimpleCircle(simpleCircleFact); break;
case TriangleFact2 triangleFact:
SpawnTriangle(triangleFact); break;
default: break;
......@@ -80,6 +83,13 @@ public void SpawnRectangle(RectangleFact fact){
}
public void SpawnSimpleCircle(SimpleCircleFact fact){
GameObject simpleCircle = GameObject.Instantiate(SimpleCircle);
simpleCircle.transform.SetPositionAndRotation(fact.Position, fact.Rotation);
simpleCircle.transform.localScale = Vector3.Scale(simpleCircle.transform.localScale, fact.LocalScale);
}
public void SpawnTriangle(TriangleFact2 fact)
{
......
......@@ -79,6 +79,10 @@ public static class ParsingDictionary
MMTConstants.TriangleType,
TriangleFact2.parseFact
},
{
MMTConstants.SimpleCircleType,
SimpleCircleFact.parseFact
},
};
// TODO: get rid of this
......@@ -121,6 +125,7 @@ public static class ParsingDictionary
[JsonSubtypes.KnownSubType(typeof(RealLitFact), nameof(RealLitFact))]
[JsonSubtypes.KnownSubType(typeof(RectangleFact), nameof(RectangleFact))]
[JsonSubtypes.KnownSubType(typeof(TriangleFact2), nameof(TriangleFact2))]
[JsonSubtypes.KnownSubType(typeof(SimpleCircleFact), nameof(SimpleCircleFact))]
public abstract class Fact
{
[JsonIgnore]
......
using Newtonsoft.Json;
using REST_JSON_API;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
/// Point in 3D Space
/// </summary>
public class SimpleCircleFact : FactWrappedCRTP<SimpleCircleFact>
{
//used points
public string PidA, PidB, PidM;
public Vector3 M, A, B;
public float Area = 0.0F;
public float Radius = 0.0F;
public PointFact GetA {get => (PointFact)FactRecorder.AllFacts[PidA];}
public PointFact GetB {get => (PointFact)FactRecorder.AllFacts[PidB];}
public PointFact GetM {get => (PointFact)FactRecorder.AllFacts[PidM];}
protected void calculate_vectors(){
A = ((PointFact)FactRecorder.AllFacts[PidA]).Point + Vector3.zero;
B = ((PointFact)FactRecorder.AllFacts[PidB]).Point + Vector3.zero;
M = ((PointFact)FactRecorder.AllFacts[PidM]).Point + Vector3.zero;
Area = (Vector3.Distance(M, A) * Mathf.PI);
Radius = (Vector3.Distance(M, A));
Vector3 scale = new Vector3(Radius, Radius, 1.0F);
LocalScale = scale;
Position = M;
Rotation = Quaternion.LookRotation(Vector3.Cross((M-A), (A-B)), Vector3.up);
//Rotation = Quaternion.LookRotation(forward, new Vector3(1.0F, 0.0F, 0.0F));
}
public SimpleCircleFact() : base(){
this.PidA = null;
this.PidB = null;
this.PidM = null;
}
[JsonConstructor]
public SimpleCircleFact( string PidM, string PidA, string PidB) : base()
{
this.PidA = PidA;
this.PidB = PidB;
this.PidM = PidM;
calculate_vectors();
}
/// <summary>
/// Bypasses initialization of new MMT %Fact by using existend URI, _which is not checked for existence_.
/// <see cref="Normal"/> set to <c>Vector3.up</c>
/// </summary>
/// <param name="Point">sets <see cref="Point"/></param>
/// <param name="ServerDefinition">MMT URI as OMS</param>
public SimpleCircleFact(string PidM, string PidA, string PidB, SOMDoc ServerDefinition) : base()
{
this.PidA = PidA;
this.PidB = PidB;
this.PidM = PidM;
this.ServerDefinition = ServerDefinition;
calculate_vectors();
}
/// \copydoc Fact.parseFact(ScrollFact)
public new static IEnumerator parseFact(List<Fact> ret, MMTFact fact)
{
if (((MMTGeneralFact)fact).defines is not OMA df)
yield break;
OMS pointA, pointB, pointM;
pointM = (OMS)df.arguments[0];
pointA = (OMS)df.arguments[1];
pointB = (OMS)df.arguments[2];
string PidA = pointA.uri;
string PidB = pointB.uri;
string PidM = pointM.uri;
ret.Add(new SimpleCircleFact(PidM, PidA, PidB, fact.@ref));
//ParsingDictionary.parseTermsToId.TryAdd(defines.ToString(), fact.@ref.uri);
//ret.Add(new PointFact(SOMDoc.MakeVector3(defines), fact.@ref));
}
/// \copydoc Fact.hasDependentFacts
public override bool HasDependentFacts => true;
/// \copydoc Fact.getDependentFactIds
protected override string[] GetDependentFactIds()
=> new string[] { PidM, PidA, PidB};
/// \copydoc Fact.GetHashCode
/* public override int GetHashCode()
=> this.Point.GetHashCode();
*/
protected override void RecalculateTransform()
{
calculate_vectors();
}
/// \copydoc Fact.Equivalent(Fact, Fact)
protected override bool EquivalentWrapped(SimpleCircleFact f1, SimpleCircleFact f2){
return (
Math3d.IsApproximatelyEqual(f1.A, f2.A)
&& Math3d.IsApproximatelyEqual(f1.B, f2.B)
&& Math3d.IsApproximatelyEqual(f1.M, f2.M)
);
}
public bool isEqual(SimpleCircleFact f2){
return EquivalentWrapped(this, f2);
}
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new){
return new SimpleCircleFact(this.PidM, this.PidA, this.PidB);
}
public override MMTFact MakeMMTDeclaration()
{
SOMDoc tp = new OMS(MMTConstants.SimpleCircleType);
return new MMTGeneralFact(_LastLabel, tp, Defines());
}
public override SOMDoc Defines()
=> new OMA(
new OMS(MMTConstants.SimpleCircleCons),
new[] {
new OMS(PidM),
new OMS(PidA),
new OMS(PidB),
}
);
}
\ No newline at end of file
fileFormatVersion: 2
guid: ef5f556a10083d7409aae56a15f372a6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -52,6 +52,10 @@ public static class MMTConstants
public static readonly string CuboidType = "http://mathhub.info/FrameIT/frameworld?CuboidType?cuboidType";
public static readonly string CuboidScroll = "http://mathhub.info/FrameIT/frameworld?CuboidScroll";
public static readonly string SimpleCircleCons = "http://mathhub.info/FrameIT/frameworld?CircleType?circleCons";
public static readonly string SimpleCircleType = "http://mathhub.info/FrameIT/frameworld?CircleType?circleType";
public static readonly string SimpleCircleScroll = "http://mathhub.info/FrameIT/frameworld?SimpleCircleScroll";
public static readonly string CircleType3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circleType3D";
public static readonly string MkCircle3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circle3D";
public static readonly string TriangleMiddlePoint = "http://mathhub.info/FrameIT/frameworld?FrameITTriangles?triangleMidPointWrapper";
......@@ -161,6 +165,10 @@ public static class MMTConstants
RectangleType,
typeof(RectangleFact)
},
{
SimpleCircleType,
typeof(SimpleCircleFact)
},
{
TriangleType,
typeof(TriangleFact2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment