siyao
4 年前
当前提交
2a6b7284
共有 67 个文件被更改,包括 3969 次插入 和 959 次删除
-
3Samples/UIWidgetsSamples_2019_4/Assets/Editor/Widgets.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/animation/widgets.cs
-
37com.unity.uiwidgets/Runtime/cupertino/action_sheet.cs
-
33com.unity.uiwidgets/Runtime/cupertino/dialog.cs
-
9com.unity.uiwidgets/Runtime/cupertino/text_selection.cs
-
1com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
-
2com.unity.uiwidgets/Runtime/gestures/binding.cs
-
16com.unity.uiwidgets/Runtime/gestures/drag_details.cs
-
632com.unity.uiwidgets/Runtime/gestures/events.cs
-
49com.unity.uiwidgets/Runtime/gestures/hit_test.cs
-
50com.unity.uiwidgets/Runtime/gestures/long_press.cs
-
153com.unity.uiwidgets/Runtime/gestures/monodrag.cs
-
95com.unity.uiwidgets/Runtime/gestures/multitap.cs
-
81com.unity.uiwidgets/Runtime/gestures/pointer_router.cs
-
4com.unity.uiwidgets/Runtime/gestures/pointer_signal_resolver.cs
-
132com.unity.uiwidgets/Runtime/gestures/recognizer.cs
-
8com.unity.uiwidgets/Runtime/gestures/tap.cs
-
4com.unity.uiwidgets/Runtime/material/bottom_navigation_bar.cs
-
8com.unity.uiwidgets/Runtime/material/chip.cs
-
4com.unity.uiwidgets/Runtime/material/flexible_space_bar.cs
-
8com.unity.uiwidgets/Runtime/material/ink_decoration.cs
-
8com.unity.uiwidgets/Runtime/material/ink_highlight.cs
-
8com.unity.uiwidgets/Runtime/material/ink_ripple.cs
-
12com.unity.uiwidgets/Runtime/material/ink_splash.cs
-
107com.unity.uiwidgets/Runtime/material/input_decorator.cs
-
18com.unity.uiwidgets/Runtime/material/list_tile.cs
-
4com.unity.uiwidgets/Runtime/material/material.cs
-
4com.unity.uiwidgets/Runtime/material/text_selection.cs
-
136com.unity.uiwidgets/Runtime/painting/matrix_utils.cs
-
124com.unity.uiwidgets/Runtime/rendering/box.cs
-
23com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs
-
4com.unity.uiwidgets/Runtime/rendering/custom_layout.cs
-
4com.unity.uiwidgets/Runtime/rendering/custom_paint.cs
-
4com.unity.uiwidgets/Runtime/rendering/flex.cs
-
151com.unity.uiwidgets/Runtime/rendering/layer.cs
-
4com.unity.uiwidgets/Runtime/rendering/list_body.cs
-
10com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs
-
27com.unity.uiwidgets/Runtime/rendering/object.cs
-
256com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
-
8com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs
-
42com.unity.uiwidgets/Runtime/rendering/rotated_box.cs
-
28com.unity.uiwidgets/Runtime/rendering/shifted_box.cs
-
141com.unity.uiwidgets/Runtime/rendering/sliver.cs
-
10com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
-
18com.unity.uiwidgets/Runtime/rendering/sliver_padding.cs
-
10com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs
-
86com.unity.uiwidgets/Runtime/rendering/stack.cs
-
40com.unity.uiwidgets/Runtime/rendering/table.cs
-
21com.unity.uiwidgets/Runtime/rendering/view.cs
-
45com.unity.uiwidgets/Runtime/rendering/viewport.cs
-
4com.unity.uiwidgets/Runtime/rendering/wrap.cs
-
16com.unity.uiwidgets/Runtime/widgets/basic.cs
-
14com.unity.uiwidgets/Runtime/widgets/container.cs
-
3com.unity.uiwidgets/Runtime/widgets/heroes.cs
-
54com.unity.uiwidgets/Runtime/widgets/implicit_animations.cs
-
4com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
-
4com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs
-
500com.unity.uiwidgets/Runtime/widgets/overlay.cs
-
35com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs
-
8com.unity.uiwidgets/Runtime/widgets/transitions.cs
-
19com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs
-
125Samples/UIWidgetsSamples_2019_4/Assets/ReduxSample/LocalPositionSample.cs
-
11Samples/UIWidgetsSamples_2019_4/Assets/ReduxSample/LocalPositionSample.cs.meta
-
536Samples/UIWidgetsSamples_2019_4/Assets/Scenes/LocalPosition.unity
-
7Samples/UIWidgetsSamples_2019_4/Assets/Scenes/LocalPosition.unity.meta
-
892com.unity.uiwidgets/Runtime/ui/Matrix4.cs
-
11com.unity.uiwidgets/Runtime/ui/Matrix4.cs.meta
|
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using Unity.UIWidgets.engine; |
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.gestures; |
|||
using Unity.UIWidgets.material; |
|||
using Unity.UIWidgets.painting; |
|||
using Unity.UIWidgets.rendering; |
|||
using Unity.UIWidgets.ui; |
|||
using Unity.UIWidgets.widgets; |
|||
using UnityEngine; |
|||
|
|||
public class LocalPositionSample : UIWidgetsPanel |
|||
{ |
|||
protected override void OnEnable() |
|||
{ |
|||
base.OnEnable(); |
|||
} |
|||
|
|||
protected override Widget createWidget() |
|||
{ |
|||
{ |
|||
return new MaterialApp( |
|||
title: "Flutter Demo", |
|||
theme: new ThemeData( |
|||
primarySwatch: Colors.blue |
|||
), |
|||
home: new MyHomePage(title: "Local Position Test")); |
|||
} |
|||
} |
|||
|
|||
public class MyHomePage : StatefulWidget |
|||
{ |
|||
public MyHomePage(string title, Key key = null) : base(key: key) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public readonly string title; |
|||
|
|||
public override State createState() |
|||
{ |
|||
return new _MyHomePageState(); |
|||
} |
|||
} |
|||
|
|||
public class _MyHomePageState : State<MyHomePage> |
|||
{ |
|||
Offset _globalPostion = Offset.zero; |
|||
Offset _localPostion = Offset.zero; |
|||
|
|||
void _checkPosition(TapUpDetails tapUpDetails) |
|||
{ |
|||
setState(() => |
|||
{ |
|||
_globalPostion = tapUpDetails.globalPosition; |
|||
_localPostion = tapUpDetails.localPosition; |
|||
}); |
|||
} |
|||
|
|||
void _checkPosition(TapDownDetails tapUpDetails) |
|||
{ |
|||
setState(() => |
|||
{ |
|||
_globalPostion = tapUpDetails.globalPosition; |
|||
_localPostion = tapUpDetails.localPosition; |
|||
}); |
|||
} |
|||
|
|||
public override Widget build(BuildContext context) |
|||
{ |
|||
return new Scaffold( |
|||
appBar: new AppBar( |
|||
title: new Text(widget.title) |
|||
), |
|||
body: new Center( |
|||
child: new Column( |
|||
mainAxisAlignment: MainAxisAlignment.center, |
|||
children: new List<Widget>() |
|||
{ |
|||
new Text( |
|||
"Tap to get global position and local position:" |
|||
), |
|||
new Text( |
|||
$"global position: {_globalPostion}", |
|||
style: Theme.of(context).textTheme.headline |
|||
), |
|||
new Text( |
|||
$"local position: {_localPostion}", |
|||
style: Theme.of(context).textTheme.headline |
|||
), |
|||
new GestureDetector( |
|||
onTapUp: _checkPosition, |
|||
child: new Container( |
|||
margin: EdgeInsets.all(10), |
|||
padding: EdgeInsets.all(10), |
|||
decoration: new BoxDecoration(color: Colors.red), |
|||
child: new Text("On Tap Up") |
|||
) |
|||
), |
|||
new GestureDetector( |
|||
onTapDown: _checkPosition, |
|||
child: new Container( |
|||
margin: EdgeInsets.all(10), |
|||
padding: EdgeInsets.all(30), |
|||
decoration: new BoxDecoration(Colors.orange), |
|||
child: new Text("on Tap Down") |
|||
) |
|||
), |
|||
new GestureDetector( |
|||
onTapDown: _checkPosition, |
|||
child: new Container( |
|||
padding: EdgeInsets.all(30), |
|||
decoration: new BoxDecoration(Colors.pink), |
|||
child: new Text("on Tap Down with 0 margin") |
|||
) |
|||
) |
|||
} |
|||
) |
|||
) |
|||
); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4c6d96aaa15e54a47a53543e4c7ab81b |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!29 &1 |
|||
OcclusionCullingSettings: |
|||
m_ObjectHideFlags: 0 |
|||
serializedVersion: 2 |
|||
m_OcclusionBakeSettings: |
|||
smallestOccluder: 5 |
|||
smallestHole: 0.25 |
|||
backfaceThreshold: 100 |
|||
m_SceneGUID: 00000000000000000000000000000000 |
|||
m_OcclusionCullingData: {fileID: 0} |
|||
--- !u!104 &2 |
|||
RenderSettings: |
|||
m_ObjectHideFlags: 0 |
|||
serializedVersion: 9 |
|||
m_Fog: 0 |
|||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} |
|||
m_FogMode: 3 |
|||
m_FogDensity: 0.01 |
|||
m_LinearFogStart: 0 |
|||
m_LinearFogEnd: 300 |
|||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} |
|||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} |
|||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} |
|||
m_AmbientIntensity: 1 |
|||
m_AmbientMode: 0 |
|||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} |
|||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_HaloStrength: 0.5 |
|||
m_FlareStrength: 1 |
|||
m_FlareFadeSpeed: 3 |
|||
m_HaloTexture: {fileID: 0} |
|||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} |
|||
m_DefaultReflectionMode: 0 |
|||
m_DefaultReflectionResolution: 128 |
|||
m_ReflectionBounces: 1 |
|||
m_ReflectionIntensity: 1 |
|||
m_CustomReflection: {fileID: 0} |
|||
m_Sun: {fileID: 0} |
|||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} |
|||
m_UseRadianceAmbientProbe: 0 |
|||
--- !u!157 &3 |
|||
LightmapSettings: |
|||
m_ObjectHideFlags: 0 |
|||
serializedVersion: 11 |
|||
m_GIWorkflowMode: 1 |
|||
m_GISettings: |
|||
serializedVersion: 2 |
|||
m_BounceScale: 1 |
|||
m_IndirectOutputScale: 1 |
|||
m_AlbedoBoost: 1 |
|||
m_EnvironmentLightingMode: 0 |
|||
m_EnableBakedLightmaps: 1 |
|||
m_EnableRealtimeLightmaps: 0 |
|||
m_LightmapEditorSettings: |
|||
serializedVersion: 12 |
|||
m_Resolution: 2 |
|||
m_BakeResolution: 40 |
|||
m_AtlasSize: 1024 |
|||
m_AO: 0 |
|||
m_AOMaxDistance: 1 |
|||
m_CompAOExponent: 1 |
|||
m_CompAOExponentDirect: 0 |
|||
m_ExtractAmbientOcclusion: 0 |
|||
m_Padding: 2 |
|||
m_LightmapParameters: {fileID: 0} |
|||
m_LightmapsBakeMode: 1 |
|||
m_TextureCompression: 1 |
|||
m_FinalGather: 0 |
|||
m_FinalGatherFiltering: 1 |
|||
m_FinalGatherRayCount: 256 |
|||
m_ReflectionCompression: 2 |
|||
m_MixedBakeMode: 2 |
|||
m_BakeBackend: 1 |
|||
m_PVRSampling: 1 |
|||
m_PVRDirectSampleCount: 32 |
|||
m_PVRSampleCount: 512 |
|||
m_PVRBounces: 2 |
|||
m_PVREnvironmentSampleCount: 256 |
|||
m_PVREnvironmentReferencePointCount: 2048 |
|||
m_PVRFilteringMode: 1 |
|||
m_PVRDenoiserTypeDirect: 1 |
|||
m_PVRDenoiserTypeIndirect: 1 |
|||
m_PVRDenoiserTypeAO: 1 |
|||
m_PVRFilterTypeDirect: 0 |
|||
m_PVRFilterTypeIndirect: 0 |
|||
m_PVRFilterTypeAO: 0 |
|||
m_PVREnvironmentMIS: 1 |
|||
m_PVRCulling: 1 |
|||
m_PVRFilteringGaussRadiusDirect: 1 |
|||
m_PVRFilteringGaussRadiusIndirect: 5 |
|||
m_PVRFilteringGaussRadiusAO: 2 |
|||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5 |
|||
m_PVRFilteringAtrousPositionSigmaIndirect: 2 |
|||
m_PVRFilteringAtrousPositionSigmaAO: 1 |
|||
m_ExportTrainingData: 0 |
|||
m_TrainingDataDestination: TrainingData |
|||
m_LightProbeSampleCountMultiplier: 4 |
|||
m_LightingDataAsset: {fileID: 0} |
|||
m_UseShadowmask: 1 |
|||
--- !u!196 &4 |
|||
NavMeshSettings: |
|||
serializedVersion: 2 |
|||
m_ObjectHideFlags: 0 |
|||
m_BuildSettings: |
|||
serializedVersion: 2 |
|||
agentTypeID: 0 |
|||
agentRadius: 0.5 |
|||
agentHeight: 2 |
|||
agentSlope: 45 |
|||
agentClimb: 0.4 |
|||
ledgeDropHeight: 0 |
|||
maxJumpAcrossDistance: 0 |
|||
minRegionArea: 2 |
|||
manualCellSize: 0 |
|||
cellSize: 0.16666667 |
|||
manualTileSize: 0 |
|||
tileSize: 256 |
|||
accuratePlacement: 0 |
|||
debug: |
|||
m_Flags: 0 |
|||
m_NavMeshData: {fileID: 0} |
|||
--- !u!1 &166246262 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 166246265} |
|||
- component: {fileID: 166246264} |
|||
- component: {fileID: 166246263} |
|||
m_Layer: 0 |
|||
m_Name: EventSystem |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!114 &166246263 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 166246262} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_HorizontalAxis: Horizontal |
|||
m_VerticalAxis: Vertical |
|||
m_SubmitButton: Submit |
|||
m_CancelButton: Cancel |
|||
m_InputActionsPerSecond: 10 |
|||
m_RepeatDelay: 0.5 |
|||
m_ForceModuleActive: 0 |
|||
--- !u!114 &166246264 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 166246262} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_FirstSelected: {fileID: 0} |
|||
m_sendNavigationEvents: 1 |
|||
m_DragThreshold: 10 |
|||
--- !u!4 &166246265 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 166246262} |
|||
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: 3 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!1 &1173156216 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1173156217} |
|||
- component: {fileID: 1173156219} |
|||
- component: {fileID: 1173156218} |
|||
m_Layer: 5 |
|||
m_Name: RawImage |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &1173156217 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1173156216} |
|||
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: 1656596898} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0.5, y: 0.5} |
|||
m_AnchorMax: {x: 0.5, y: 0.5} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 626.3, y: 431.9} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!114 &1173156218 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1173156216} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 4c6d96aaa15e54a47a53543e4c7ab81b, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_Material: {fileID: 0} |
|||
m_Color: {r: 1, g: 1, b: 1, a: 1} |
|||
m_RaycastTarget: 1 |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Texture: {fileID: 0} |
|||
m_UVRect: |
|||
serializedVersion: 2 |
|||
x: 0 |
|||
y: 0 |
|||
width: 1 |
|||
height: 1 |
|||
devicePixelRatioOverride: 0 |
|||
hardwareAntiAliasing: 0 |
|||
--- !u!222 &1173156219 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1173156216} |
|||
m_CullTransparentMesh: 0 |
|||
--- !u!1 &1514114434 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1514114436} |
|||
- component: {fileID: 1514114435} |
|||
m_Layer: 0 |
|||
m_Name: Directional Light |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!108 &1514114435 |
|||
Light: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1514114434} |
|||
m_Enabled: 1 |
|||
serializedVersion: 10 |
|||
m_Type: 1 |
|||
m_Shape: 0 |
|||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} |
|||
m_Intensity: 1 |
|||
m_Range: 10 |
|||
m_SpotAngle: 30 |
|||
m_InnerSpotAngle: 21.80208 |
|||
m_CookieSize: 10 |
|||
m_Shadows: |
|||
m_Type: 2 |
|||
m_Resolution: -1 |
|||
m_CustomResolution: -1 |
|||
m_Strength: 1 |
|||
m_Bias: 0.05 |
|||
m_NormalBias: 0.4 |
|||
m_NearPlane: 0.2 |
|||
m_CullingMatrixOverride: |
|||
e00: 1 |
|||
e01: 0 |
|||
e02: 0 |
|||
e03: 0 |
|||
e10: 0 |
|||
e11: 1 |
|||
e12: 0 |
|||
e13: 0 |
|||
e20: 0 |
|||
e21: 0 |
|||
e22: 1 |
|||
e23: 0 |
|||
e30: 0 |
|||
e31: 0 |
|||
e32: 0 |
|||
e33: 1 |
|||
m_UseCullingMatrixOverride: 0 |
|||
m_Cookie: {fileID: 0} |
|||
m_DrawHalo: 0 |
|||
m_Flare: {fileID: 0} |
|||
m_RenderMode: 0 |
|||
m_CullingMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
m_RenderingLayerMask: 1 |
|||
m_Lightmapping: 4 |
|||
m_LightShadowCasterMode: 0 |
|||
m_AreaSize: {x: 1, y: 1} |
|||
m_BounceIntensity: 1 |
|||
m_ColorTemperature: 6570 |
|||
m_UseColorTemperature: 0 |
|||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} |
|||
m_UseBoundingSphereOverride: 0 |
|||
m_ShadowRadius: 0 |
|||
m_ShadowAngle: 0 |
|||
--- !u!4 &1514114436 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1514114434} |
|||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} |
|||
m_LocalPosition: {x: 0, y: 3, z: 0} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} |
|||
--- !u!1 &1656596894 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1656596898} |
|||
- component: {fileID: 1656596897} |
|||
- component: {fileID: 1656596896} |
|||
- component: {fileID: 1656596895} |
|||
m_Layer: 5 |
|||
m_Name: Canvas |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!114 &1656596895 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1656596894} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_IgnoreReversedGraphics: 1 |
|||
m_BlockingObjects: 0 |
|||
m_BlockingMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
--- !u!114 &1656596896 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1656596894} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_UiScaleMode: 0 |
|||
m_ReferencePixelsPerUnit: 100 |
|||
m_ScaleFactor: 1 |
|||
m_ReferenceResolution: {x: 800, y: 600} |
|||
m_ScreenMatchMode: 0 |
|||
m_MatchWidthOrHeight: 0 |
|||
m_PhysicalUnit: 3 |
|||
m_FallbackScreenDPI: 96 |
|||
m_DefaultSpriteDPI: 96 |
|||
m_DynamicPixelsPerUnit: 1 |
|||
--- !u!223 &1656596897 |
|||
Canvas: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1656596894} |
|||
m_Enabled: 1 |
|||
serializedVersion: 3 |
|||
m_RenderMode: 0 |
|||
m_Camera: {fileID: 0} |
|||
m_PlaneDistance: 100 |
|||
m_PixelPerfect: 0 |
|||
m_ReceivesEvents: 1 |
|||
m_OverrideSorting: 0 |
|||
m_OverridePixelPerfect: 0 |
|||
m_SortingBucketNormalizedSize: 0 |
|||
m_AdditionalShaderChannelsFlag: 0 |
|||
m_SortingLayerID: 0 |
|||
m_SortingOrder: 0 |
|||
m_TargetDisplay: 0 |
|||
--- !u!224 &1656596898 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1656596894} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: 0} |
|||
m_LocalScale: {x: 0, y: 0, z: 0} |
|||
m_Children: |
|||
- {fileID: 1173156217} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 2 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 0, y: 0} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 0, y: 0} |
|||
m_Pivot: {x: 0, y: 0} |
|||
--- !u!1 &1824294904 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1824294907} |
|||
- component: {fileID: 1824294906} |
|||
- component: {fileID: 1824294905} |
|||
m_Layer: 0 |
|||
m_Name: Main Camera |
|||
m_TagString: MainCamera |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!81 &1824294905 |
|||
AudioListener: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1824294904} |
|||
m_Enabled: 1 |
|||
--- !u!20 &1824294906 |
|||
Camera: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1824294904} |
|||
m_Enabled: 1 |
|||
serializedVersion: 2 |
|||
m_ClearFlags: 1 |
|||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} |
|||
m_projectionMatrixMode: 1 |
|||
m_GateFitMode: 2 |
|||
m_FOVAxisMode: 0 |
|||
m_SensorSize: {x: 36, y: 24} |
|||
m_LensShift: {x: 0, y: 0} |
|||
m_FocalLength: 50 |
|||
m_NormalizedViewPortRect: |
|||
serializedVersion: 2 |
|||
x: 0 |
|||
y: 0 |
|||
width: 1 |
|||
height: 1 |
|||
near clip plane: 0.3 |
|||
far clip plane: 1000 |
|||
field of view: 60 |
|||
orthographic: 0 |
|||
orthographic size: 5 |
|||
m_Depth: -1 |
|||
m_CullingMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
m_RenderingPath: -1 |
|||
m_TargetTexture: {fileID: 0} |
|||
m_TargetDisplay: 0 |
|||
m_TargetEye: 3 |
|||
m_HDR: 1 |
|||
m_AllowMSAA: 1 |
|||
m_AllowDynamicResolution: 0 |
|||
m_ForceIntoRT: 0 |
|||
m_OcclusionCulling: 1 |
|||
m_StereoConvergence: 10 |
|||
m_StereoSeparation: 0.022 |
|||
--- !u!4 &1824294907 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1824294904} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 1, z: -10} |
|||
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} |
|
|||
fileFormatVersion: 2 |
|||
guid: 16f587e6d84ea4240b2a20ef51388ade |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.painting; |
|||
using UnityEngine; |
|||
|
|||
namespace Unity.UIWidgets.ui { |
|||
public class Matrix4 : IEquatable<Matrix4> { |
|||
internal readonly float[] _m4storage; |
|||
|
|||
int dimension { |
|||
get { return 4; } |
|||
} |
|||
|
|||
public Matrix4() { |
|||
this._m4storage = new float[16]; |
|||
} |
|||
|
|||
public Matrix4(Matrix4 other) { |
|||
this._m4storage = new float[16]; |
|||
this.setFrom(other); |
|||
} |
|||
|
|||
public static Matrix4 tryInvert(Matrix4 other) { |
|||
Matrix4 r = new Matrix4(); |
|||
float determinant = r.copyInverse(other); |
|||
if (determinant == 0) { |
|||
return null; |
|||
} |
|||
|
|||
return r; |
|||
} |
|||
|
|||
public Matrix4( |
|||
float arg0, |
|||
float arg1, |
|||
float arg2, |
|||
float arg3, |
|||
float arg4, |
|||
float arg5, |
|||
float arg6, |
|||
float arg7, |
|||
float arg8, |
|||
float arg9, |
|||
float arg10, |
|||
float arg11, |
|||
float arg12, |
|||
float arg13, |
|||
float arg14, |
|||
float arg15) { |
|||
this._m4storage = new float[16]; |
|||
this.setValues(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, |
|||
arg10, arg11, arg12, arg13, arg14, arg15); |
|||
} |
|||
|
|||
public Matrix4 fromList( |
|||
float arg0, |
|||
float arg1, |
|||
float arg2, |
|||
float arg3, |
|||
float arg4, |
|||
float arg5, |
|||
float arg6, |
|||
float arg7, |
|||
float arg8, |
|||
float arg9, |
|||
float arg10, |
|||
float arg11, |
|||
float arg12, |
|||
float arg13, |
|||
float arg14, |
|||
float arg15) { |
|||
this.setValues(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, |
|||
arg10, arg11, arg12, arg13, arg14, arg15); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 identity() { |
|||
this.setIdentity(); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 inverted(Matrix4 other) { |
|||
double determinant = this.copyInverse(other); |
|||
if (determinant == 0) { |
|||
// throw new Exception("input matrix cannot be inverted");
|
|||
return null; |
|||
} |
|||
|
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 copy(Matrix4 other) { |
|||
this.setFrom(other); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 compose(Vector3 translation, Quaternion rotation, Vector3 scale) { |
|||
this.setFromTranslationRotationScale(translation, rotation, scale); |
|||
return this; |
|||
} |
|||
|
|||
public void setColumn(int column, Vector4 arg) { |
|||
int entry = column * 4; |
|||
this._m4storage[entry + 3] = arg[3]; |
|||
this._m4storage[entry + 2] = arg[2]; |
|||
this._m4storage[entry + 1] = arg[1]; |
|||
this._m4storage[entry + 0] = arg[0]; |
|||
} |
|||
|
|||
public Vector4 getColumn(int column) { |
|||
Vector4 r = new Vector4(); |
|||
int entry = column * 4; |
|||
r[3] = this._m4storage[entry + 3]; |
|||
r[2] = this._m4storage[entry + 2]; |
|||
r[1] = this._m4storage[entry + 1]; |
|||
r[0] = this._m4storage[entry + 0]; |
|||
return r; |
|||
} |
|||
|
|||
public void setRow(int row, Vector4 arg) { |
|||
this._m4storage[this.index(row, 0)] = arg[0]; |
|||
this._m4storage[this.index(row, 1)] = arg[1]; |
|||
this._m4storage[this.index(row, 2)] = arg[2]; |
|||
this._m4storage[this.index(row, 3)] = arg[3]; |
|||
} |
|||
|
|||
public Vector4 getRow(int row) { |
|||
Vector4 r = new Vector4(); |
|||
r[0] = this._m4storage[this.index(row, 0)]; |
|||
r[1] = this._m4storage[this.index(row, 1)]; |
|||
r[2] = this._m4storage[this.index(row, 2)]; |
|||
r[3] = this._m4storage[this.index(row, 3)]; |
|||
return r; |
|||
} |
|||
|
|||
public Matrix4 clone() => new Matrix4().copy(this); |
|||
|
|||
public static Matrix4 operator *(Matrix4 a, Matrix4 b) { |
|||
var result = a.clone(); |
|||
result.multiply(b); |
|||
return result; |
|||
} |
|||
|
|||
void setFromTranslationRotationScale( |
|||
Vector3 translation, Quaternion rotation, Vector3 scale) { |
|||
this.setFromTranslationRotation(translation, rotation); |
|||
this.scale(scale); |
|||
} |
|||
|
|||
void setFromTranslationRotation(Vector3 arg0, Quaternion arg1) { |
|||
float x = arg1[0]; |
|||
float y = arg1[1]; |
|||
float z = arg1[2]; |
|||
float w = arg1[3]; |
|||
float x2 = x + x; |
|||
float y2 = y + y; |
|||
float z2 = z + z; |
|||
float xx = x * x2; |
|||
float xy = x * y2; |
|||
float xz = x * z2; |
|||
float yy = y * y2; |
|||
float yz = y * z2; |
|||
float zz = z * z2; |
|||
float wx = w * x2; |
|||
float wy = w * y2; |
|||
float wz = w * z2; |
|||
|
|||
this._m4storage[0] = 1.0f - (yy + zz); |
|||
this._m4storage[1] = xy + wz; |
|||
this._m4storage[2] = xz - wy; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[4] = xy - wz; |
|||
this._m4storage[5] = 1.0f - (xx + zz); |
|||
this._m4storage[6] = yz + wx; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[8] = xz + wy; |
|||
this._m4storage[9] = yz - wx; |
|||
this._m4storage[10] = 1.0f - (xx + yy); |
|||
this._m4storage[11] = 0; |
|||
this._m4storage[12] = arg0[0]; |
|||
this._m4storage[13] = arg0[1]; |
|||
this._m4storage[14] = arg0[2]; |
|||
this._m4storage[15] = 1.0f; |
|||
} |
|||
|
|||
void setFrom(Matrix4 arg) { |
|||
this._m4storage[15] = arg[15]; |
|||
this._m4storage[14] = arg[14]; |
|||
this._m4storage[13] = arg[13]; |
|||
this._m4storage[12] = arg[12]; |
|||
this._m4storage[11] = arg[11]; |
|||
this._m4storage[10] = arg[10]; |
|||
this._m4storage[9] = arg[9]; |
|||
this._m4storage[8] = arg[8]; |
|||
this._m4storage[7] = arg[7]; |
|||
this._m4storage[6] = arg[6]; |
|||
this._m4storage[5] = arg[5]; |
|||
this._m4storage[4] = arg[4]; |
|||
this._m4storage[3] = arg[3]; |
|||
this._m4storage[2] = arg[2]; |
|||
this._m4storage[1] = arg[1]; |
|||
this._m4storage[0] = arg[0]; |
|||
} |
|||
|
|||
void setValues( |
|||
float arg0, |
|||
float arg1, |
|||
float arg2, |
|||
float arg3, |
|||
float arg4, |
|||
float arg5, |
|||
float arg6, |
|||
float arg7, |
|||
float arg8, |
|||
float arg9, |
|||
float arg10, |
|||
float arg11, |
|||
float arg12, |
|||
float arg13, |
|||
float arg14, |
|||
float arg15) { |
|||
this._m4storage[15] = arg15; |
|||
this._m4storage[14] = arg14; |
|||
this._m4storage[13] = arg13; |
|||
this._m4storage[12] = arg12; |
|||
this._m4storage[11] = arg11; |
|||
this._m4storage[10] = arg10; |
|||
this._m4storage[9] = arg9; |
|||
this._m4storage[8] = arg8; |
|||
this._m4storage[7] = arg7; |
|||
this._m4storage[6] = arg6; |
|||
this._m4storage[5] = arg5; |
|||
this._m4storage[4] = arg4; |
|||
this._m4storage[3] = arg3; |
|||
this._m4storage[2] = arg2; |
|||
this._m4storage[1] = arg1; |
|||
this._m4storage[0] = arg0; |
|||
} |
|||
|
|||
public void setZero() { |
|||
this._m4storage[0] = 0; |
|||
this._m4storage[1] = 0; |
|||
this._m4storage[2] = 0; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[4] = 0; |
|||
this._m4storage[5] = 0; |
|||
this._m4storage[6] = 0; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[8] = 0; |
|||
this._m4storage[9] = 0; |
|||
this._m4storage[10] = 0; |
|||
this._m4storage[11] = 0; |
|||
this._m4storage[12] = 0; |
|||
this._m4storage[13] = 0; |
|||
this._m4storage[14] = 0; |
|||
this._m4storage[15] = 0; |
|||
} |
|||
|
|||
void setIdentity() { |
|||
this._m4storage[0] = 1; |
|||
this._m4storage[1] = 0; |
|||
this._m4storage[2] = 0; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[4] = 0; |
|||
this._m4storage[5] = 1; |
|||
this._m4storage[6] = 0; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[8] = 0; |
|||
this._m4storage[9] = 0; |
|||
this._m4storage[10] = 1; |
|||
this._m4storage[11] = 0; |
|||
this._m4storage[12] = 0; |
|||
this._m4storage[13] = 0; |
|||
this._m4storage[14] = 0; |
|||
this._m4storage[15] = 1; |
|||
} |
|||
|
|||
Matrix4 absolute() { |
|||
Matrix4 r = new Matrix4(); |
|||
this[0] = this._m4storage[0].abs(); |
|||
this[1] = this._m4storage[1].abs(); |
|||
this[2] = this._m4storage[2].abs(); |
|||
this[3] = this._m4storage[3].abs(); |
|||
this[4] = this._m4storage[4].abs(); |
|||
this[5] = this._m4storage[5].abs(); |
|||
this[6] = this._m4storage[6].abs(); |
|||
this[7] = this._m4storage[7].abs(); |
|||
this[8] = this._m4storage[8].abs(); |
|||
this[9] = this._m4storage[9].abs(); |
|||
this[10] = this._m4storage[10].abs(); |
|||
this[11] = this._m4storage[11].abs(); |
|||
this[12] = this._m4storage[12].abs(); |
|||
this[13] = this._m4storage[13].abs(); |
|||
this[14] = this._m4storage[14].abs(); |
|||
this[15] = this._m4storage[15].abs(); |
|||
return r; |
|||
} |
|||
|
|||
public float determinant() { |
|||
float det2_01_01 = |
|||
this._m4storage[0] * this._m4storage[5] - this._m4storage[1] * this._m4storage[4]; |
|||
float det2_01_02 = |
|||
this._m4storage[0] * this._m4storage[6] - this._m4storage[2] * this._m4storage[4]; |
|||
float det2_01_03 = |
|||
this._m4storage[0] * this._m4storage[7] - this._m4storage[3] * this._m4storage[4]; |
|||
float det2_01_12 = |
|||
this._m4storage[1] * this._m4storage[6] - this._m4storage[2] * this._m4storage[5]; |
|||
float det2_01_13 = |
|||
this._m4storage[1] * this._m4storage[7] - this._m4storage[3] * this._m4storage[5]; |
|||
float det2_01_23 = |
|||
this._m4storage[2] * this._m4storage[7] - this._m4storage[3] * this._m4storage[6]; |
|||
float det3_201_012 = this._m4storage[8] * det2_01_12 - |
|||
this._m4storage[9] * det2_01_02 + |
|||
this._m4storage[10] * det2_01_01; |
|||
float det3_201_013 = this._m4storage[8] * det2_01_13 - |
|||
this._m4storage[9] * det2_01_03 + |
|||
this._m4storage[11] * det2_01_01; |
|||
float det3_201_023 = this._m4storage[8] * det2_01_23 - |
|||
this._m4storage[10] * det2_01_03 + |
|||
this._m4storage[11] * det2_01_02; |
|||
float det3_201_123 = this._m4storage[9] * det2_01_23 - |
|||
this._m4storage[10] * det2_01_13 + |
|||
this._m4storage[11] * det2_01_12; |
|||
return -det3_201_123 * this._m4storage[12] + |
|||
det3_201_023 * this._m4storage[13] - |
|||
det3_201_013 * this._m4storage[14] + |
|||
det3_201_012 * this._m4storage[15]; |
|||
} |
|||
|
|||
float invertRotation() { |
|||
float det = this.determinant(); |
|||
if (det == 0) { |
|||
return 0; |
|||
} |
|||
|
|||
float invDet = 1.0f / det; |
|||
float ix; |
|||
float iy; |
|||
float iz; |
|||
float jx; |
|||
float jy; |
|||
float jz; |
|||
float kx; |
|||
float ky; |
|||
float kz; |
|||
ix = invDet * |
|||
(this._m4storage[5] * this._m4storage[10] - this._m4storage[6] * this._m4storage[9]); |
|||
iy = invDet * |
|||
(this._m4storage[2] * this._m4storage[9] - this._m4storage[1] * this._m4storage[10]); |
|||
iz = invDet * |
|||
(this._m4storage[1] * this._m4storage[6] - this._m4storage[2] * this._m4storage[5]); |
|||
jx = invDet * |
|||
(this._m4storage[6] * this._m4storage[8] - this._m4storage[4] * this._m4storage[10]); |
|||
jy = invDet * |
|||
(this._m4storage[0] * this._m4storage[10] - this._m4storage[2] * this._m4storage[8]); |
|||
jz = invDet * |
|||
(this._m4storage[2] * this._m4storage[4] - this._m4storage[0] * this._m4storage[6]); |
|||
kx = invDet * |
|||
(this._m4storage[4] * this._m4storage[9] - this._m4storage[5] * this._m4storage[8]); |
|||
ky = invDet * |
|||
(this._m4storage[1] * this._m4storage[8] - this._m4storage[0] * this._m4storage[9]); |
|||
kz = invDet * |
|||
(this._m4storage[0] * this._m4storage[5] - this._m4storage[1] * this._m4storage[4]); |
|||
this._m4storage[0] = ix; |
|||
this._m4storage[1] = iy; |
|||
this._m4storage[2] = iz; |
|||
this._m4storage[4] = jx; |
|||
this._m4storage[5] = jy; |
|||
this._m4storage[6] = jz; |
|||
this._m4storage[8] = kx; |
|||
this._m4storage[9] = ky; |
|||
this._m4storage[10] = kz; |
|||
return det; |
|||
} |
|||
|
|||
public Vector4 transform(Vector4 arg) { |
|||
float x_ = (this._m4storage[0] * arg[0]) + |
|||
(this._m4storage[4] * arg[1]) + |
|||
(this._m4storage[8] * arg[2]) + |
|||
(this._m4storage[12] * arg[3]); |
|||
float y_ = (this._m4storage[1] * arg[0]) + |
|||
(this._m4storage[5] * arg[1]) + |
|||
(this._m4storage[9] * arg[2]) + |
|||
(this._m4storage[13] * arg[3]); |
|||
float z_ = (this._m4storage[2] * arg[0]) + |
|||
(this._m4storage[6] * arg[1]) + |
|||
(this._m4storage[10] * arg[2]) + |
|||
(this._m4storage[14] * arg[3]); |
|||
float w_ = (this._m4storage[3] * arg[0]) + |
|||
(this._m4storage[7] * arg[1]) + |
|||
(this._m4storage[11] * arg[2]) + |
|||
(this._m4storage[15] * arg[3]); |
|||
arg[0] = x_; |
|||
arg[1] = y_; |
|||
arg[2] = z_; |
|||
arg[3] = w_; |
|||
return arg; |
|||
} |
|||
|
|||
public Vector3 perspectiveTransform(Vector3 arg) { |
|||
float x_ = (this._m4storage[0] * arg[0]) + |
|||
(this._m4storage[4] * arg[1]) + |
|||
(this._m4storage[8] * arg[2]) + |
|||
this._m4storage[12]; |
|||
float y_ = (this._m4storage[1] * arg[0]) + |
|||
(this._m4storage[5] * arg[1]) + |
|||
(this._m4storage[9] * arg[2]) + |
|||
this._m4storage[13]; |
|||
float z_ = (this._m4storage[2] * arg[0]) + |
|||
(this._m4storage[6] * arg[1]) + |
|||
(this._m4storage[10] * arg[2]) + |
|||
this._m4storage[14]; |
|||
float w_ = 1.0f / |
|||
((this._m4storage[3] * arg[0]) + |
|||
(this._m4storage[7] * arg[1]) + |
|||
(this._m4storage[11] * arg[2]) + |
|||
this._m4storage[15]); |
|||
arg[0] = x_ * w_; |
|||
arg[1] = y_ * w_; |
|||
arg[2] = z_ * w_; |
|||
return arg; |
|||
} |
|||
|
|||
public void translate(float tx, float ty = 0, float tz = 0, float tw = 1) { |
|||
float t1 = this._m4storage[0] * tx + |
|||
this._m4storage[4] * ty + |
|||
this._m4storage[8] * tz + |
|||
this._m4storage[12] * tw; |
|||
float t2 = this._m4storage[1] * tx + |
|||
this._m4storage[5] * ty + |
|||
this._m4storage[9] * tz + |
|||
this._m4storage[13] * tw; |
|||
float t3 = this._m4storage[2] * tx + |
|||
this._m4storage[6] * ty + |
|||
this._m4storage[10] * tz + |
|||
this._m4storage[14] * tw; |
|||
float t4 = this._m4storage[3] * tx + |
|||
this._m4storage[7] * ty + |
|||
this._m4storage[11] * tz + |
|||
this._m4storage[15] * tw; |
|||
this._m4storage[12] = t1; |
|||
this._m4storage[13] = t2; |
|||
this._m4storage[14] = t3; |
|||
this._m4storage[15] = t4; |
|||
} |
|||
|
|||
public Matrix4 rotationX(float radians) { |
|||
this._m4storage[15] = 1.0f; |
|||
this.setRotationX(radians); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 rotationY(float radians) { |
|||
this._m4storage[15] = 1.0f; |
|||
this.setRotationY(radians); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 rotationZ(float radians) { |
|||
this._m4storage[15] = 1.0f; |
|||
this.setRotationZ(radians); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 rotationZ(float radians, float px, float py) { |
|||
this._m4storage[15] = 1.0f; |
|||
this.setRotationZ(radians, px, py); |
|||
return this; |
|||
} |
|||
|
|||
public Matrix4 diagonal3Values(float x, float y, float z) { |
|||
this._m4storage[15] = 1; |
|||
this._m4storage[10] = z; |
|||
this._m4storage[5] = y; |
|||
this._m4storage[0] = x; |
|||
return this; |
|||
} |
|||
|
|||
public void scale(float sx, float sy, float sz, float sw = 1) { |
|||
this._m4storage[0] *= sx; |
|||
this._m4storage[1] *= sx; |
|||
this._m4storage[2] *= sx; |
|||
this._m4storage[3] *= sx; |
|||
this._m4storage[4] *= sy; |
|||
this._m4storage[5] *= sy; |
|||
this._m4storage[6] *= sy; |
|||
this._m4storage[7] *= sy; |
|||
this._m4storage[8] *= sz; |
|||
this._m4storage[9] *= sz; |
|||
this._m4storage[10] *= sz; |
|||
this._m4storage[11] *= sz; |
|||
this._m4storage[12] *= sw; |
|||
this._m4storage[13] *= sw; |
|||
this._m4storage[14] *= sw; |
|||
this._m4storage[15] *= sw; |
|||
} |
|||
|
|||
public void scale(Vector3 s) { |
|||
float sx = s.x; |
|||
float sy = s.y; |
|||
float sz = s.z; |
|||
float sw = 1; |
|||
this._m4storage[0] *= sx; |
|||
this._m4storage[1] *= sx; |
|||
this._m4storage[2] *= sx; |
|||
this._m4storage[3] *= sx; |
|||
this._m4storage[4] *= sy; |
|||
this._m4storage[5] *= sy; |
|||
this._m4storage[6] *= sy; |
|||
this._m4storage[7] *= sy; |
|||
this._m4storage[8] *= sz; |
|||
this._m4storage[9] *= sz; |
|||
this._m4storage[10] *= sz; |
|||
this._m4storage[11] *= sz; |
|||
this._m4storage[12] *= sw; |
|||
this._m4storage[13] *= sw; |
|||
this._m4storage[14] *= sw; |
|||
this._m4storage[15] *= sw; |
|||
} |
|||
|
|||
Matrix4 scaled(float sx, float sy, float sz, float sw = 1) { |
|||
var result = this.clone(); |
|||
result.scale(sx, sy, sz, sw); |
|||
return result; |
|||
} |
|||
|
|||
public Matrix4 translationValues(float x, float y, float z) { |
|||
this.identity(); |
|||
this.setTranslationRaw(x, y, z); |
|||
return this; |
|||
} |
|||
|
|||
public void rotateX(float angle) { |
|||
float cosAngle = Mathf.Cos(angle); |
|||
float sinAngle = Mathf.Sin(angle); |
|||
float t1 = this._m4storage[4] * cosAngle + this._m4storage[8] * sinAngle; |
|||
float t2 = this._m4storage[5] * cosAngle + this._m4storage[9] * sinAngle; |
|||
float t3 = this._m4storage[6] * cosAngle + this._m4storage[10] * sinAngle; |
|||
float t4 = this._m4storage[7] * cosAngle + this._m4storage[11] * sinAngle; |
|||
float t5 = this._m4storage[4] * -sinAngle + this._m4storage[8] * cosAngle; |
|||
float t6 = this._m4storage[5] * -sinAngle + this._m4storage[9] * cosAngle; |
|||
float t7 = this._m4storage[6] * -sinAngle + this._m4storage[10] * cosAngle; |
|||
float t8 = this._m4storage[7] * -sinAngle + this._m4storage[11] * cosAngle; |
|||
this._m4storage[4] = t1; |
|||
this._m4storage[5] = t2; |
|||
this._m4storage[6] = t3; |
|||
this._m4storage[7] = t4; |
|||
this._m4storage[8] = t5; |
|||
this._m4storage[9] = t6; |
|||
this._m4storage[10] = t7; |
|||
this._m4storage[11] = t8; |
|||
} |
|||
|
|||
public void rotateY(float angle) { |
|||
float cosAngle = Mathf.Cos(angle); |
|||
float sinAngle = Mathf.Sin(angle); |
|||
float t1 = this._m4storage[0] * cosAngle + this._m4storage[8] * -sinAngle; |
|||
float t2 = this._m4storage[1] * cosAngle + this._m4storage[9] * -sinAngle; |
|||
float t3 = this._m4storage[2] * cosAngle + this._m4storage[10] * -sinAngle; |
|||
float t4 = this._m4storage[3] * cosAngle + this._m4storage[11] * -sinAngle; |
|||
float t5 = this._m4storage[0] * sinAngle + this._m4storage[8] * cosAngle; |
|||
float t6 = this._m4storage[1] * sinAngle + this._m4storage[9] * cosAngle; |
|||
float t7 = this._m4storage[2] * sinAngle + this._m4storage[10] * cosAngle; |
|||
float t8 = this._m4storage[3] * sinAngle + this._m4storage[11] * cosAngle; |
|||
this._m4storage[0] = t1; |
|||
this._m4storage[1] = t2; |
|||
this._m4storage[2] = t3; |
|||
this._m4storage[3] = t4; |
|||
this._m4storage[8] = t5; |
|||
this._m4storage[9] = t6; |
|||
this._m4storage[10] = t7; |
|||
this._m4storage[11] = t8; |
|||
} |
|||
|
|||
public void rotateZ(float angle) { |
|||
float cosAngle = Mathf.Cos(angle); |
|||
float sinAngle = Mathf.Sin(angle); |
|||
float t1 = this._m4storage[0] * cosAngle + this._m4storage[4] * sinAngle; |
|||
float t2 = this._m4storage[1] * cosAngle + this._m4storage[5] * sinAngle; |
|||
float t3 = this._m4storage[2] * cosAngle + this._m4storage[6] * sinAngle; |
|||
float t4 = this._m4storage[3] * cosAngle + this._m4storage[7] * sinAngle; |
|||
float t5 = this._m4storage[0] * -sinAngle + this._m4storage[4] * cosAngle; |
|||
float t6 = this._m4storage[1] * -sinAngle + this._m4storage[5] * cosAngle; |
|||
float t7 = this._m4storage[2] * -sinAngle + this._m4storage[6] * cosAngle; |
|||
float t8 = this._m4storage[3] * -sinAngle + this._m4storage[7] * cosAngle; |
|||
this._m4storage[0] = t1; |
|||
this._m4storage[1] = t2; |
|||
this._m4storage[2] = t3; |
|||
this._m4storage[3] = t4; |
|||
this._m4storage[4] = t5; |
|||
this._m4storage[5] = t6; |
|||
this._m4storage[6] = t7; |
|||
this._m4storage[7] = t8; |
|||
} |
|||
|
|||
public void multiply(Matrix4 arg) { |
|||
float m00 = this._m4storage[0]; |
|||
float m01 = this._m4storage[4]; |
|||
float m02 = this._m4storage[8]; |
|||
float m03 = this._m4storage[12]; |
|||
float m10 = this._m4storage[1]; |
|||
float m11 = this._m4storage[5]; |
|||
float m12 = this._m4storage[9]; |
|||
float m13 = this._m4storage[13]; |
|||
float m20 = this._m4storage[2]; |
|||
float m21 = this._m4storage[6]; |
|||
float m22 = this._m4storage[10]; |
|||
float m23 = this._m4storage[14]; |
|||
float m30 = this._m4storage[3]; |
|||
float m31 = this._m4storage[7]; |
|||
float m32 = this._m4storage[11]; |
|||
float m33 = this._m4storage[15]; |
|||
float[] argStorage = arg._m4storage; |
|||
float n00 = argStorage[0]; |
|||
float n01 = argStorage[4]; |
|||
float n02 = argStorage[8]; |
|||
float n03 = argStorage[12]; |
|||
float n10 = argStorage[1]; |
|||
float n11 = argStorage[5]; |
|||
float n12 = argStorage[9]; |
|||
float n13 = argStorage[13]; |
|||
float n20 = argStorage[2]; |
|||
float n21 = argStorage[6]; |
|||
float n22 = argStorage[10]; |
|||
float n23 = argStorage[14]; |
|||
float n30 = argStorage[3]; |
|||
float n31 = argStorage[7]; |
|||
float n32 = argStorage[11]; |
|||
float n33 = argStorage[15]; |
|||
this._m4storage[0] = (m00 * n00) + (m01 * n10) + (m02 * n20) + (m03 * n30); |
|||
this._m4storage[4] = (m00 * n01) + (m01 * n11) + (m02 * n21) + (m03 * n31); |
|||
this._m4storage[8] = (m00 * n02) + (m01 * n12) + (m02 * n22) + (m03 * n32); |
|||
this._m4storage[12] = (m00 * n03) + (m01 * n13) + (m02 * n23) + (m03 * n33); |
|||
this._m4storage[1] = (m10 * n00) + (m11 * n10) + (m12 * n20) + (m13 * n30); |
|||
this._m4storage[5] = (m10 * n01) + (m11 * n11) + (m12 * n21) + (m13 * n31); |
|||
this._m4storage[9] = (m10 * n02) + (m11 * n12) + (m12 * n22) + (m13 * n32); |
|||
this._m4storage[13] = (m10 * n03) + (m11 * n13) + (m12 * n23) + (m13 * n33); |
|||
this._m4storage[2] = (m20 * n00) + (m21 * n10) + (m22 * n20) + (m23 * n30); |
|||
this._m4storage[6] = (m20 * n01) + (m21 * n11) + (m22 * n21) + (m23 * n31); |
|||
this._m4storage[10] = (m20 * n02) + (m21 * n12) + (m22 * n22) + (m23 * n32); |
|||
this._m4storage[14] = (m20 * n03) + (m21 * n13) + (m22 * n23) + (m23 * n33); |
|||
this._m4storage[3] = (m30 * n00) + (m31 * n10) + (m32 * n20) + (m33 * n30); |
|||
this._m4storage[7] = (m30 * n01) + (m31 * n11) + (m32 * n21) + (m33 * n31); |
|||
this._m4storage[11] = (m30 * n02) + (m31 * n12) + (m32 * n22) + (m33 * n32); |
|||
this._m4storage[15] = (m30 * n03) + (m31 * n13) + (m32 * n23) + (m33 * n33); |
|||
} |
|||
|
|||
public void decompose(ref Vector3 translation, ref Quaternion rotation, ref Vector3 scale) { |
|||
Vector3 v = Vector3.zero; |
|||
|
|||
v.Set(this._m4storage[0], this._m4storage[1], this._m4storage[2]); |
|||
float sx = v.sqrMagnitude; |
|||
|
|||
v.Set(this._m4storage[4], this._m4storage[5], this._m4storage[6]); |
|||
float sy = v.sqrMagnitude; |
|||
|
|||
v.Set(this._m4storage[8], this._m4storage[9], this._m4storage[10]); |
|||
float sz = v.sqrMagnitude; |
|||
|
|||
if (this.determinant() < 0) { |
|||
sx = -sx; |
|||
} |
|||
|
|||
translation[0] = this._m4storage[12]; |
|||
translation[1] = this._m4storage[13]; |
|||
translation[2] = this._m4storage[14]; |
|||
|
|||
float invSX = 1.0f / sx; |
|||
float invSY = 1.0f / sy; |
|||
float invSZ = 1.0f / sz; |
|||
|
|||
Matrix4 m = new Matrix4().copy(this); |
|||
m._m4storage[0] *= invSX; |
|||
m._m4storage[1] *= invSX; |
|||
m._m4storage[2] *= invSX; |
|||
m._m4storage[4] *= invSY; |
|||
m._m4storage[5] *= invSY; |
|||
m._m4storage[6] *= invSY; |
|||
m._m4storage[8] *= invSZ; |
|||
m._m4storage[9] *= invSZ; |
|||
m._m4storage[10] *= invSZ; |
|||
|
|||
m.QuaternionFromMatrix(ref rotation); |
|||
|
|||
scale[0] = sx; |
|||
scale[1] = sy; |
|||
scale[2] = sz; |
|||
} |
|||
|
|||
void setTranslationRaw(float x, float y, float z) { |
|||
this._m4storage[14] = z; |
|||
this._m4storage[13] = y; |
|||
this._m4storage[12] = x; |
|||
} |
|||
|
|||
void setRotationX(float radians) { |
|||
float c = Mathf.Cos(radians); |
|||
float s = Mathf.Sin(radians); |
|||
this._m4storage[0] = 1.0f; |
|||
this._m4storage[1] = 0; |
|||
this._m4storage[2] = 0; |
|||
this._m4storage[4] = 0; |
|||
this._m4storage[5] = c; |
|||
this._m4storage[6] = s; |
|||
this._m4storage[8] = 0; |
|||
this._m4storage[9] = -s; |
|||
this._m4storage[10] = c; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[11] = 0; |
|||
} |
|||
|
|||
void setRotationY(float radians) { |
|||
float c = Mathf.Cos(radians); |
|||
float s = Mathf.Sin(radians); |
|||
this._m4storage[0] = c; |
|||
this._m4storage[1] = 0; |
|||
this._m4storage[2] = -s; |
|||
this._m4storage[4] = 0; |
|||
this._m4storage[5] = 1.0f; |
|||
this._m4storage[6] = 0; |
|||
this._m4storage[8] = s; |
|||
this._m4storage[9] = 0; |
|||
this._m4storage[10] = c; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[11] = 0; |
|||
} |
|||
|
|||
void setRotationZ(float radians) { |
|||
float c = Mathf.Cos(radians); |
|||
float s = Mathf.Sin(radians); |
|||
this._m4storage[0] = c; |
|||
this._m4storage[1] = s; |
|||
this._m4storage[2] = 0; |
|||
this._m4storage[4] = -s; |
|||
this._m4storage[5] = c; |
|||
this._m4storage[6] = 0; |
|||
this._m4storage[8] = 0; |
|||
this._m4storage[9] = 0; |
|||
this._m4storage[10] = 1.0f; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[11] = 0; |
|||
} |
|||
|
|||
void setRotationZ(float radians, float px, float py) { |
|||
float c = Mathf.Cos(radians); |
|||
float s = Mathf.Sin(radians); |
|||
this._m4storage[0] = c; |
|||
this._m4storage[1] = s; |
|||
this._m4storage[2] = 0; |
|||
this._m4storage[4] = -s; |
|||
this._m4storage[5] = c; |
|||
this._m4storage[6] = 0; |
|||
this._m4storage[8] = 0; |
|||
this._m4storage[9] = 0; |
|||
this._m4storage[10] = 1.0f; |
|||
this._m4storage[3] = 0; |
|||
this._m4storage[7] = 0; |
|||
this._m4storage[11] = 0; |
|||
this._m4storage[12] = s * py + (1 - c) * px; |
|||
this._m4storage[13] = -s * px + (1 - c) * py; |
|||
} |
|||
|
|||
public float invert() => this.copyInverse(this); |
|||
|
|||
float copyInverse(Matrix4 arg) { |
|||
float a00 = arg[0]; |
|||
float a01 = arg[1]; |
|||
float a02 = arg[2]; |
|||
float a03 = arg[3]; |
|||
float a10 = arg[4]; |
|||
float a11 = arg[5]; |
|||
float a12 = arg[6]; |
|||
float a13 = arg[7]; |
|||
float a20 = arg[8]; |
|||
float a21 = arg[9]; |
|||
float a22 = arg[10]; |
|||
float a23 = arg[11]; |
|||
float a30 = arg[12]; |
|||
float a31 = arg[13]; |
|||
float a32 = arg[14]; |
|||
float a33 = arg[15]; |
|||
float b00 = a00 * a11 - a01 * a10; |
|||
float b01 = a00 * a12 - a02 * a10; |
|||
float b02 = a00 * a13 - a03 * a10; |
|||
float b03 = a01 * a12 - a02 * a11; |
|||
float b04 = a01 * a13 - a03 * a11; |
|||
float b05 = a02 * a13 - a03 * a12; |
|||
float b06 = a20 * a31 - a21 * a30; |
|||
float b07 = a20 * a32 - a22 * a30; |
|||
float b08 = a20 * a33 - a23 * a30; |
|||
float b09 = a21 * a32 - a22 * a31; |
|||
float b10 = a21 * a33 - a23 * a31; |
|||
float b11 = a22 * a33 - a23 * a32; |
|||
float det = |
|||
(b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06); |
|||
if (det == 0) { |
|||
this.setFrom(arg); |
|||
return 0; |
|||
} |
|||
|
|||
float invDet = 1.0f / det; |
|||
this._m4storage[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet; |
|||
this._m4storage[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet; |
|||
this._m4storage[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet; |
|||
this._m4storage[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet; |
|||
this._m4storage[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet; |
|||
this._m4storage[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet; |
|||
this._m4storage[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet; |
|||
this._m4storage[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet; |
|||
this._m4storage[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet; |
|||
this._m4storage[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet; |
|||
this._m4storage[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet; |
|||
this._m4storage[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet; |
|||
this._m4storage[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet; |
|||
this._m4storage[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet; |
|||
this._m4storage[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet; |
|||
this._m4storage[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet; |
|||
return det; |
|||
} |
|||
|
|||
public int index(int row, int col) => (col * 4) + row; |
|||
|
|||
public float entry(int row, int col) { |
|||
D.assert((row >= 0) && (row < this.dimension)); |
|||
D.assert((col >= 0) && (col < this.dimension)); |
|||
|
|||
return this._m4storage[this.index(row, col)]; |
|||
} |
|||
|
|||
public float this[int index] { |
|||
get { |
|||
D.assert((uint) index < 16); |
|||
return this._m4storage[index]; |
|||
} |
|||
|
|||
set { |
|||
D.assert((uint) index < 16); |
|||
this._m4storage[index] = value; |
|||
} |
|||
} |
|||
|
|||
public bool Equals(Matrix4 other) { |
|||
if (ReferenceEquals(null, other)) { |
|||
return false; |
|||
} |
|||
|
|||
if (ReferenceEquals(this, other)) { |
|||
return true; |
|||
} |
|||
|
|||
return (this._m4storage[0] == other._m4storage[0]) && |
|||
(this._m4storage[1] == other._m4storage[1]) && |
|||
(this._m4storage[2] == other._m4storage[2]) && |
|||
(this._m4storage[3] == other._m4storage[3]) && |
|||
(this._m4storage[4] == other._m4storage[4]) && |
|||
(this._m4storage[5] == other._m4storage[5]) && |
|||
(this._m4storage[6] == other._m4storage[6]) && |
|||
(this._m4storage[7] == other._m4storage[7]) && |
|||
(this._m4storage[8] == other._m4storage[8]) && |
|||
(this._m4storage[9] == other._m4storage[9]) && |
|||
(this._m4storage[10] == other._m4storage[10]) && |
|||
(this._m4storage[11] == other._m4storage[11]) && |
|||
(this._m4storage[12] == other._m4storage[12]) && |
|||
(this._m4storage[13] == other._m4storage[13]) && |
|||
(this._m4storage[14] == other._m4storage[14]) && |
|||
(this._m4storage[15] == other._m4storage[15]); |
|||
} |
|||
|
|||
public override bool Equals(object obj) { |
|||
if (ReferenceEquals(null, obj)) { |
|||
return false; |
|||
} |
|||
|
|||
if (ReferenceEquals(this, obj)) { |
|||
return true; |
|||
} |
|||
|
|||
if (obj.GetType() != this.GetType()) { |
|||
return false; |
|||
} |
|||
|
|||
return this.Equals((Matrix4) obj); |
|||
} |
|||
|
|||
public override int GetHashCode() { |
|||
return (this._m4storage != null ? this._m4storage.GetHashCode() : 0); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9b1bb0f304684e3faa19f8d70942198d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue