weapon sway
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -56,6 +56,7 @@
|
|||||||
"ParentID": "51c770f24232abbb112cc98b296820d8",
|
"ParentID": "51c770f24232abbb112cc98b296820d8",
|
||||||
"Name": "Camera",
|
"Name": "Camera",
|
||||||
"StaticFlags": 0,
|
"StaticFlags": 0,
|
||||||
|
"FOV": 65.0,
|
||||||
"Near": 1.0,
|
"Near": 1.0,
|
||||||
"RenderLayersMask": 4294967291
|
"RenderLayersMask": 4294967291
|
||||||
},
|
},
|
||||||
@@ -68,112 +69,24 @@
|
|||||||
"material": "c3ddff6e40ca5db834b2629771038d21"
|
"material": "c3ddff6e40ca5db834b2629771038d21"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ID": "1cf14d02487b7bd9f5c85b9ab437bfc7",
|
|
||||||
"TypeName": "FlaxEngine.AudioListener",
|
|
||||||
"ParentID": "eb46ab96465957dc67a052bd0e2ad1e5",
|
|
||||||
"Name": "AudioListener",
|
|
||||||
"StaticFlags": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ID": "0e2e8a4f4623887ca2be699fe858beb2",
|
"ID": "0e2e8a4f4623887ca2be699fe858beb2",
|
||||||
"TypeName": "FlaxEngine.Camera",
|
"TypeName": "FlaxEngine.Camera",
|
||||||
"ParentID": "51c770f24232abbb112cc98b296820d8",
|
"ParentID": "51c770f24232abbb112cc98b296820d8",
|
||||||
"Name": "Camera2",
|
"Name": "ViewModelCamera",
|
||||||
"StaticFlags": 0,
|
"StaticFlags": 0,
|
||||||
"Layer": 2,
|
"Layer": 2,
|
||||||
|
"FOV": 65.0,
|
||||||
"Near": 1.0,
|
"Near": 1.0,
|
||||||
"Far": 505.0,
|
"Far": 505.0,
|
||||||
"RenderLayersMask": 4294967294
|
"RenderLayersMask": 4294967294
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ID": "b458fab04186b0cae4563ba49ac6a3f9",
|
"ID": "262c688d49caaf66eb7e6a97f0d01206",
|
||||||
"TypeName": "FlaxEngine.EmptyActor",
|
"TypeName": "FlaxEngine.AudioListener",
|
||||||
"ParentID": "51c770f24232abbb112cc98b296820d8",
|
"ParentID": "51c770f24232abbb112cc98b296820d8",
|
||||||
"Name": "WeaponHolder",
|
"Name": "AudioListener",
|
||||||
"Transform": {
|
"StaticFlags": 0
|
||||||
"Orientation": {
|
|
||||||
"X": 0.0,
|
|
||||||
"Y": -1.0,
|
|
||||||
"Z": 0.0,
|
|
||||||
"W": -4.371138828673793e-8
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Layer": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ID": "293ff021499bbcb5c4b263894f5d327b",
|
|
||||||
"TypeName": "FlaxEngine.StaticModel",
|
|
||||||
"ParentID": "b458fab04186b0cae4563ba49ac6a3f9",
|
|
||||||
"Name": "DummyWeapon",
|
|
||||||
"Transform": {
|
|
||||||
"Translation": {
|
|
||||||
"X": -10.751121520996094,
|
|
||||||
"Y": -15.242582321166993,
|
|
||||||
"Z": -17.880233764648439
|
|
||||||
},
|
|
||||||
"Orientation": {
|
|
||||||
"X": -2.9248639066281613e-8,
|
|
||||||
"Y": 0.7431446313858032,
|
|
||||||
"Z": -0.6691308617591858,
|
|
||||||
"W": -3.24838822507445e-8
|
|
||||||
},
|
|
||||||
"Scale": {
|
|
||||||
"X": 0.07999999821186066,
|
|
||||||
"Y": 0.431741327047348,
|
|
||||||
"Z": 0.07999999821186066
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"StaticFlags": 0,
|
|
||||||
"Layer": 2,
|
|
||||||
"Model": "223aa9894e90973780ab508621517526",
|
|
||||||
"Buffer": {
|
|
||||||
"Entries": [
|
|
||||||
{
|
|
||||||
"Material": "59d8bf5b4addd14c1e8f6089d1c3577c",
|
|
||||||
"ShadowsMode": 3,
|
|
||||||
"Visible": true,
|
|
||||||
"ReceiveDecals": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ID": "f00bd71c4e71c00fef2d70bd90cce128",
|
|
||||||
"TypeName": "FlaxEngine.StaticModel",
|
|
||||||
"ParentID": "b458fab04186b0cae4563ba49ac6a3f9",
|
|
||||||
"Name": "DummyWeapon 0",
|
|
||||||
"Transform": {
|
|
||||||
"Translation": {
|
|
||||||
"X": -10.764251708984375,
|
|
||||||
"Y": -13.419981002807618,
|
|
||||||
"Z": -33.95440673828125
|
|
||||||
},
|
|
||||||
"Orientation": {
|
|
||||||
"X": -2.9248639066281613e-8,
|
|
||||||
"Y": 0.7431446313858032,
|
|
||||||
"Z": -0.6691308617591858,
|
|
||||||
"W": -3.24838822507445e-8
|
|
||||||
},
|
|
||||||
"Scale": {
|
|
||||||
"X": 0.11999999731779099,
|
|
||||||
"Y": 0.11855093389749527,
|
|
||||||
"Z": 0.11999999731779099
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"StaticFlags": 0,
|
|
||||||
"Layer": 2,
|
|
||||||
"Model": "223aa9894e90973780ab508621517526",
|
|
||||||
"Buffer": {
|
|
||||||
"Entries": [
|
|
||||||
{
|
|
||||||
"Material": "ae5c8a4b4f723b60b8b31290a9dfb21a",
|
|
||||||
"ShadowsMode": 3,
|
|
||||||
"Visible": true,
|
|
||||||
"ReceiveDecals": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ID": "a5850c1640208268c45f2892fe6b9e45",
|
"ID": "a5850c1640208268c45f2892fe6b9e45",
|
||||||
@@ -230,6 +143,102 @@
|
|||||||
},
|
},
|
||||||
"StaticFlags": 0,
|
"StaticFlags": 0,
|
||||||
"CollisionData": "593d92914c4bd54679ddec9e539bba80"
|
"CollisionData": "593d92914c4bd54679ddec9e539bba80"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "56eddcef4698702bd3cb0b8a1fb3396f",
|
||||||
|
"TypeName": "FlaxEngine.EmptyActor",
|
||||||
|
"ParentID": "a50f3639419a8306036ecfab7115e772",
|
||||||
|
"Name": "ViewModelHolder",
|
||||||
|
"Transform": {
|
||||||
|
"Translation": {
|
||||||
|
"X": 0.0,
|
||||||
|
"Y": 22.0,
|
||||||
|
"Z": 0.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Layer": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "195f796349961ef9a9d46a8657fc693b",
|
||||||
|
"TypeName": "Game.WeaponSway",
|
||||||
|
"ParentID": "56eddcef4698702bd3cb0b8a1fb3396f",
|
||||||
|
"V": {
|
||||||
|
"swaySpeed": 90.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "111ba6ba4129558d16c0629bb31a55f9",
|
||||||
|
"TypeName": "FlaxEngine.StaticModel",
|
||||||
|
"ParentID": "56eddcef4698702bd3cb0b8a1fb3396f",
|
||||||
|
"Name": "DummyWeapon",
|
||||||
|
"Transform": {
|
||||||
|
"Translation": {
|
||||||
|
"X": 7.394217491149902,
|
||||||
|
"Y": -11.22248649597168,
|
||||||
|
"Z": -3.27701997756958
|
||||||
|
},
|
||||||
|
"Orientation": {
|
||||||
|
"X": 0.6691311001777649,
|
||||||
|
"Y": 0.0,
|
||||||
|
"Z": 0.0,
|
||||||
|
"W": 0.7431443929672241
|
||||||
|
},
|
||||||
|
"Scale": {
|
||||||
|
"X": 0.07999999821186066,
|
||||||
|
"Y": 0.431741327047348,
|
||||||
|
"Z": 0.07999999821186066
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"StaticFlags": 0,
|
||||||
|
"Layer": 2,
|
||||||
|
"Model": "223aa9894e90973780ab508621517526",
|
||||||
|
"Buffer": {
|
||||||
|
"Entries": [
|
||||||
|
{
|
||||||
|
"Material": "59d8bf5b4addd14c1e8f6089d1c3577c",
|
||||||
|
"ShadowsMode": 3,
|
||||||
|
"Visible": true,
|
||||||
|
"ReceiveDecals": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "99a5bfe4459e3ac2c3f0198ede38a587",
|
||||||
|
"TypeName": "FlaxEngine.StaticModel",
|
||||||
|
"ParentID": "56eddcef4698702bd3cb0b8a1fb3396f",
|
||||||
|
"Name": "DummyWeapon 0",
|
||||||
|
"Transform": {
|
||||||
|
"Translation": {
|
||||||
|
"X": 7.35720682144165,
|
||||||
|
"Y": -9.197076797485352,
|
||||||
|
"Z": 15.981095314025879
|
||||||
|
},
|
||||||
|
"Orientation": {
|
||||||
|
"X": 0.6691311001777649,
|
||||||
|
"Y": 0.0,
|
||||||
|
"Z": 0.0,
|
||||||
|
"W": 0.7431443929672241
|
||||||
|
},
|
||||||
|
"Scale": {
|
||||||
|
"X": 0.09000000357627869,
|
||||||
|
"Y": 0.05855093151330948,
|
||||||
|
"Z": 0.09000000357627869
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"StaticFlags": 0,
|
||||||
|
"Layer": 2,
|
||||||
|
"Model": "223aa9894e90973780ab508621517526",
|
||||||
|
"Buffer": {
|
||||||
|
"Entries": [
|
||||||
|
{
|
||||||
|
"Material": "ae5c8a4b4f723b60b8b31290a9dfb21a",
|
||||||
|
"ShadowsMode": 3,
|
||||||
|
"Visible": true,
|
||||||
|
"ReceiveDecals": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
},
|
},
|
||||||
"Control": "FlaxEngine.GUI.Label",
|
"Control": "FlaxEngine.GUI.Label",
|
||||||
"Data": {
|
"Data": {
|
||||||
"Text": "eFPS: 96\nuFPS: 96\nrFPS: 96\npFPS: 30",
|
"Text": "eFPS: 15 uTime: 176.6672213\nuFPS: 15 uTime: 0.00833330024033785\nrFPS: 15 rTime: 0\npFPS: 30 pTime: 0",
|
||||||
"TextColor": {
|
"TextColor": {
|
||||||
"R": 1.0,
|
"R": 1.0,
|
||||||
"G": 1.0,
|
"G": 1.0,
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
},
|
},
|
||||||
"Offsets": {
|
"Offsets": {
|
||||||
"Left": 0.0,
|
"Left": 0.0,
|
||||||
"Right": 50.0,
|
"Right": 224.0,
|
||||||
"Top": -97.0,
|
"Top": -97.0,
|
||||||
"Bottom": 64.0
|
"Bottom": 64.0
|
||||||
},
|
},
|
||||||
@@ -334,7 +334,7 @@
|
|||||||
},
|
},
|
||||||
"AA": {
|
"AA": {
|
||||||
"OverrideFlags": 1,
|
"OverrideFlags": 1,
|
||||||
"Mode": 2
|
"Mode": 0
|
||||||
},
|
},
|
||||||
"PostFxMaterials": {}
|
"PostFxMaterials": {}
|
||||||
}
|
}
|
||||||
@@ -380,12 +380,6 @@
|
|||||||
"camera": "711a0025492161a44f48afa6e591b6ab"
|
"camera": "711a0025492161a44f48afa6e591b6ab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ID": "4bedd9724ad22177fbf75f9bf51cc27f",
|
|
||||||
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
|
||||||
"PrefabObjectID": "1cf14d02487b7bd9f5c85b9ab437bfc7",
|
|
||||||
"ParentID": "86dbba284fbe908c9e62b89493e9a83f"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ID": "711a0025492161a44f48afa6e591b6ab",
|
"ID": "711a0025492161a44f48afa6e591b6ab",
|
||||||
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
@@ -393,51 +387,11 @@
|
|||||||
"ParentID": "f4ab880f47cab1ca423ce8b04f524ac2"
|
"ParentID": "f4ab880f47cab1ca423ce8b04f524ac2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
"ID": "4bedd9724ad22177fbf75f9bf51cc27f",
|
||||||
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
"PrefabObjectID": "b458fab04186b0cae4563ba49ac6a3f9",
|
"PrefabObjectID": "262c688d49caaf66eb7e6a97f0d01206",
|
||||||
"ParentID": "f4ab880f47cab1ca423ce8b04f524ac2"
|
"ParentID": "f4ab880f47cab1ca423ce8b04f524ac2"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ID": "d267a9954013a72391bd3a921d214639",
|
|
||||||
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
|
||||||
"PrefabObjectID": "293ff021499bbcb5c4b263894f5d327b",
|
|
||||||
"ParentID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
|
||||||
"Transform": {
|
|
||||||
"Translation": {
|
|
||||||
"X": -10.751110076904297,
|
|
||||||
"Y": -15.242582321166993,
|
|
||||||
"Z": -17.880233764648439
|
|
||||||
},
|
|
||||||
"Orientation": {
|
|
||||||
"X": -2.9248639066281613e-8,
|
|
||||||
"Y": 0.7431446313858032,
|
|
||||||
"Z": -0.6691308617591858,
|
|
||||||
"W": -3.24838822507445e-8
|
|
||||||
},
|
|
||||||
"Scale": {
|
|
||||||
"X": 0.07999999821186066,
|
|
||||||
"Y": 0.431741327047348,
|
|
||||||
"Z": 0.07999999821186066
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Buffer": {
|
|
||||||
"Entries": [
|
|
||||||
{}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ID": "0bf71acc46ee83ac2cfffbb9269bcd11",
|
|
||||||
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
|
||||||
"PrefabObjectID": "f00bd71c4e71c00fef2d70bd90cce128",
|
|
||||||
"ParentID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
|
||||||
"Buffer": {
|
|
||||||
"Entries": [
|
|
||||||
{}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ID": "b8dde5a34570002b6b5666a89d6a70cb",
|
"ID": "b8dde5a34570002b6b5666a89d6a70cb",
|
||||||
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
@@ -456,6 +410,41 @@
|
|||||||
"PrefabObjectID": "3932111d4c6f925a7b4a2e912307c82a",
|
"PrefabObjectID": "3932111d4c6f925a7b4a2e912307c82a",
|
||||||
"ParentID": "59cc65774b36b4a58a274fb7b4e9d490"
|
"ParentID": "59cc65774b36b4a58a274fb7b4e9d490"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
||||||
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
|
"PrefabObjectID": "56eddcef4698702bd3cb0b8a1fb3396f",
|
||||||
|
"ParentID": "59cc65774b36b4a58a274fb7b4e9d490"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "8ef08cf4468a34df2e97d8a971d5a2dd",
|
||||||
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
|
"PrefabObjectID": "195f796349961ef9a9d46a8657fc693b",
|
||||||
|
"ParentID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
||||||
|
"V": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "d267a9954013a72391bd3a921d214639",
|
||||||
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
|
"PrefabObjectID": "111ba6ba4129558d16c0629bb31a55f9",
|
||||||
|
"ParentID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
||||||
|
"Buffer": {
|
||||||
|
"Entries": [
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "0bf71acc46ee83ac2cfffbb9269bcd11",
|
||||||
|
"PrefabID": "82e58c9d462fba5a0df1a599417ff684",
|
||||||
|
"PrefabObjectID": "99a5bfe4459e3ac2c3f0198ede38a587",
|
||||||
|
"ParentID": "f3b9d1594b1f2fc5b793adb5f144ab46",
|
||||||
|
"Buffer": {
|
||||||
|
"Entries": [
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "9b9be0a542cc06e3172f4ea660188187",
|
"ID": "9b9be0a542cc06e3172f4ea660188187",
|
||||||
"TypeName": "FlaxEngine.PointLight",
|
"TypeName": "FlaxEngine.PointLight",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"ID": "af2e52554f7faed7b4937181dd22d166",
|
"ID": "af2e52554f7faed7b4937181dd22d166",
|
||||||
"TypeName": "FlaxEditor.Content.Settings.BuildSettings",
|
"TypeName": "FlaxEditor.Content.Settings.BuildSettings",
|
||||||
"EngineBuild": 6225,
|
"EngineBuild": 6331,
|
||||||
"Data": {
|
"Data": {
|
||||||
"MaxAssetsPerPackage": 4096,
|
"MaxAssetsPerPackage": 4096,
|
||||||
"MaxPackageSizeMB": 1024,
|
"MaxPackageSizeMB": 1024,
|
||||||
@@ -11,30 +11,32 @@
|
|||||||
"AdditionalAssets": [],
|
"AdditionalAssets": [],
|
||||||
"AdditionalAssetFolders": [
|
"AdditionalAssetFolders": [
|
||||||
"Content/Materials",
|
"Content/Materials",
|
||||||
"Content/Textures"
|
"Content/Textures",
|
||||||
|
"Content/Audio"
|
||||||
],
|
],
|
||||||
"ShadersNoOptimize": false,
|
"ShadersNoOptimize": false,
|
||||||
"ShadersGenerateDebugData": false,
|
"ShadersGenerateDebugData": false,
|
||||||
"Presets": [
|
"Presets": [
|
||||||
{
|
{
|
||||||
"Name": "Development",
|
"Name": "Preset 3",
|
||||||
"Targets": [
|
"Targets": [
|
||||||
{
|
{
|
||||||
"Name": "Win64",
|
"Name": "Win64 Release",
|
||||||
"Output": "Output\\WindowsDevelopment",
|
|
||||||
"Platform": 2,
|
|
||||||
"Mode": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Release",
|
|
||||||
"Targets": [
|
|
||||||
{
|
|
||||||
"Name": "Win64",
|
|
||||||
"Output": "Output\\WindowsRelease",
|
"Output": "Output\\WindowsRelease",
|
||||||
"Platform": 2,
|
"Platform": 2,
|
||||||
"Mode": 2
|
"Mode": 2,
|
||||||
|
"CustomDefines": null,
|
||||||
|
"PreBuildAction": null,
|
||||||
|
"PostBuildAction": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "Win64 Development",
|
||||||
|
"Output": "Output\\WindowsDevelopment",
|
||||||
|
"Platform": 2,
|
||||||
|
"Mode": 1,
|
||||||
|
"CustomDefines": null,
|
||||||
|
"PreBuildAction": null,
|
||||||
|
"PostBuildAction": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
"EnableAdaptiveForce": false,
|
"EnableAdaptiveForce": false,
|
||||||
"MaxDeltaTime": 0.1,
|
"MaxDeltaTime": 0.1,
|
||||||
"EnableSubstepping": false,
|
"EnableSubstepping": false,
|
||||||
"SubstepDeltaTime": 0.001,
|
"SubstepDeltaTime": 1E-05,
|
||||||
"MaxSubsteps": 60,
|
"MaxSubsteps": 600,
|
||||||
"SupportCookingAtRuntime": true,
|
"SupportCookingAtRuntime": true,
|
||||||
"LayerMasks": [
|
"LayerMasks": [
|
||||||
4294967295,
|
4294967295,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"UpdateMode": 1,
|
"UpdateMode": 1,
|
||||||
"UpdateFPS": 120.0,
|
"UpdateFPS": 120.0,
|
||||||
"PhysicsFPS": 120.0,
|
"PhysicsFPS": 120.0,
|
||||||
"DrawFPS": 0.0,
|
"DrawFPS": 120.0,
|
||||||
"TimeScale": 1.0,
|
"TimeScale": 1.0,
|
||||||
"MaxUpdateDeltaTime": 0.1
|
"MaxUpdateDeltaTime": 0.1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,20 +82,18 @@ namespace Game
|
|||||||
{
|
{
|
||||||
// Check if this audio has multiple variations
|
// Check if this audio has multiple variations
|
||||||
List<AudioClip> audioClips = new List<AudioClip>();
|
List<AudioClip> audioClips = new List<AudioClip>();
|
||||||
int index = 1;
|
for (int i = 1; i<50; i++)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
// TODO: make this more efficient, maybe get a list of assets and filter by name
|
// TODO: make this more efficient, maybe get a list of assets and filter by name?
|
||||||
audioClip = Content.Load<AudioClip>(Path.Combine(audioBasePath, soundName + "_var" + index + ".flax"));
|
AudioClip audioClipVariation = Content.Load<AudioClip>(Path.Combine(audioBasePath, soundName + "_var" + i + ".flax"));
|
||||||
if (audioClip != null)
|
if (audioClipVariation == null)
|
||||||
audioClips.Add(audioClip);
|
break;
|
||||||
index++;
|
|
||||||
} while (audioClip != null);
|
audioClips.Add(audioClipVariation);
|
||||||
|
}
|
||||||
|
|
||||||
if (audioClips.Count > 0)
|
if (audioClips.Count > 0)
|
||||||
{
|
|
||||||
audio.AudioClips = audioClips.ToArray();
|
audio.AudioClips = audioClips.ToArray();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
Console.PrintError("AudioClip '" + soundName + "' not found");
|
Console.PrintError("AudioClip '" + soundName + "' not found");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,21 @@ namespace Cabrito
|
|||||||
double updateTimeAvg = 0.0;
|
double updateTimeAvg = 0.0;
|
||||||
ulong updateTimeCount;
|
ulong updateTimeCount;
|
||||||
const double updateInterval = 0.25;
|
const double updateInterval = 0.25;
|
||||||
|
double updateAccumTime = 0.0;
|
||||||
|
|
||||||
Stopwatch sw2;
|
Stopwatch sw2;
|
||||||
double drawTimeAvg = 0.0;
|
double drawTimeAvg = 0.0;
|
||||||
ulong drawTimeCount;
|
ulong drawTimeCount;
|
||||||
const double drawInterval = 0.25;
|
const double drawInterval = 0.25;
|
||||||
|
double drawAccumTime = 0.0;
|
||||||
|
|
||||||
Stopwatch sw3;
|
Stopwatch sw3;
|
||||||
double physicsTimeAvg = 0.0;
|
double physicsTimeAvg = 0.0;
|
||||||
ulong physicsTimeCount;
|
ulong physicsTimeCount;
|
||||||
const double physicsInterval = 0.25;
|
const double physicsInterval = 0.25;
|
||||||
|
double physicsAccumTime = 0.0;
|
||||||
|
|
||||||
|
Stopwatch sw0;
|
||||||
|
|
||||||
string currentRenderer = "Unknown";
|
string currentRenderer = "Unknown";
|
||||||
|
|
||||||
@@ -43,10 +48,12 @@ namespace Cabrito
|
|||||||
label = (Label) control.Control;
|
label = (Label) control.Control;
|
||||||
|
|
||||||
sw = Stopwatch.StartNew();
|
sw = Stopwatch.StartNew();
|
||||||
|
sw2 = Stopwatch.StartNew();
|
||||||
|
sw3 = Stopwatch.StartNew();
|
||||||
|
sw0 = Stopwatch.StartNew();
|
||||||
|
|
||||||
currentRenderer = GPUDevice.Instance.RendererType.ToString();
|
currentRenderer = GPUDevice.Instance.RendererType.ToString();
|
||||||
|
|
||||||
sw2 = Stopwatch.StartNew();
|
|
||||||
if (t == null)
|
if (t == null)
|
||||||
{
|
{
|
||||||
//Destroy(t);
|
//Destroy(t);
|
||||||
@@ -54,8 +61,6 @@ namespace Cabrito
|
|||||||
t.Render += OnDraw;
|
t.Render += OnDraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
sw3 = Stopwatch.StartNew();
|
|
||||||
|
|
||||||
var settings = FlaxEditor.Content.Settings.GameSettings.Load();
|
var settings = FlaxEditor.Content.Settings.GameSettings.Load();
|
||||||
timeSettings = settings.Time.CreateInstance<FlaxEditor.Content.Settings.TimeSettings>();
|
timeSettings = settings.Time.CreateInstance<FlaxEditor.Content.Settings.TimeSettings>();
|
||||||
}
|
}
|
||||||
@@ -70,6 +75,7 @@ namespace Cabrito
|
|||||||
|
|
||||||
public override void OnUpdate()
|
public override void OnUpdate()
|
||||||
{
|
{
|
||||||
|
updateAccumTime += Time.DeltaTime;
|
||||||
updateTimeCount++;
|
updateTimeCount++;
|
||||||
double elapsed = sw.Elapsed.TotalSeconds;
|
double elapsed = sw.Elapsed.TotalSeconds;
|
||||||
if (elapsed >= updateInterval)
|
if (elapsed >= updateInterval)
|
||||||
@@ -85,9 +91,13 @@ namespace Cabrito
|
|||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.Append("eFPS: " + Engine.FramesPerSecond);
|
sb.Append("eFPS: " + Engine.FramesPerSecond);
|
||||||
sb.Append("\nuFPS: " + ((int) Math.Round(1.0f / updateTimeAvg)).ToString());
|
sb.Append(" uTime: " + sw0.Elapsed.TotalSeconds);
|
||||||
sb.Append("\nrFPS: " + ((int) Math.Round(1.0f / drawTimeAvg)).ToString());
|
sb.Append("\nuFPS: " + ((int) Math.Round(1.0f / updateTimeAvg)));
|
||||||
sb.Append("\npFPS: " + ((int) Math.Round(1.0f / physicsTimeAvg)).ToString());
|
sb.Append(" uTime: " + updateAccumTime);
|
||||||
|
sb.Append("\nrFPS: " + ((int) Math.Round(1.0f / drawTimeAvg)));
|
||||||
|
sb.Append(" rTime: " + drawAccumTime);
|
||||||
|
sb.Append("\npFPS: " + ((int) Math.Round(1.0f / physicsTimeAvg)));
|
||||||
|
sb.Append(" pTime: " + physicsAccumTime);
|
||||||
//sb.Append("\nCon: " + conTime.ToString() + "ms");
|
//sb.Append("\nCon: " + conTime.ToString() + "ms");
|
||||||
//sb.Append("\nGC memory: " + (GC.GetTotalMemory(false) / 1000000.0f).ToString() + "MB");
|
//sb.Append("\nGC memory: " + (GC.GetTotalMemory(false) / 1000000.0f).ToString() + "MB");
|
||||||
//sb.Append("\nUpdate profiler: " + updateProfTime.ToString() + "ms");
|
//sb.Append("\nUpdate profiler: " + updateProfTime.ToString() + "ms");
|
||||||
@@ -148,6 +158,7 @@ namespace Cabrito
|
|||||||
|
|
||||||
public override void OnFixedUpdate()
|
public override void OnFixedUpdate()
|
||||||
{
|
{
|
||||||
|
physicsAccumTime += Time.DeltaTime;
|
||||||
physicsTimeCount++;
|
physicsTimeCount++;
|
||||||
double elapsed = sw3.Elapsed.TotalSeconds;
|
double elapsed = sw3.Elapsed.TotalSeconds;
|
||||||
if (elapsed >= physicsInterval)
|
if (elapsed >= physicsInterval)
|
||||||
@@ -160,6 +171,7 @@ namespace Cabrito
|
|||||||
|
|
||||||
void OnDraw(RenderTask tt, GPUContext context)
|
void OnDraw(RenderTask tt, GPUContext context)
|
||||||
{
|
{
|
||||||
|
drawAccumTime += Time.DeltaTime;
|
||||||
drawTimeCount++;
|
drawTimeCount++;
|
||||||
double elapsed = sw2.Elapsed.TotalSeconds;
|
double elapsed = sw2.Elapsed.TotalSeconds;
|
||||||
if (elapsed >= drawInterval)
|
if (elapsed >= drawInterval)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using FlaxEngine;
|
using FlaxEditor.Content.Settings;
|
||||||
|
using FlaxEngine;
|
||||||
using Console = Cabrito.Console;
|
using Console = Cabrito.Console;
|
||||||
|
|
||||||
namespace Game
|
namespace Game
|
||||||
@@ -89,6 +90,16 @@ namespace Game
|
|||||||
|
|
||||||
public override void OnUpdate()
|
public override void OnUpdate()
|
||||||
{
|
{
|
||||||
|
#if FLAX_EDITOR
|
||||||
|
if (Input.GetKeyDown(KeyboardKeys.F7))
|
||||||
|
{
|
||||||
|
var physicsSettings = GameSettings.Load<PhysicsSettings>();
|
||||||
|
physicsSettings.EnableSubstepping = !physicsSettings.EnableSubstepping;
|
||||||
|
GameSettings.Save(physicsSettings);
|
||||||
|
//GameSettings.Apply();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!camera.IsActive)
|
if (!camera.IsActive)
|
||||||
return;
|
return;
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ namespace Game
|
|||||||
[Limit(0, 9000), Tooltip("Base Movement speed")]
|
[Limit(0, 9000), Tooltip("Base Movement speed")]
|
||||||
public float MoveSpeed { get; set; } = 320;
|
public float MoveSpeed { get; set; } = 320;
|
||||||
|
|
||||||
|
private static Vector3 Gravity { get; set; } = new Vector3(0, -800.0f, 0f);
|
||||||
|
|
||||||
private float viewPitch;
|
private float viewPitch;
|
||||||
private float viewYaw;
|
private float viewYaw;
|
||||||
private float viewRoll;
|
private float viewRoll;
|
||||||
@@ -54,7 +56,7 @@ namespace Game
|
|||||||
base.OnAwake();
|
base.OnAwake();
|
||||||
|
|
||||||
bool record = false;
|
bool record = false;
|
||||||
//record = true;
|
record = true;
|
||||||
|
|
||||||
if (record)
|
if (record)
|
||||||
{
|
{
|
||||||
@@ -62,8 +64,8 @@ namespace Game
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
input = new PlayerInputLocal();
|
//input = new PlayerInputLocal();
|
||||||
//input = new PlayerInputDemo(@"C:\dev\GoakeFlax\testdemo.gdem"); //playback
|
input = new PlayerInputDemo(@"C:\dev\GoakeFlax\testdemo.gdem"); //playback
|
||||||
//input = new PlayerInputDemo(@"C:\dev\GoakeFlax\testdemo_desync.gdem"); //playback
|
//input = new PlayerInputDemo(@"C:\dev\GoakeFlax\testdemo_desync.gdem"); //playback
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,6 +186,10 @@ namespace Game
|
|||||||
if (input is PlayerInputDemo)
|
if (input is PlayerInputDemo)
|
||||||
input.OnUpdate();
|
input.OnUpdate();
|
||||||
|
|
||||||
|
float deltadif = Time.DeltaTime - (1.0f / Time.PhysicsFPS);
|
||||||
|
if (Math.Abs(deltadif) > 0.0001f)
|
||||||
|
Console.Print("drift: " + deltadif);
|
||||||
|
|
||||||
input.OnFixedUpdate();
|
input.OnFixedUpdate();
|
||||||
PlayerInputState inputState = input.GetCurrentInputState();
|
PlayerInputState inputState = input.GetCurrentInputState();
|
||||||
|
|
||||||
@@ -525,7 +531,7 @@ namespace Game
|
|||||||
// hit something, try to step up
|
// hit something, try to step up
|
||||||
if (onGround)
|
if (onGround)
|
||||||
{
|
{
|
||||||
Vector3 stepDelta = -Physics.Gravity.Normalized * stepSize;
|
Vector3 stepDelta = -Gravity.Normalized * stepSize;
|
||||||
|
|
||||||
Vector3 slidePosition = position;
|
Vector3 slidePosition = position;
|
||||||
Vector3 slideVelocity = velocity;
|
Vector3 slideVelocity = velocity;
|
||||||
@@ -544,11 +550,11 @@ namespace Game
|
|||||||
// step down
|
// step down
|
||||||
Vector3 stepDown = position - stepDelta;
|
Vector3 stepDown = position - stepDelta;
|
||||||
TraceInfo traceDown = TracePlayer(actor, position, stepDown);
|
TraceInfo traceDown = TracePlayer(actor, position, stepDown);
|
||||||
if (traceDown.fraction < 1f && -Vector3.Dot(Physics.Gravity.Normalized, traceDown.hitNormal) < slopeNormal)
|
if (traceDown.fraction < 1f && -Vector3.Dot(Gravity.Normalized, traceDown.hitNormal) < slopeNormal)
|
||||||
{
|
{
|
||||||
// can't step down, slide move like normally
|
// can't step down, slide move like normally
|
||||||
Console.Print("no stepping 1, frac: " + traceDown.fraction + ", dot: " +
|
Console.Print("no stepping 1, frac: " + traceDown.fraction + ", dot: " +
|
||||||
(-Vector3.Dot(Physics.Gravity.Normalized, traceDown.hitNormal)) +
|
(-Vector3.Dot(Gravity.Normalized, traceDown.hitNormal)) +
|
||||||
", norm: " + traceDown.hitNormal);
|
", norm: " + traceDown.hitNormal);
|
||||||
position = slidePosition;
|
position = slidePosition;
|
||||||
velocity = slideVelocity;
|
velocity = slideVelocity;
|
||||||
@@ -562,8 +568,8 @@ namespace Game
|
|||||||
position.Y += collisionMargin;
|
position.Y += collisionMargin;
|
||||||
|
|
||||||
// ??
|
// ??
|
||||||
var d1 = -Vector3.Dot(Physics.Gravity.Normalized, position);
|
var d1 = -Vector3.Dot(Gravity.Normalized, position);
|
||||||
var d2 = -Vector3.Dot(Physics.Gravity.Normalized, originalPosition);
|
var d2 = -Vector3.Dot(Gravity.Normalized, originalPosition);
|
||||||
if (d1 < d2)
|
if (d1 < d2)
|
||||||
{
|
{
|
||||||
//Console.Print("no stepping 2, " + d1 + " < " + d2);
|
//Console.Print("no stepping 2, " + d1 + " < " + d2);
|
||||||
@@ -818,13 +824,13 @@ namespace Game
|
|||||||
|
|
||||||
// categorize position
|
// categorize position
|
||||||
onGround = true;
|
onGround = true;
|
||||||
Vector3 groundDelta = Physics.Gravity.Normalized;//Physics.Gravity.Normalized * (collisionMargin * 2);
|
Vector3 groundDelta = Gravity.Normalized;//Gravity.Normalized * (collisionMargin * 2);
|
||||||
//if (velocity.Y < 0f)
|
//if (velocity.Y < 0f)
|
||||||
// groundDelta = Physics.Gravity.Normalized * velocity.Y * Time.DeltaTime;
|
// groundDelta = Gravity.Normalized * velocity.Y * Time.DeltaTime;
|
||||||
TraceInfo traceGround = TracePlayer(Actor, position, position + groundDelta);
|
TraceInfo traceGround = TracePlayer(Actor, position, position + groundDelta);
|
||||||
|
|
||||||
if (!traceGround.startSolid && traceGround.fraction < 1f &&
|
if (!traceGround.startSolid && traceGround.fraction < 1f &&
|
||||||
-Vector3.Dot(Physics.Gravity.Normalized, traceGround.hitNormal) < slopeNormal)
|
-Vector3.Dot(Gravity.Normalized, traceGround.hitNormal) < slopeNormal)
|
||||||
{
|
{
|
||||||
//Console.Print("slope?");
|
//Console.Print("slope?");
|
||||||
// slope
|
// slope
|
||||||
@@ -845,7 +851,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!traceGround.startSolid && (traceGround.fraction >= 1f ||
|
if (!traceGround.startSolid && (traceGround.fraction >= 1f ||
|
||||||
-Vector3.Dot(Physics.Gravity.Normalized, traceGround.hitNormal) < slopeNormal))
|
-Vector3.Dot(Gravity.Normalized, traceGround.hitNormal) < slopeNormal))
|
||||||
{
|
{
|
||||||
// falling or sliding down a slope
|
// falling or sliding down a slope
|
||||||
onGround = false;
|
onGround = false;
|
||||||
@@ -873,7 +879,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
|
|
||||||
// reset velocity from gravity
|
// reset velocity from gravity
|
||||||
if (-Vector3.Dot(Physics.Gravity.Normalized, velocity) < 0 &&
|
if (-Vector3.Dot(Gravity.Normalized, velocity) < 0 &&
|
||||||
Vector3.Dot(velocity, traceGround.hitNormal) < -0.1)
|
Vector3.Dot(velocity, traceGround.hitNormal) < -0.1)
|
||||||
{
|
{
|
||||||
velocity = Vector3.ProjectOnPlane(velocity, traceGround.hitNormal);
|
velocity = Vector3.ProjectOnPlane(velocity, traceGround.hitNormal);
|
||||||
@@ -949,7 +955,7 @@ namespace Game
|
|||||||
// PM_Aircontrol(wishdir, wishspeedAirControl);
|
// PM_Aircontrol(wishdir, wishspeedAirControl);
|
||||||
|
|
||||||
// apply gravity
|
// apply gravity
|
||||||
velocity += Physics.Gravity * Time.DeltaTime;
|
velocity += Gravity * Time.DeltaTime;
|
||||||
//Console.Print(Time.DeltaTime.ToString());
|
//Console.Print(Time.DeltaTime.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
205
Source/Game/WeaponSway.cs
Normal file
205
Source/Game/WeaponSway.cs
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using FlaxEngine;
|
||||||
|
using Console = Cabrito.Console;
|
||||||
|
|
||||||
|
namespace Game
|
||||||
|
{
|
||||||
|
public class WeaponSway : Script
|
||||||
|
{
|
||||||
|
private Actor rootActor;
|
||||||
|
private Actor cameraHolder;
|
||||||
|
public override void OnStart()
|
||||||
|
{
|
||||||
|
rootActor = Actor.Parent.GetChild("RootActor");
|
||||||
|
cameraHolder = rootActor.GetChild("CameraHolder");
|
||||||
|
Actor.LocalOrientation = GetRotation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float easeInSine( float t ) {
|
||||||
|
return Mathf.Sin( 1.5707963f * t );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutSine( float t ) {
|
||||||
|
return 1 + Mathf.Sin( 1.5707963f * (--t) );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutSine( float t ) {
|
||||||
|
return 0.5f * (1 + Mathf.Sin( 3.1415926f * (t - 0.5f) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInQuad( float t ) {
|
||||||
|
return t * t;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutQuad( float t ) {
|
||||||
|
return t * (2 - t);
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutQuad( float t ) {
|
||||||
|
return t < 0.5 ? 2 * t * t : t * (4 - 2 * t) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInCubic( float t ) {
|
||||||
|
return t * t * t;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutCubic( float t ) {
|
||||||
|
return 1 + (--t) * t * t;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutCubic( float t ) {
|
||||||
|
return t < 0.5 ? 4 * t * t * t : 1 + (--t) * (2 * (--t)) * (2 * t);
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInQuart( float t ) {
|
||||||
|
t *= t;
|
||||||
|
return t * t;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutQuart( float t ) {
|
||||||
|
t = (--t) * t;
|
||||||
|
return 1 - t * t;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutQuart( float t ) {
|
||||||
|
if( t < 0.5 ) {
|
||||||
|
t *= t;
|
||||||
|
return 8 * t * t;
|
||||||
|
} else {
|
||||||
|
t = (--t) * t;
|
||||||
|
return 1 - 8 * t * t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInQuint( float t ) {
|
||||||
|
float t2 = t * t;
|
||||||
|
return t * t2 * t2;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutQuint( float t ) {
|
||||||
|
float t2 = (--t) * t;
|
||||||
|
return 1 + t * t2 * t2;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutQuint( float t ) {
|
||||||
|
float t2;
|
||||||
|
if( t < 0.5 ) {
|
||||||
|
t2 = t * t;
|
||||||
|
return 16 * t * t2 * t2;
|
||||||
|
} else {
|
||||||
|
t2 = (--t) * t;
|
||||||
|
return 1 + 16 * t * t2 * t2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInExpo( float t ) {
|
||||||
|
return (Mathf.Pow( 2, 8 * t ) - 1) / 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutExpo( float t ) {
|
||||||
|
return 1 - Mathf.Pow( 2, -8 * t );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutExpo( float t ) {
|
||||||
|
if( t < 0.5 ) {
|
||||||
|
return (Mathf.Pow( 2, 16 * t ) - 1) / 510;
|
||||||
|
} else {
|
||||||
|
return 1 - 0.5f * Mathf.Pow( 2, -16 * (t - 0.5f) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInCirc( float t ) {
|
||||||
|
return 1 - Mathf.Sqrt( 1 - t );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutCirc( float t ) {
|
||||||
|
return Mathf.Sqrt( t );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutCirc( float t ) {
|
||||||
|
if( t < 0.5 ) {
|
||||||
|
return (1 - Mathf.Sqrt( 1 - 2 * t )) * 0.5f;
|
||||||
|
} else {
|
||||||
|
return (1 + Mathf.Sqrt( 2 * t - 1 )) * 0.5f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInBack( float t ) {
|
||||||
|
return t * t * (2.70158f * t - 1.70158f);
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutBack( float t ) {
|
||||||
|
return 1 + (--t) * t * (2.70158f * t + 1.70158f);
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutBack( float t ) {
|
||||||
|
if( t < 0.5 ) {
|
||||||
|
return t * t * (7 * t - 2.5f) * 2;
|
||||||
|
} else {
|
||||||
|
return 1 + (--t) * t * 2 * (7 * t + 2.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInElastic( float t ) {
|
||||||
|
float t2 = t * t;
|
||||||
|
return t2 * t2 * Mathf.Sin( t * (float)Math.PI * 4.5f );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutElastic( float t ) {
|
||||||
|
float t2 = (t - 1) * (t - 1);
|
||||||
|
return 1 - t2 * t2 * Mathf.Cos( t * (float)Math.PI * 4.5f );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutElastic( float t ) {
|
||||||
|
float t2;
|
||||||
|
if( t < 0.45 ) {
|
||||||
|
t2 = t * t;
|
||||||
|
return 8 * t2 * t2 * Mathf.Sin( t * (float)Math.PI * 9 );
|
||||||
|
} else if( t < 0.55 ) {
|
||||||
|
return 0.5f + 0.75f * Mathf.Sin( t * (float)Math.PI * 4 );
|
||||||
|
} else {
|
||||||
|
t2 = (t - 1) * (t - 1);
|
||||||
|
return 1 - 8 * t2 * t2 * Mathf.Sin( t * (float)Math.PI * 9 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInBounce( float t ) {
|
||||||
|
return Mathf.Pow( 2, 6 * (t - 1) ) * Mathf.Abs( Mathf.Sin( t * (float)Math.PI * 3.5f ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeOutBounce( float t ) {
|
||||||
|
return 1 - Mathf.Pow( 2, -6 * t ) * Mathf.Abs( Mathf.Cos( t * (float)Math.PI * 3.5f ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
float easeInOutBounce( float t ) {
|
||||||
|
if( t < 0.5 ) {
|
||||||
|
return 8 * Mathf.Pow( 2, 8 * (t - 1) ) * Mathf.Abs( Mathf.Sin( t * (float)Math.PI * 7 ) );
|
||||||
|
} else {
|
||||||
|
return 1 - 8 * Mathf.Pow( 2, -8 * t ) * Mathf.Abs( Mathf.Sin( t * (float)Math.PI * 7 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Quaternion targetRotation;
|
||||||
|
private Quaternion oldRotation;
|
||||||
|
private Quaternion accumRotation;
|
||||||
|
|
||||||
|
public float swaySpeed = 15f;
|
||||||
|
|
||||||
|
private Quaternion GetRotation()
|
||||||
|
{
|
||||||
|
Quaternion pitch = cameraHolder.LocalOrientation;
|
||||||
|
Quaternion yawRoll = rootActor.LocalOrientation;
|
||||||
|
return yawRoll * pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnLateUpdate()
|
||||||
|
{
|
||||||
|
//easeInQuad
|
||||||
|
|
||||||
|
Quaternion rotation = GetRotation();
|
||||||
|
Actor.LocalOrientation = Quaternion.Lerp(Actor.LocalOrientation, rotation, Math.Min(1.0f, easeInCubic(swaySpeed * Time.DeltaTime)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user