Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xulijie Li
MathsEngine
Commits
41013d65
Commit
41013d65
authored
Nov 10, 2020
by
BlackAngle233
Browse files
11.10 update
parent
b23a6173
Changes
19
Hide whitespace changes
Inline
Side-by-side
MRTK test/Assets/Prefabs/Ellipse.prefab
deleted
100644 → 0
View file @
b23a6173
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&1483626023200906509
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1483626023200906506
}
-
component
:
{
fileID
:
1483626023200906505
}
-
component
:
{
fileID
:
1483626023200906504
}
-
component
:
{
fileID
:
1483626023200906507
}
m_Layer
:
0
m_Name
:
Ellipse
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1483626023200906506
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1483626023200906509
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-1.053
,
y
:
0
,
z
:
0.944
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&1483626023200906505
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1483626023200906509
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
094a6569e4454601b5928e64472d5228
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
lineStartClamp
:
0.0001
lineEndClamp
:
0.9999
customLineTransform
:
{
fileID
:
0
}
loops
:
1
transformMode
:
0
rotationMode
:
1
flipUpVector
:
0
originOffset
:
{
x
:
0
,
y
:
0
,
z
:
0
}
manualUpVectorBlend
:
0
manualUpVectors
:
-
{
x
:
0
,
y
:
1
,
z
:
0
}
-
{
x
:
0
,
y
:
1
,
z
:
0
}
-
{
x
:
0
,
y
:
1
,
z
:
0
}
velocitySearchRange
:
0.02
distorters
:
[]
distortionEnabled
:
1
distortionMode
:
0
distortionStrength
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
uniformDistortionStrength
:
1
resolution
:
36
radius
:
{
x
:
0.5
,
y
:
0.25
}
---
!u!120
&1483626023200906504
LineRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1483626023200906509
}
m_Enabled
:
1
m_CastShadows
:
0
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
0
m_LightProbeUsage
:
0
m_ReflectionProbeUsage
:
0
m_RayTracingMode
:
0
m_RenderingLayerMask
:
4294967295
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
2100000
,
guid
:
ddc1013c5e7bc0841bf61884ea0f39cd
,
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_Positions
:
-
{
x
:
-0.5530001
,
y
:
-0.4128429
,
z
:
1.587
}
-
{
x
:
-0.5632943
,
y
:
-0.36253142
,
z
:
1.587
}
-
{
x
:
-0.593629
,
y
:
-0.3142853
,
z
:
1.587
}
-
{
x
:
-0.642763
,
y
:
-0.27007896
,
z
:
1.587
}
-
{
x
:
-0.7086855
,
y
:
-0.23172152
,
z
:
1.587
}
-
{
x
:
-0.78869855
,
y
:
-0.20078266
,
z
:
1.587
}
-
{
x
:
-0.8795279
,
y
:
-0.17852853
,
z
:
1.587
}
-
{
x
:
-0.97745633
,
y
:
-0.16586988
,
z
:
1.587
}
-
{
x
:
-1.0784763
,
y
:
-0.16332471
,
z
:
1.587
}
-
{
x
:
-1.1784538
,
y
:
-0.17099722
,
z
:
1.587
}
-
{
x
:
-1.2732971
,
y
:
-0.18857338
,
z
:
1.587
}
-
{
x
:
-1.3591251
,
y
:
-0.21533398
,
z
:
1.587
}
-
{
x
:
-1.4324253
,
y
:
-0.25018376
,
z
:
1.587
}
-
{
x
:
-1.4901979
,
y
:
-0.29169664
,
z
:
1.587
}
-
{
x
:
-1.5300786
,
y
:
-0.33817366
,
z
:
1.587
}
-
{
x
:
-1.5504357
,
y
:
-0.38771296
,
z
:
1.587
}
-
{
x
:
-1.5504357
,
y
:
-0.43828705
,
z
:
1.587
}
-
{
x
:
-1.5300786
,
y
:
-0.48782626
,
z
:
1.587
}
-
{
x
:
-1.4901979
,
y
:
-0.53430325
,
z
:
1.587
}
-
{
x
:
-1.4324253
,
y
:
-0.5758162
,
z
:
1.587
}
-
{
x
:
-1.3591251
,
y
:
-0.610666
,
z
:
1.587
}
-
{
x
:
-1.2732972
,
y
:
-0.63742656
,
z
:
1.587
}
-
{
x
:
-1.1784538
,
y
:
-0.6550027
,
z
:
1.587
}
-
{
x
:
-1.0784763
,
y
:
-0.66267526
,
z
:
1.587
}
-
{
x
:
-0.97745633
,
y
:
-0.6601301
,
z
:
1.587
}
-
{
x
:
-0.87952805
,
y
:
-0.6474715
,
z
:
1.587
}
-
{
x
:
-0.7886987
,
y
:
-0.6252173
,
z
:
1.587
}
-
{
x
:
-0.7086854
,
y
:
-0.5942784
,
z
:
1.587
}
-
{
x
:
-0.6427631
,
y
:
-0.555921
,
z
:
1.587
}
-
{
x
:
-0.59362906
,
y
:
-0.5117147
,
z
:
1.587
}
-
{
x
:
-0.5632943
,
y
:
-0.46346855
,
z
:
1.587
}
-
{
x
:
-0.5530001
,
y
:
-0.41315708
,
z
:
1.587
}
m_Parameters
:
serializedVersion
:
3
widthMultiplier
:
0.18
widthCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
colorGradient
:
serializedVersion
:
2
key0
:
{
r
:
0.0047169924
,
g
:
0.56144017
,
b
:
1
,
a
:
1
}
key1
:
{
r
:
0.0047169924
,
g
:
0.56144017
,
b
:
1
,
a
:
1
}
key2
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key3
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key4
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key5
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key6
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key7
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
ctime0
:
0
ctime1
:
65535
ctime2
:
0
ctime3
:
0
ctime4
:
0
ctime5
:
0
ctime6
:
0
ctime7
:
0
atime0
:
0
atime1
:
65535
atime2
:
0
atime3
:
0
atime4
:
0
atime5
:
0
atime6
:
0
atime7
:
0
m_Mode
:
0
m_NumColorKeys
:
2
m_NumAlphaKeys
:
2
numCornerVertices
:
8
numCapVertices
:
8
alignment
:
0
textureMode
:
0
shadowBias
:
0
generateLightingData
:
0
m_UseWorldSpace
:
1
m_Loop
:
1
---
!u!114
&1483626023200906507
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1483626023200906509
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
1287d4d138a242f794bcfc01354d3ae2
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
lineDataSource
:
{
fileID
:
1483626023200906505
}
lineColor
:
serializedVersion
:
2
key0
:
{
r
:
0.0047169924
,
g
:
0.56144017
,
b
:
1
,
a
:
1
}
key1
:
{
r
:
0.0047169924
,
g
:
0.56144017
,
b
:
1
,
a
:
1
}
key2
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key3
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key4
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key5
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key6
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key7
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
ctime0
:
0
ctime1
:
65535
ctime2
:
0
ctime3
:
0
ctime4
:
0
ctime5
:
0
ctime6
:
0
ctime7
:
0
atime0
:
0
atime1
:
65535
atime2
:
0
atime3
:
0
atime4
:
0
atime5
:
0
atime6
:
0
atime7
:
0
m_Mode
:
0
m_NumColorKeys
:
2
m_NumAlphaKeys
:
2
lineWidth
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
widthMultiplier
:
0.18
colorOffset
:
0
widthOffset
:
0
stepMode
:
0
lineStepCount
:
32
pointDistributionMode
:
1
customPointDistributionLength
:
0.1
customPointDistributionCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
0
outSlope
:
1
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
1
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
lineMaterial
:
{
fileID
:
2100000
,
guid
:
ddc1013c5e7bc0841bf61884ea0f39cd
,
type
:
2
}
roundedEdges
:
1
roundedCaps
:
1
fadeLineBrightnessOnEnable
:
1
fadeLinePercentage
:
0.55
fadeLineAnimationTime
:
0.65
lineRenderer
:
{
fileID
:
1483626023200906504
}
tileMaterialByWorldLength
:
0
tileMaterialScale
:
1
MRTK test/Assets/Prefabs/GameObject.prefab
deleted
100644 → 0
View file @
b23a6173
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&7066675710225985741
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
7066675710225985728
}
-
component
:
{
fileID
:
7066675710225985731
}
-
component
:
{
fileID
:
7066675710225985730
}
-
component
:
{
fileID
:
7066675710225985729
}
m_Layer
:
0
m_Name
:
GameObject
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&7066675710225985728
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7066675710225985741
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!23
&7066675710225985731
MeshRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7066675710225985741
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RayTracingMode
:
2
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
0
}
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
---
!u!33
&7066675710225985730
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7066675710225985741
}
m_Mesh
:
{
fileID
:
0
}
---
!u!114
&7066675710225985729
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7066675710225985741
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
c6bf611f908edb54cb58db1ada6b1124
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
MRTK test/Assets/Prefabs/Spline.prefab
deleted
100644 → 0
View file @
b23a6173
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&3367021541490072152
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
3367021541490072102
}
-
component
:
{
fileID
:
3367021541490072153
}
-
component
:
{
fileID
:
3367021541490072100
}
-
component
:
{
fileID
:
3367021541490072103
}
m_Layer
:
0
m_Name
:
Spline
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&3367021541490072102
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
3367021541490072152
}
m_LocalRotation
:
{
x
:
0
,
y
:
1
,
z
:
0
,
w
:
0
}
m_LocalPosition
:
{
x
:
-2
,
y
:
0
,
z
:
0.965
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
180
,
z
:
0
}
---
!u!114
&3367021541490072153
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
3367021541490072152
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
4196b75e9e3b4d0c95239473ccc333b8
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
lineStartClamp
:
0.0001
lineEndClamp
:
0.9999
customLineTransform
:
{
fileID
:
0
}
loops
:
0
transformMode
:
0
rotationMode
:
1
flipUpVector
:
0
originOffset
:
{
x
:
0
,
y
:
0
,
z
:
0
}
manualUpVectorBlend
:
0
manualUpVectors
:
-
{
x
:
0
,
y
:
1
,
z
:
0
}
-
{
x
:
0
,
y
:
1
,
z
:
0
}
velocitySearchRange
:
0.02
distorters
:
[]
distortionEnabled
:
1
distortionMode
:
0
distortionStrength
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
uniformDistortionStrength
:
1
controlPoints
:
-
position
:
{
x
:
0
,
y
:
0
,
z
:
0
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
-
position
:
{
x
:
0.5928917
,
y
:
0.0418154
,
z
:
0.0034427047
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
-
position
:
{
x
:
0.47503617
,
y
:
0.3083095
,
z
:
0.5011646
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
-
position
:
{
x
:
0
,
y
:
0.5
,
z
:
0.5
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
-
position
:
{
x
:
-0.44839406
,
y
:
0.6809397
,
z
:
0.49890068
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
-
position
:
{
x
:
-0.49537897
,
y
:
0.78584373
,
z
:
0.007106304
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
-
position
:
{
x
:
0
,
y
:
1
,
z
:
0
}
rotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
alignAllControlPoints
:
1
---
!u!120
&3367021541490072100
LineRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
3367021541490072152
}
m_Enabled
:
1
m_CastShadows
:
0
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
0
m_LightProbeUsage
:
0
m_ReflectionProbeUsage
:
0
m_RayTracingMode
:
0
m_RenderingLayerMask
:
4294967295
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
2100000
,
guid
:
ddc1013c5e7bc0841bf61884ea0f39cd
,
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_Positions
:
-
{
x
:
-2.0003557
,
y
:
-0.41297486
,
z
:
1.6079979
}
-
{
x
:
-2.106255
,
y
:
-0.40214247
,
z
:
1.6013929
}
-
{
x
:
-2.1949825
,
y
:
-0.38618496
,
z
:
1.5840528
}
-
{
x
:
-2.2671075
,
y
:
-0.36558452
,
z
:
1.5575771
}
-
{
x
:
-2.323199
,
y
:
-0.34082347
,
z
:
1.5235649
}
-
{
x
:
-2.3638265
,
y
:
-0.31238395
,
z
:
1.4836156
}
-
{
x
:
-2.3895595
,
y
:
-0.2807483
,
z
:
1.4393282
}
-
{
x
:
-2.400967
,
y
:
-0.24639878
,
z
:
1.3923023
}
-
{
x
:
-2.3986185
,
y
:
-0.20981754
,
z
:
1.3441367
}
-
{
x
:
-2.3830833
,
y
:
-0.17148685
,
z
:
1.2964311
}
-
{
x
:
-2.3549309
,
y
:
-0.13188899
,
z
:
1.2507844
}
-
{
x
:
-2.3147306
,
y
:
-0.09150618
,
z
:
1.208796
}
-
{
x
:
-2.2630515
,
y
:
-0.05082071
,
z
:
1.1720653
}
-
{
x
:
-2.200463
,
y
:
-0.010314673
,
z
:
1.1421912
}
-
{
x
:
-2.1275346
,
y
:
0.029529482
,
z
:
1.1207733
}
-
{
x
:
-2.0448356
,
y
:
0.068229645
,
z
:
1.1094108
}
-
{
x
:
-1.9578731
,
y
:
0.10427576
,
z
:
1.1096048
}
-
{
x
:
-1.8812482
,
y
:
0.13755274
,
z
:
1.1212165
}
-
{
x
:
-1.8149846
,
y
:
0.16937917
,
z
:
1.1427219
}
-
{
x
:
-1.7593092
,
y
:
0.2000534
,
z
:
1.1725506
}
-
{
x
:
-1.7144489
,
y
:
0.2298736
,
z
:
1.2091317
}
-
{
x
:
-1.6806309
,
y
:
0.25913835
,
z
:
1.2508949
}
-
{
x
:
-1.6580819
,
y
:
0.2881459
,
z
:
1.2962692
}
-
{
x
:
-1.6470289
,
y
:
0.31719482
,
z
:
1.3436844
}
-
{
x
:
-1.6476992
,
y
:
0.34658313
,
z
:
1.3915696
}
-
{
x
:
-1.6603196
,
y
:
0.37660939
,
z
:
1.4383541
}
-
{
x
:
-1.6851168
,
y
:
0.4075719
,
z
:
1.4824675
}
-
{
x
:
-1.7223182
,
y
:
0.4397692
,
z
:
1.5223393
}
-
{
x
:
-1.7721504
,
y
:
0.47349942
,
z
:
1.5563985
}
-
{
x
:
-1.8348407
,
y
:
0.5090609
,
z
:
1.5830748
}
-
{
x
:
-1.9106157
,
y
:
0.54675215
,
z
:
1.6007974
}
-
{
x
:
-1.9997029
,
y
:
0.58687156
,
z
:
1.6079956
}
m_Parameters
:
serializedVersion
:
3
widthMultiplier
:
0.42
widthCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
2.1987011
outSlope
:
2.1987011
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0.16707118
-
serializedVersion
:
3
time
:
1
value
:
0.006248474
inSlope
:
-1.8448529
outSlope
:
-1.8448529
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.18141192
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
colorGradient
:
serializedVersion
:
2
key0
:
{
r
:
0.6292379
,
g
:
0.37166253
,
b
:
0.9056604
,
a
:
1
}
key1
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
1
}
key2
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key3
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key4
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key5
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key6
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key7
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
ctime0
:
0
ctime1
:
65535
ctime2
:
0
ctime3
:
0
ctime4
:
0
ctime5
:
0
ctime6
:
0
ctime7
:
0
atime0
:
0
atime1
:
65535
atime2
:
0
atime3
:
0
atime4
:
0
atime5
:
0
atime6
:
0
atime7
:
0
m_Mode
:
0
m_NumColorKeys
:
2
m_NumAlphaKeys
:
2
numCornerVertices
:
8
numCapVertices
:
8
alignment
:
0
textureMode
:
0
shadowBias
:
0
generateLightingData
:
0
m_UseWorldSpace
:
1
m_Loop
:
0
---
!u!114
&3367021541490072103
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
3367021541490072152
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
1287d4d138a242f794bcfc01354d3ae2
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
lineDataSource
:
{
fileID
:
3367021541490072153
}
lineColor
:
serializedVersion
:
2
key0
:
{
r
:
0.6292379
,
g
:
0.37166253
,
b
:
0.9056604
,
a
:
1
}
key1
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
1
}
key2
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key3
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key4
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key5
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key6
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key7
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
ctime0
:
0
ctime1
:
65535
ctime2
:
0
ctime3
:
0
ctime4
:
0
ctime5
:
0
ctime6
:
0
ctime7
:
0
atime0
:
0
atime1
:
65535
atime2
:
0
atime3
:
0
atime4
:
0
atime5
:
0
atime6
:
0
atime7
:
0
m_Mode
:
0
m_NumColorKeys
:
2
m_NumAlphaKeys
:
2
lineWidth
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
2.1987011
outSlope
:
2.1987011
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0.16707118
-
serializedVersion
:
3
time
:
1
value
:
0.006248474
inSlope
:
-1.8448529
outSlope
:
-1.8448529
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.18141192
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
widthMultiplier
:
0.42
colorOffset
:
0
widthOffset
:
0
stepMode
:
0
lineStepCount
:
32
pointDistributionMode
:
1
customPointDistributionLength
:
0.1
customPointDistributionCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
0
outSlope
:
1
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
1
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
lineMaterial
:
{
fileID
:
2100000
,
guid
:
ddc1013c5e7bc0841bf61884ea0f39cd
,
type
:
2
}
roundedEdges
:
1
roundedCaps
:
1
fadeLineBrightnessOnEnable
:
1
fadeLinePercentage
:
0.55
fadeLineAnimationTime
:
0.65
lineRenderer
:
{
fileID
:
3367021541490072100
}
tileMaterialByWorldLength
:
0
tileMaterialScale
:
1
MRTK test/Assets/Scenes/SampleScene.unity
View file @
41013d65
...
...
@@ -121,6 +121,103 @@ NavMeshSettings:
debug
:
m_Flags
:
0
m_NavMeshData
:
{
fileID
:
0
}
---
!u!1
&384968185
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
384968189
}
-
component
:
{
fileID
:
384968188
}
-
component
:
{
fileID
:
384968187
}
-
component
:
{
fileID
:
384968186
}
m_Layer
:
0
m_Name
:
GameObject
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&384968186
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
384968185
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
a6c90b73b6862d24b9b9bd76ad26b47b
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
formula
:
x + y
minX
:
-1
maxX
:
1
minY
:
-1
maxY
:
1
---
!u!33
&384968187
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
384968185
}
m_Mesh
:
{
fileID
:
4300018
,
guid
:
a37785fa4a4129246a58f79132a1b6c6
,
type
:
3
}
---
!u!23
&384968188
MeshRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
384968185
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RayTracingMode
:
2
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
0
}
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
---
!u!4
&384968189
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
384968185
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
9.43
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
3
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&595124460
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -431,77 +528,3 @@ Transform:
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1001
&1782433715
PrefabInstance
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalPosition.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalPosition.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalRotation.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalRotation.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalRotation.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_RootOrder
value
:
3
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985728
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7066675710225985730
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_Mesh
value
:
objectReference
:
{
fileID
:
4300018
,
guid
:
a37785fa4a4129246a58f79132a1b6c6
,
type
:
3
}
-
target
:
{
fileID
:
7066675710225985741
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
propertyPath
:
m_Name
value
:
GameObject
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
6de4f243439a6ea4597b0d1d34e14ef9
,
type
:
3
}
MRTK test/Assets/Scripts/Calculator2D.cs
0 → 100644
View file @
41013d65
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Calculator2D
{
public
static
float
x
;
public
float
getNum
(
string
s
,
ref
int
index
)
{
bool
end
=
false
;
string
num
=
""
;
while
(!
end
&&
index
<
s
.
Length
)
{
if
((
s
[
index
]
>=
'0'
&&
s
[
index
]
<=
'9'
)
||
s
[
index
]
==
'.'
)
{
num
+=
s
[
index
];
index
++;
}
else
break
;
}
index
--;
return
float
.
Parse
(
num
);
}
//'('-0, '+-'-1,'*/'-2,'sct^l'-3
private
bool
calculateStack
(
int
prior
,
ref
Stack
<
float
>
numstack
,
ref
Stack
<
char
>
opstack
)
{
while
(
opstack
.
Count
>
0
)
{
char
operater
=
opstack
.
Peek
();
float
num1
;
float
num2
;
switch
(
operater
)
{
case
'+'
:
if
(
prior
==
1
||
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
+
num1
);
break
;
case
'-'
:
if
(
prior
==
1
||
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
-
num1
);
break
;
case
'*'
:
if
(
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
*
num1
);
break
;
case
'/'
:
if
(
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
if
(
num1
==
0
)
return
false
;
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
/
num1
);
break
;
case
'('
:
if
(
prior
==
0
)
opstack
.
Pop
();
return
true
;
case
's'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Sin
(
num1
));
break
;
case
'c'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Cos
(
num1
));
break
;
case
't'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Tan
(
num1
));
break
;
case
'^'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Pow
(
num2
,
num1
));
break
;
case
'l'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
if
(
num1
<=
0
)
return
false
;
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
if
(
num2
<=
0
||
num2
==
1
)
return
false
;
numstack
.
Push
(
Mathf
.
Log
(
num1
,
num2
));
break
;
default
:
break
;
}
}
return
true
;
}
public
bool
calculate2D
(
string
s
,
float
xIn
,
out
float
yOut
)
{
x
=
xIn
;
yOut
=
0
;
Stack
<
char
>
opstack
=
new
Stack
<
char
>();
Stack
<
float
>
numstack
=
new
Stack
<
float
>();
int
length
=
s
.
Length
;
int
index
;
char
peek
;
for
(
index
=
0
;
index
<
length
;
++
index
)
{
if
(
s
[
index
]
==
'+'
||
s
[
index
]
==
'-'
)
{
if
(
index
==
0
)
{
s
=
"0"
+
s
;
length
++;
}
else
{
if
(
s
[
index
-
1
]
==
'('
)
{
s
.
Insert
(
index
-
1
,
"0"
);
length
++;
}
}
}
}
index
=
0
;
while
(
index
<
length
)
{
Debug
.
Log
(
s
[
index
]);
switch
(
s
[
index
])
{
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
numstack
.
Push
(
getNum
(
s
,
ref
index
));
break
;
case
'x'
:
numstack
.
Push
(
x
);
break
;
case
'('
:
opstack
.
Push
(
'('
);
break
;
case
')'
:
if
(!
calculateStack
(
0
,
ref
numstack
,
ref
opstack
))
return
false
;
break
;
case
'+'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
)
{
if
(!
calculateStack
(
1
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'+'
);
break
;
case
'-'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
)
{
if
(!
calculateStack
(
1
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'-'
);
break
;
case
'*'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
&&
peek
!=
'*'
&&
peek
!=
'/'
)
{
if
(!
calculateStack
(
2
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'*'
);
break
;
case
'/'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
&&
peek
!=
'*'
&&
peek
!=
'/'
)
{
if
(!
calculateStack
(
2
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'/'
);
break
;
case
's'
:
if
(
s
[
index
+
1
]
==
'i'
&&
s
[
index
+
2
]
==
'n'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
's'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
case
'c'
:
if
(
s
[
index
+
1
]
==
'o'
&&
s
[
index
+
2
]
==
's'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
'c'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
case
't'
:
if
(
s
[
index
+
1
]
==
'a'
&&
s
[
index
+
2
]
==
'n'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
't'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
case
'^'
:
opstack
.
Push
(
'^'
);
break
;
case
'l'
:
if
(
s
[
index
+
1
]
==
'o'
&&
s
[
index
+
2
]
==
'g'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
'l'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
default
:
break
;
}
index
++;
}
while
(
opstack
.
Count
>
0
)
{
calculateStack
(
3
,
ref
numstack
,
ref
opstack
);
}
yOut
=
numstack
.
Peek
();
return
true
;
}
}
MRTK test/Assets/Scripts/Calculator3D.cs
0 → 100644
View file @
41013d65
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Calculator3D
{
public
static
float
x
;
public
static
float
y
;
public
float
getNum
(
string
s
,
ref
int
index
)
{
bool
end
=
false
;
string
num
=
""
;
while
(!
end
&&
index
<
s
.
Length
)
{
if
((
s
[
index
]
>=
'0'
&&
s
[
index
]
<=
'9'
)
||
s
[
index
]
==
'.'
)
{
num
+=
s
[
index
];
index
++;
}
else
break
;
}
index
--;
return
float
.
Parse
(
num
);
}
//'('-0, '+-'-1,'*/'-2,'sct^l'-3
private
bool
calculateStack
(
int
prior
,
ref
Stack
<
float
>
numstack
,
ref
Stack
<
char
>
opstack
)
{
while
(
opstack
.
Count
>
0
)
{
char
operater
=
opstack
.
Peek
();
float
num1
;
float
num2
;
switch
(
operater
)
{
case
'+'
:
if
(
prior
==
1
||
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
+
num1
);
break
;
case
'-'
:
if
(
prior
==
1
||
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
-
num1
);
break
;
case
'*'
:
if
(
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
*
num1
);
break
;
case
'/'
:
if
(
prior
==
2
)
return
true
;
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
if
(
num1
==
0
)
return
false
;
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
num2
/
num1
);
break
;
case
'('
:
if
(
prior
==
0
)
opstack
.
Pop
();
return
true
;
case
's'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Sin
(
num1
));
break
;
case
'c'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Cos
(
num1
));
break
;
case
't'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Tan
(
num1
));
break
;
case
'^'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
numstack
.
Push
(
Mathf
.
Pow
(
num2
,
num1
));
break
;
case
'l'
:
opstack
.
Pop
();
num1
=
numstack
.
Peek
();
numstack
.
Pop
();
if
(
num1
<=
0
)
return
false
;
num2
=
numstack
.
Peek
();
numstack
.
Pop
();
if
(
num2
<=
0
||
num2
==
1
)
return
false
;
numstack
.
Push
(
Mathf
.
Log
(
num1
,
num2
));
break
;
default
:
break
;
}
}
return
true
;
}
public
bool
calculate3D
(
string
s
,
float
xIn
,
float
yIn
,
out
float
zOut
)
{
x
=
xIn
;
y
=
yIn
;
zOut
=
0
;
Stack
<
char
>
opstack
=
new
Stack
<
char
>();
Stack
<
float
>
numstack
=
new
Stack
<
float
>();
int
length
=
s
.
Length
;
int
index
;
char
peek
;
for
(
index
=
0
;
index
<
length
;
++
index
)
{
if
(
s
[
index
]
==
'+'
||
s
[
index
]
==
'-'
)
{
if
(
index
==
0
)
{
s
=
"0"
+
s
;
length
++;
}
else
{
if
(
s
[
index
-
1
]
==
'('
)
{
s
.
Insert
(
index
-
1
,
"0"
);
length
++;
}
}
}
}
index
=
0
;
while
(
index
<
length
)
{
switch
(
s
[
index
])
{
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
numstack
.
Push
(
getNum
(
s
,
ref
index
));
break
;
case
'x'
:
numstack
.
Push
(
x
);
break
;
case
'y'
:
numstack
.
Push
(
y
);
break
;
case
'('
:
opstack
.
Push
(
'('
);
break
;
case
')'
:
if
(!
calculateStack
(
0
,
ref
numstack
,
ref
opstack
))
return
false
;
break
;
case
'+'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
)
{
if
(!
calculateStack
(
1
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'+'
);
break
;
case
'-'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
)
{
if
(!
calculateStack
(
1
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'-'
);
break
;
case
'*'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
&&
peek
!=
'*'
&&
peek
!=
'/'
)
{
if
(!
calculateStack
(
2
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'*'
);
break
;
case
'/'
:
if
(
opstack
.
Count
!=
0
)
{
peek
=
opstack
.
Peek
();
if
(
peek
!=
'+'
&&
peek
!=
'-'
&&
peek
!=
'*'
&&
peek
!=
'/'
)
{
if
(!
calculateStack
(
2
,
ref
numstack
,
ref
opstack
))
return
false
;
}
}
opstack
.
Push
(
'/'
);
break
;
case
's'
:
if
(
s
[
index
+
1
]
==
'i'
&&
s
[
index
+
2
]
==
'n'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
's'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
case
'c'
:
if
(
s
[
index
+
1
]
==
'o'
&&
s
[
index
+
2
]
==
's'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
'c'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
case
't'
:
if
(
s
[
index
+
1
]
==
'a'
&&
s
[
index
+
2
]
==
'n'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
't'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
case
'^'
:
opstack
.
Push
(
'^'
);
break
;
case
'l'
:
if
(
s
[
index
+
1
]
==
'o'
&&
s
[
index
+
2
]
==
'g'
&&
s
[
index
+
3
]
==
'('
)
{
opstack
.
Push
(
'l'
);
opstack
.
Push
(
'('
);
index
+=
3
;
}
break
;
default
:
break
;
}
index
++;
}
while
(
opstack
.
Count
>
0
)
{
calculateStack
(
3
,
ref
numstack
,
ref
opstack
);
}
zOut
=
numstack
.
Peek
();
//Debug.Log(x.ToString() + "," + y.ToString() + "=" + zOut.ToString());
return
true
;
}
}
MRTK test/Assets/Scripts/Functions/Customized.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Customized
:
MonoBehaviour
{
Mesh
mesh
;
Calculator2D
calculator2D
;
public
string
formula
;
public
int
minX
;
public
int
maxX
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Customized"
};
calculator2D
=
new
Calculator2D
();
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawCustomized
()
{
mesh
.
Clear
();
bool
isContinue
=
false
;
Vector3
[]
vectors
=
new
Vector3
[
100
*
(
maxX
-
minX
)
+
1
];
int
[]
triangle
=
new
int
[
100
*
(
maxX
-
minX
)
*
2
];
int
k
=
0
;
float
step
=
0.01f
;
for
(
float
i
=
minX
;
i
<=
maxX
+
0.01f
;
i
+=
step
)
{
float
y
=
0
;
if
(
calculator2D
.
calculate2D
(
formula
,
i
,
out
y
))
{
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
if
(
isContinue
)
{
triangle
[
2
*
(
k
-
1
)]
=
k
-
1
;
triangle
[
2
*
(
k
-
1
)
+
1
]
=
k
;
}
else
{
triangle
[
2
*
(
k
-
1
)]
=
k
;
triangle
[
2
*
(
k
-
1
)
+
1
]
=
k
;
}
isContinue
=
true
;
}
else
{
if
(
k
!=
0
)
vectors
[
k
]
=
vectors
[
k
-
1
];
else
vectors
[
k
]
=
new
Vector3
(
0
,
0
,
-
1000
);
isContinue
=
false
;
}
k
++;
}
mesh
.
vertices
=
vectors
;
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/Ellipse.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Ellipse
:
MonoBehaviour
{
Mesh
mesh
;
public
Vector3
center
;
public
float
a
;
public
float
b
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Ellipse"
};
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawEllipse
()
{
mesh
.
Clear
();
Vector3
[]
vectors
=
new
Vector3
[
200
];
int
k
=
0
;
float
step
=
a
/
50
;
for
(
float
i
=
-
a
;
i
<=
a
;
i
+=
step
)
{
float
y
=
1
-
i
*
i
/
(
a
*
a
);
y
*=
(
b
*
b
);
y
=
Mathf
.
Sqrt
(
y
);
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
if
(
y
!=
0
)
{
vectors
[
200
-
k
]
=
new
Vector3
(
i
,
-
y
,
0
);
}
k
++;
}
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
400
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
triangle
[
398
]
=
199
;
triangle
[
399
]
=
0
;
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/Exponential.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Exponential
:
MonoBehaviour
{
Mesh
mesh
;
public
int
minX
;
public
int
maxX
;
public
float
factor
;
public
float
c
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Exponential"
};
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawExponential
()
{
mesh
.
Clear
();
float
step
=
0.01f
;
Vector3
[]
vectors
=
new
Vector3
[
100
*
(
maxX
-
minX
)
+
1
];
int
k
=
0
;
for
(
float
i
=
minX
;
i
<=
maxX
;
i
=
i
+
step
)
{
float
y
=
Mathf
.
Pow
(
c
,
i
);
y
*=
factor
;
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
k
++;
}
vectors
[
100
*
(
maxX
-
minX
)]
=
new
Vector3
(
maxX
,
Mathf
.
Pow
(
c
,
maxX
)
*
factor
,
0
);
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
100
*
(
maxX
-
minX
)
*
2
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/Hyperbola.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Hyperbola
:
MonoBehaviour
{
Mesh
mesh
;
public
Vector3
center
;
public
float
a
;
public
float
b
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Hyperbola"
};
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawHyperbola
()
{
mesh
.
Clear
();
Vector3
[]
vectors
=
new
Vector3
[
202
];
int
k
=
0
;
float
step
=
a
/
100
;
float
x
=
-
a
;
while
(
k
<
51
)
{
float
y
=
x
*
x
/
(
a
*
a
)
-
1
;
y
*=
(
b
*
b
);
y
=
Mathf
.
Sqrt
(
y
);
vectors
[
50
+
k
]
=
new
Vector3
(
x
,
y
,
0
);
if
(
y
!=
0
)
{
vectors
[
50
-
k
]
=
new
Vector3
(
x
,
-
y
,
0
);
}
x
-=
step
;
step
*=
1.1f
;
k
++;
}
x
=
a
;
step
=
a
/
100
;
k
=
0
;
while
(
k
<
51
)
{
float
y
=
x
*
x
/
(
a
*
a
)
-
1
;
y
*=
(
b
*
b
);
y
=
Mathf
.
Sqrt
(
y
);
vectors
[
151
+
k
]
=
new
Vector3
(
x
,
y
,
0
);
if
(
y
!=
0
)
{
vectors
[
151
-
k
]
=
new
Vector3
(
x
,
-
y
,
0
);
}
x
+=
step
;
step
*=
1.1f
;
k
++;
}
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
400
];
for
(
int
i
=
0
;
i
<
100
;
++
i
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
for
(
int
i
=
100
;
i
<
200
;
++
i
)
{
triangle
[
2
*
i
]
=
i
+
1
;
triangle
[
2
*
i
+
1
]
=
i
+
2
;
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/InverseTri.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
InverseTri
:
MonoBehaviour
{
Mesh
mesh
;
public
int
minX
;
public
int
maxX
;
public
enum
InverseTriTpye
{
Arcsin
,
Arccos
,
Arctan
}
public
InverseTriTpye
inverseTriTpye
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"InverseTri"
};
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawInverseTri
()
{
mesh
.
Clear
();
if
(
inverseTriTpye
!=
InverseTriTpye
.
Arctan
)
{
float
step
=
0.01f
;
Vector3
[]
vectors
=
new
Vector3
[
100
*
2
+
1
];
int
k
=
0
;
for
(
float
i
=
-
1
;
i
<=
1
;
i
=
i
+
step
)
{
float
y
=
i
;
switch
(
inverseTriTpye
)
{
case
InverseTriTpye
.
Arcsin
:
y
=
Mathf
.
Asin
(
y
);
break
;
case
InverseTriTpye
.
Arccos
:
y
=
Mathf
.
Acos
(
y
);
break
;
default
:
break
;
}
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
k
++;
}
switch
(
inverseTriTpye
)
{
case
InverseTriTpye
.
Arcsin
:
vectors
[
100
*
2
]
=
new
Vector3
(
1
,
Mathf
.
Asin
(
1
),
0
);
break
;
case
InverseTriTpye
.
Arccos
:
vectors
[
100
*
2
]
=
new
Vector3
(
1
,
Mathf
.
Acos
(
1
),
0
);
break
;
default
:
break
;
}
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
100
*
2
*
2
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
if
(
vectors
[
i
].
y
*
vectors
[
i
+
1
].
y
>=
0
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
else
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
;
}
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
}
else
{
float
step
=
0.01f
;
Vector3
[]
vectors
=
new
Vector3
[
100
*
(
maxX
-
minX
)
+
1
];
int
k
=
0
;
for
(
float
i
=
-
1
;
i
<=
1
;
i
=
i
+
step
)
{
float
y
=
i
;
y
=
Mathf
.
Atan
(
y
);
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
k
++;
}
vectors
[
100
*
(
maxX
-
minX
)]
=
new
Vector3
(
maxX
,
Mathf
.
Atan
(
maxX
),
0
);
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
100
*
(
maxX
-
minX
)
*
2
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
if
(
vectors
[
i
].
y
*
vectors
[
i
+
1
].
y
>=
0
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
else
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
;
}
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
}
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/Logarithmic.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Logarithmic
:
MonoBehaviour
{
Mesh
mesh
;
public
int
maxX
;
public
float
factor
;
public
float
a
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Logarithmic"
};
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawLogarithmic
()
{
mesh
.
Clear
();
float
step
=
0.01f
;
Vector3
[]
vectors
=
new
Vector3
[
100
*
maxX
];
int
k
=
0
;
float
down
=
Mathf
.
Log
(
a
);
for
(
float
i
=
step
;
i
<=
maxX
;
i
=
i
+
step
)
{
float
y
=
Mathf
.
Log
(
i
)
/
down
;
y
*=
factor
;
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
k
++;
}
vectors
[
100
*
maxX
-
1
]
=
new
Vector3
(
maxX
,
Mathf
.
Log
(
maxX
)
/
down
*
factor
,
0
);
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
100
*
maxX
*
2
-
2
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/Spline.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Spline
:
MonoBehaviour
{
Mesh
mesh
;
public
int
minX
;
public
int
maxX
;
public
List
<
float
>
factors
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Spline"
};
factors
=
new
List
<
float
>();
factors
.
Add
(
1
);
factors
.
Add
(
0
);
factors
.
Add
(
1
);
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawSpline
()
{
mesh
.
Clear
();
Vector3
[]
vectors
=
new
Vector3
[
100
*
(
maxX
-
minX
)
+
1
];
int
k
=
0
;
float
step
=
0.01f
;
for
(
float
i
=
minX
;
i
<=
maxX
;
i
+=
step
)
{
float
y
=
0
;
for
(
int
j
=
factors
.
Count
-
1
;
j
>
0
;
--
j
)
{
y
+=
factors
[
j
];
y
*=
i
;
}
y
+=
factors
[
0
];
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
k
++;
}
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
100
*
(
maxX
-
minX
)
*
2
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/ThreeD.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
ThreeD
:
MonoBehaviour
{
Mesh
mesh
;
Calculator3D
calculator3D
;
public
string
formula
;
public
int
minX
;
public
int
maxX
;
public
int
minY
;
public
int
maxY
;
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"ThreeD"
};
calculator3D
=
new
Calculator3D
();
DrawCustomized
();
}
// Update is called once per frame
public
void
DrawCustomized
()
{
mesh
.
Clear
();
Vector3
[]
vectors
=
new
Vector3
[(
10
*
(
maxX
-
minX
)
+
1
)
*
(
10
*
(
maxY
-
minY
)
+
1
)];
int
[]
triangle
=
new
int
[
100
*
(
maxX
-
minX
)
*
(
maxY
-
minY
)
*
2
*
3
];
int
k
=
0
;
float
step
=
0.1f
;
for
(
float
i
=
minX
;
i
<=
maxX
+
0.01f
;
i
+=
step
)
{
for
(
float
j
=
minY
;
j
<=
maxY
+
0.01f
;
j
+=
step
)
{
float
z
=
0
;
if
(
calculator3D
.
calculate3D
(
formula
,
i
,
j
,
out
z
))
{
vectors
[
k
]
=
new
Vector3
(
i
,
j
,
z
);
}
else
{
vectors
[
k
]
=
vectors
[
k
-
1
];
}
++
k
;
}
}
int
lineCount
=
10
*
(
maxY
-
minY
)
+
1
;
int
line
=
0
;
for
(
int
i
=
0
;
i
<
lineCount
-
1
;
++
i
)
{
i
*=
lineCount
;
for
(
int
j
=
0
;
j
<
lineCount
-
1
;
++
j
)
{
triangle
[
6
*
(
i
+
j
-
line
)]
=
(
i
+
j
);
triangle
[
6
*
(
i
+
j
-
line
)
+
1
]
=
(
i
+
j
)
+
1
;
triangle
[
6
*
(
i
+
j
-
line
)
+
2
]
=
(
i
+
j
)
+
lineCount
;
triangle
[
6
*
(
i
+
j
-
line
)
+
3
]
=
(
i
+
j
)
+
1
;
;
triangle
[
6
*
(
i
+
j
-
line
)
+
4
]
=
(
i
+
j
)
+
lineCount
+
1
;
triangle
[
6
*
(
i
+
j
-
line
)
+
5
]
=
(
i
+
j
)
+
lineCount
;
}
i
/=
lineCount
;
line
++;
}
mesh
.
vertices
=
vectors
;
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Triangles
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/Functions/Trigonometric.cs
0 → 100644
View file @
41013d65
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Trigonometric
:
MonoBehaviour
{
Mesh
mesh
;
public
int
minX
;
public
int
maxX
;
public
TriType
triType
;
public
float
a
;
public
float
b
;
public
float
factor
;
public
enum
TriType
{
Sin
,
Cos
,
Tan
}
// Start is called before the first frame update
void
Start
()
{
mesh
=
new
Mesh
{
name
=
"Trigonometric"
};
}
// Update is called once per frame
void
Update
()
{
}
public
void
DrawTrigonometric
()
{
mesh
.
Clear
();
float
step
=
0.01f
;
Vector3
[]
vectors
=
new
Vector3
[
100
*
(
maxX
-
minX
)
+
1
];
int
k
=
0
;
for
(
float
i
=
minX
;
i
<=
maxX
;
i
=
i
+
step
)
{
float
y
=
a
*
i
+
b
;
switch
(
triType
)
{
case
TriType
.
Sin
:
y
=
Mathf
.
Sin
(
y
);
break
;
case
TriType
.
Cos
:
y
=
Mathf
.
Cos
(
y
);
break
;
case
TriType
.
Tan
:
y
=
Mathf
.
Tan
(
y
);
break
;
default
:
break
;
}
y
*=
factor
;
vectors
[
k
]
=
new
Vector3
(
i
,
y
,
0
);
k
++;
}
switch
(
triType
)
{
case
TriType
.
Sin
:
vectors
[
100
*
(
maxX
-
minX
)]
=
new
Vector3
(
maxX
,
Mathf
.
Sin
(
a
*
maxX
+
b
)
*
factor
,
0
);
break
;
case
TriType
.
Cos
:
vectors
[
100
*
(
maxX
-
minX
)]
=
new
Vector3
(
maxX
,
Mathf
.
Cos
(
a
*
maxX
+
b
)
*
factor
,
0
);
break
;
case
TriType
.
Tan
:
vectors
[
100
*
(
maxX
-
minX
)]
=
new
Vector3
(
maxX
,
Mathf
.
Tan
(
a
*
maxX
+
b
)
*
factor
,
0
);
break
;
default
:
break
;
}
mesh
.
vertices
=
vectors
;
int
[]
triangle
=
new
int
[
100
*
(
maxX
-
minX
)
*
2
];
for
(
int
i
=
0
;
i
<
vectors
.
Length
-
1
;
++
i
)
{
if
(
vectors
[
i
].
y
*
vectors
[
i
+
1
].
y
>=
0
)
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
+
1
;
}
else
{
triangle
[
2
*
i
]
=
i
;
triangle
[
2
*
i
+
1
]
=
i
;
}
}
mesh
.
SetIndices
(
triangle
,
MeshTopology
.
Lines
,
0
);
GetComponent
<
MeshFilter
>().
mesh
=
mesh
;
}
}
MRTK test/Assets/Scripts/NormalFunctionTest.cs
View file @
41013d65
...
...
@@ -53,9 +53,8 @@ public class NormalFunctionTest : MonoBehaviour
//DrawHyperbola(new Vector3(0, 0, 0), 3, 2);
//DrawExponential(2, 3);
//DrawLogarithmic(2, 3);
DrawTrigonometric
(
TriType
.
Sin
,
1
,
0
,
1
);
//DrawTrigonometric(TriType.Sin, 1, 0, 1);
}
// Update is called once per frame
...
...
doc/10.27/10.27.md
View file @
41013d65
...
...
@@ -13,6 +13,7 @@
*
将 Windows 和 HoloLens2 连接在同一局域网下,可以在 HoloLens2 的设置中看到其 IP,直接在电脑上访问
*
调试需要在 HoloLens2 上下载 Holographic Remoting Player 软件并打开,再在 Unity 中 ’Window’-‘XR’-‘Holographic Emulation’ 中输入其 IP 并尝试连接
*
尝试多次后依旧连接不上......
*
10.29:更新了 HoloLens2 的固件版本后,成功连接上
*
根据官方文档,需要下载并导入 MRTK.Tutorials.PCHolograhicRemoting 包,将 HolographicRemoting 预制体拖入场景中,再使用 unity build 后在 VS 中运行
*
VS 编译未通过,暂时未成功
...
...
doc/11.10/11.10.md
0 → 100644
View file @
41013d65
# 11.10
*
整理之前测试用的代码,将基本函数剥离到各自的脚本中
*
见 Functions -> Spline / Ellipse / Hyperbola / Exponential / Logarithmic / Trigonometric / InverseTri
*
增加了自定义函数绘制的支持,结合之前做的 Calculator 进行 Mesh 绘制并且通过测试
*
增加了三维自定义函数绘制的支持
*
目前只支持固定 X-Y 范围内的绘制,无法自定义复杂区间
*
增加了函数断点的判断,从而支持绘制不完全连续的函数
*
但是在三维函数情况中,情况更为复杂,因而还未做相应的处理
*
而且参考中学数学,三维函数似乎只会用在平面之上,不会出现复杂情况
doc/11.3/11.3.md
0 → 100644
View file @
41013d65
# 11.3
## 10.29
*
与 Microsoft 支持进行联系,更新了 HoloLens2 的固件版本,解决了有时无法开机以及连接不上 Unity 的问题
*
在 HoloLens2 上尝试了 MRTK 中的实例场景:
*
对于物体的拖拽缩放,经常会出现由于手运动幅度太大导致离开识别范围,因而在设计时应该尽量避免大幅度的拖拽操作,保持物体在画面中心较好
*
HoloLens2 对点击或是握拳选中的判定略有硬核,难以进行精确选择,因而物体交互的判定范围不能太小,尤其是选点之类的操作
*
相比之下,对于语音识别的精度就较高,可以考虑多加使用
## 10.30
*
参考之前学长做的 mathx 的 Hololens 版本(但是丢失了很多素材所以不能运行,只能看看脚本)
*
沿用其中的 calculator 的想法,使引擎支持自定义函数的绘制,同时依旧保留基础函数的绘制功能(考虑到之后还需要定制化例如对称轴,焦点等特殊信息的绘制)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment