Merge remote-tracking branch 'origin/master' into navigation-features

# Conflicts:
#	Source/Editor/Content/Settings/NavigationSettings.cs
#	Source/Engine/Engine/PhysicalMaterial.cs
#	Source/Tools/Flax.Build/Bindings/BindingsGenerator.Api.cs
This commit is contained in:
Wojtek Figat
2021-01-04 14:31:56 +01:00
2425 changed files with 4606 additions and 30937 deletions

BIN
Content/Editor/Camera/M_Camera.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Editor/Gizmo/Material.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Editor/Gizmo/MaterialWire.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Editor/Highlight Material.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Editor/Icons/IconsMaterial.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -114,8 +114,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Input macro specified by the material: DECAL_BLEND_MODE // Input macro specified by the material: DECAL_BLEND_MODE
@@ -160,12 +159,9 @@ void PS_Decal(
float3 positionWS = positionHS.xyz / positionHS.w; float3 positionWS = positionHS.xyz / positionHS.w;
float3 positionOS = mul(float4(positionWS, 1), InvWorld).xyz; float3 positionOS = mul(float4(positionWS, 1), InvWorld).xyz;
// Clip content outside the decal
clip(0.5 - abs(positionOS.xyz)); clip(0.5 - abs(positionOS.xyz));
// By default, map textures using the vectors perpendicular to the projection direction
float2 decalUVs = positionOS.xz + 0.5f; float2 decalUVs = positionOS.xz + 0.5f;
// Setup material input // Setup material input
MaterialInput materialInput = (MaterialInput)0; MaterialInput materialInput = (MaterialInput)0;
materialInput.WorldPosition = positionWS; materialInput.WorldPosition = positionWS;

View File

@@ -197,8 +197,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Vertex Shader function for GUI materials rendering // Vertex Shader function for GUI materials rendering

View File

@@ -330,8 +330,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Calculates the transform matrix from mesh tangent space to local space // Calculates the transform matrix from mesh tangent space to local space
@@ -834,7 +833,7 @@ float4 PS_Distortion(PixelInput input) : SV_Target0
// Scale up for better precision in low/subtle refractions at the expense of artefacts at higher refraction // Scale up for better precision in low/subtle refractions at the expense of artefacts at higher refraction
distortion *= 4.0f; distortion *= 4.0f;
// Store positive and negative offsets separately // Use separate storage for positive and negative offsets
float2 addOffset = max(distortion, 0); float2 addOffset = max(distortion, 0);
float2 subOffset = abs(min(distortion, 0)); float2 subOffset = abs(min(distortion, 0));
return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y); return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y);

View File

@@ -134,8 +134,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Pixel Shader function for PostFx materials rendering // Pixel Shader function for PostFx materials rendering

View File

@@ -340,8 +340,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Calculates the transform matrix from mesh tangent space to local space // Calculates the transform matrix from mesh tangent space to local space
@@ -500,7 +499,7 @@ float3x4 GetBoneMatrix(int index)
} }
// Calculates the transposed transform matrix for the given vertex (uses blending) // Calculates the transposed transform matrix for the given vertex (uses blending)
float3x4 CalcBoneMatrix(ModelInput_Skinned input) float3x4 GetBoneMatrix(ModelInput_Skinned input)
{ {
float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x); float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x);
boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y); boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y);
@@ -549,7 +548,7 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
// Perform skinning // Perform skinning
SkinningData data; SkinningData data;
data.BlendMatrix = CalcBoneMatrix(input); data.BlendMatrix = GetBoneMatrix(input);
float3 position = SkinPosition(input, data); float3 position = SkinPosition(input, data);
float3x3 tangentToLocal = SkinTangents(input, data); float3x3 tangentToLocal = SkinTangents(input, data);
@@ -808,7 +807,6 @@ TessalationDSToPS DS(TessalationPatch constantData, float3 barycentricCoords : S
#define COPY(thing) output.thing = input[0].thing #define COPY(thing) output.thing = input[0].thing
INTERPOLATE(Position); INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN #if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
// Precompute squares and squares * 3
float UU = U * U; float UU = U * U;
float VV = V * V; float VV = V * V;
float WW = W * W; float WW = W * W;

View File

@@ -337,8 +337,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Calculates the transform matrix from mesh tangent space to local space // Calculates the transform matrix from mesh tangent space to local space
@@ -474,7 +473,7 @@ float3x4 GetBoneMatrix(int index)
} }
// Calculates the transposed transform matrix for the given vertex (uses blending) // Calculates the transposed transform matrix for the given vertex (uses blending)
float3x4 CalcBoneMatrix(ModelInput_Skinned input) float3x4 GetBoneMatrix(ModelInput_Skinned input)
{ {
float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x); float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x);
boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y); boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y);
@@ -521,7 +520,7 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
// Perform skinning // Perform skinning
SkinningData data; SkinningData data;
data.BlendMatrix = CalcBoneMatrix(input); data.BlendMatrix = GetBoneMatrix(input);
float3 position = SkinPosition(input, data); float3 position = SkinPosition(input, data);
half3x3 tangentToLocal = SkinTangents(input, data); half3x3 tangentToLocal = SkinTangents(input, data);
@@ -755,7 +754,6 @@ TessalationDSToPS DS(TessalationPatch constantData, float3 barycentricCoords : S
#define COPY(thing) output.thing = input[0].thing #define COPY(thing) output.thing = input[0].thing
INTERPOLATE(Position); INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN #if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
// Precompute squares and squares * 3
float UU = U * U; float UU = U * U;
float VV = V * V; float VV = V * V;
float WW = W * W; float WW = W * W;
@@ -977,8 +975,8 @@ float4 PS_Distortion(PixelInput input) : SV_Target0
// Scale up for better precision in low/subtle refractions at the expense of artefacts at higher refraction // Scale up for better precision in low/subtle refractions at the expense of artefacts at higher refraction
distortion *= 4.0f; distortion *= 4.0f;
// Store positive and negative offsets separately // Use separate storage for positive and negative offsets
float2 addOffset = max(distortion, 0); float2 addOffset = max(distortion, 0);
float2 subOffset = abs(min(distortion, 0)); float2 subOffset = abs(min(distortion, 0));
return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y); return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y);

View File

@@ -234,8 +234,7 @@ Material GetMaterialPS(MaterialInput input)
@4 @4
} }
// Programmatically set the line number after all the material inputs which have a variable number of line endings // Fix line for errors/warnings for shader code from template
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
#line 1000 #line 1000
// Calculates LOD value (with fractional part for blending) // Calculates LOD value (with fractional part for blending)
@@ -595,7 +594,6 @@ TessalationDSToPS DS(TessalationPatch constantData, float3 barycentricCoords : S
#define COPY(thing) output.thing = input[0].thing #define COPY(thing) output.thing = input[0].thing
INTERPOLATE(Position); INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN #if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
// Precompute squares and squares * 3
float UU = U * U; float UU = U * U;
float VV = V * V; float VV = V * V;
float WW = W * W; float WW = W * W;

Binary file not shown.

BIN
Content/Editor/Wires Debug Material.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Engine/DefaultMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Engine/DefaultTerrainMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/AtmospherePreCompute.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/BakeLightmap.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/BitonicSort.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/ColorGrading.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/DebugDraw.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/DepthOfField.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Shaders/Editor/VertexColors.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/EyeAdaptation.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/FXAA.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Fog.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Forward.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/GBuffer.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/GPUParticlesSorting.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/GUI.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Histogram.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Lights.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/MotionBlur.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/MultiScaler.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/PostProcessing.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/ProbesFilter.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Quad.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Reflections.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/SMAA.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/SSAO.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/SSR.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Shadows.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Sky.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/TAA.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/VolumetricFog.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -6,7 +6,7 @@
"Build": 6214 "Build": 6214
}, },
"Company": "Flax", "Company": "Flax",
"Copyright": "Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.", "Copyright": "Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.",
"GameTarget": "FlaxGame", "GameTarget": "FlaxGame",
"EditorTarget": "FlaxEditor" "EditorTarget": "FlaxEditor"
} }

View File

@@ -6,34 +6,18 @@ setlocal
pushd pushd
echo Generating Flax Engine project files... echo Generating Flax Engine project files...
rem Make sure the batch file exists in the root folder.
if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments) rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments)
call "Development\Scripts\Windows\CallBuildTool.bat" -genproject %* call "Development\Scripts\Windows\CallBuildTool.bat" -genproject %*
if errorlevel 1 goto Error_BuildToolFailed if errorlevel 1 goto BuildToolFailed
rem Done.
popd popd
echo Done! echo Done!
exit /B 0 exit /B 0
:Error_BatchFileInWrongLocation :BuildToolFailed
echo.
echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
echo.
pause
goto Exit
:Error_BuildToolFailed
echo.
echo Flax.Build tool failed. echo Flax.Build tool failed.
echo.
pause
goto Exit goto Exit
:Exit :Exit
rem Restore original directory before exit.
popd popd
exit /B 1 exit /B 1

View File

@@ -6,32 +6,18 @@ setlocal
pushd pushd
echo Performing the full package... echo Performing the full package...
rem Make sure the batch file exists in the root folder.
if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
rem Run the build tool. rem Run the build tool.
call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployEditor -deployPlatforms -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %* call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployEditor -deployPlatforms -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %*
if errorlevel 1 goto Error_BuildToolFailed if errorlevel 1 goto BuildToolFailed
rem Done.
popd popd
echo Done! echo Done!
exit /B 0 exit /B 0
:Error_BatchFileInWrongLocation :BuildToolFailed
echo.
echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
echo.
goto Exit
:Error_BuildToolFailed
echo.
echo Flax.Build tool failed. echo Flax.Build tool failed.
echo.
goto Exit goto Exit
:Exit :Exit
rem Restore original directory before exit.
popd popd
exit /B 1 exit /B 1

View File

@@ -6,32 +6,18 @@ setlocal
pushd pushd
echo Building and packaging Flax Editor... echo Building and packaging Flax Editor...
rem Make sure the batch file exists in the root folder. rem Run the build tool.
if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments)
call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployEditor -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %* call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployEditor -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %*
if errorlevel 1 goto Error_BuildToolFailed if errorlevel 1 goto BuildToolFailed
rem Done.
popd popd
echo Done! echo Done!
exit /B 0 exit /B 0
:Error_BatchFileInWrongLocation :BuildToolFailed
echo.
echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
echo.
goto Exit
:Error_BuildToolFailed
echo.
echo Flax.Build tool failed. echo Flax.Build tool failed.
echo.
goto Exit goto Exit
:Exit :Exit
rem Restore original directory before exit.
popd popd
exit /B 1 exit /B 1

View File

@@ -6,32 +6,18 @@ setlocal
pushd pushd
echo Building and packaging platforms data... echo Building and packaging platforms data...
rem Make sure the batch file exists in the root folder. rem Run the build tool.
if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments)
call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployPlatforms -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %* call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployPlatforms -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %*
if errorlevel 1 goto Error_BuildToolFailed if errorlevel 1 goto BuildToolFailed
rem Done.
popd popd
echo Done! echo Done!
exit /B 0 exit /B 0
:Error_BatchFileInWrongLocation :BuildToolFailed
echo.
echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
echo.
goto Exit
:Error_BuildToolFailed
echo.
echo Flax.Build tool failed. echo Flax.Build tool failed.
echo.
goto Exit goto Exit
:Exit :Exit
rem Restore original directory before exit.
popd popd
exit /B 1 exit /B 1

View File

@@ -14,12 +14,12 @@ if not exist "%appdata%\Flax\Versions.txt" (
) )
set EngineLocation=%cd% set EngineLocation=%cd%
find /c "%EngineLocation%" "%appdata%\Flax\Versions.txt" find /c "%EngineLocation%" "%appdata%\Flax\Versions.txt"
if %errorlevel% equ 1 goto notfound if %errorlevel% equ 1 goto NotFound
echo Already registered. echo Already registered.
goto Done goto Done
rem Register the location (append to the end) rem Register the location (append to the end)
:notfound :NotFound
echo Location '%EngineLocation%' is not registered. Adding it to the list of engine versions. echo Location '%EngineLocation%' is not registered. Adding it to the list of engine versions.
echo %EngineLocation%>>"%appdata%\Flax\Versions.txt" echo %EngineLocation%>>"%appdata%\Flax\Versions.txt"
goto Done goto Done
@@ -31,6 +31,5 @@ echo Done!
exit /B 0 exit /B 0
:Exit :Exit
rem Restore original directory before exit.
popd popd
exit /B 1 exit /B 1

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "EditorAnalytics.h" #include "EditorAnalytics.h"
#include "EditorAnalyticsController.h" #include "EditorAnalyticsController.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once #pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "EditorAnalyticsController.h" #include "EditorAnalyticsController.h"
#include "Editor/Cooker/GameCooker.h" #include "Editor/Cooker/GameCooker.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once #pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using Newtonsoft.Json; using Newtonsoft.Json;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content.Create namespace FlaxEditor.Content.Create
{ {

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.IO; using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEditor.Content.Settings; using FlaxEditor.Content.Settings;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI; using FlaxEditor.GUI;
using FlaxEditor.GUI.Drag; using FlaxEditor.GUI.Drag;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Drag; using FlaxEditor.GUI.Drag;
using FlaxEditor.SceneGraph; using FlaxEditor.SceneGraph;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content namespace FlaxEditor.Content
{ {

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content.Import namespace FlaxEditor.Content.Import
{ {

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel; using System.ComponentModel;
using System.Reflection; using System.Reflection;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO; using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.IO; using System.IO;
@@ -58,7 +58,7 @@ namespace FlaxEditor.Content
public override bool OnMouseDoubleClick(Vector2 location, MouseButton button) public override bool OnMouseDoubleClick(Vector2 location, MouseButton button)
{ {
return Item.OnMouseDoubleClick(Item.ScreenToClient(ClientToScreen(location)), button); return Item.OnMouseDoubleClick(Item.PointFromScreen(PointToScreen(location)), button);
} }
} }

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Text; using System.Text;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Text; using System.Text;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PreviewsCache.h" #include "PreviewsCache.h"
#include "Engine/Core/Log.h" #include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once #pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEditor.Windows; using FlaxEditor.Windows;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEditor.Windows; using FlaxEditor.Windows;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.IO; using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEditor.Content.Thumbnails; using FlaxEditor.Content.Thumbnails;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using FlaxEngine; using FlaxEngine;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.IO; using System.IO;

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System; using System;
using System.Threading.Tasks;
using FlaxEditor.Windows; using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets; using FlaxEditor.Windows.Assets;
using FlaxEngine; using FlaxEngine;
@@ -40,5 +41,29 @@ namespace FlaxEditor.Content
if (Editor.CreateAsset(Editor.NewAssetType.CollisionData, outputPath)) if (Editor.CreateAsset(Editor.NewAssetType.CollisionData, outputPath))
throw new Exception("Failed to create new asset."); throw new Exception("Failed to create new asset.");
} }
/// <summary>
/// Create collision data from model.
/// </summary>
/// <param name="model">The associated model.</param>
public void CreateCollisionDataFromModel(Model model)
{
Action<ContentItem> created = contentItem =>
{
var ai = (AssetItem)contentItem;
var cd = FlaxEngine.Content.LoadAsync<CollisionData>(ai.ID);
if (cd == null || cd.WaitForLoaded())
{
Editor.LogError("Failed to load created collision data.");
return;
}
Task.Run(() =>
{
Editor.CookMeshCollision(ai.Path, CollisionDataType.TriangleMesh, model);
});
};
Editor.Instance.Windows.ContentWin.NewItem(this, null, created);
}
} }
} }

Some files were not shown because too many files have changed in this diff Show More