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

View File

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

View File

@@ -330,8 +330,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
// Programmatically set the line number after all the material inputs which have a variable number of line endings
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
// Fix line for errors/warnings for shader code from template
#line 1000
// 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
distortion *= 4.0f;
// Store positive and negative offsets separately
// Use separate storage for positive and negative offsets
float2 addOffset = max(distortion, 0);
float2 subOffset = abs(min(distortion, 0));
return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y);

View File

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

View File

@@ -340,8 +340,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
// Programmatically set the line number after all the material inputs which have a variable number of line endings
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
// Fix line for errors/warnings for shader code from template
#line 1000
// 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)
float3x4 CalcBoneMatrix(ModelInput_Skinned input)
float3x4 GetBoneMatrix(ModelInput_Skinned input)
{
float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x);
boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y);
@@ -549,7 +548,7 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
// Perform skinning
SkinningData data;
data.BlendMatrix = CalcBoneMatrix(input);
data.BlendMatrix = GetBoneMatrix(input);
float3 position = SkinPosition(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
INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
// Precompute squares and squares * 3
float UU = U * U;
float VV = V * V;
float WW = W * W;

View File

@@ -337,8 +337,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
// Programmatically set the line number after all the material inputs which have a variable number of line endings
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
// Fix line for errors/warnings for shader code from template
#line 1000
// 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)
float3x4 CalcBoneMatrix(ModelInput_Skinned input)
float3x4 GetBoneMatrix(ModelInput_Skinned input)
{
float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x);
boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y);
@@ -521,7 +520,7 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
// Perform skinning
SkinningData data;
data.BlendMatrix = CalcBoneMatrix(input);
data.BlendMatrix = GetBoneMatrix(input);
float3 position = SkinPosition(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
INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
// Precompute squares and squares * 3
float UU = U * U;
float VV = V * V;
float WW = W * W;
@@ -978,7 +976,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
distortion *= 4.0f;
// Store positive and negative offsets separately
// Use separate storage for positive and negative offsets
float2 addOffset = max(distortion, 0);
float2 subOffset = abs(min(distortion, 0));
return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y);

View File

@@ -234,8 +234,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
// Programmatically set the line number after all the material inputs which have a variable number of line endings
// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
// Fix line for errors/warnings for shader code from template
#line 1000
// 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
INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
// Precompute squares and squares * 3
float UU = U * U;
float VV = V * V;
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
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.",
"Copyright": "Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.",
"GameTarget": "FlaxGame",
"EditorTarget": "FlaxEditor"
}

View File

@@ -6,34 +6,18 @@ setlocal
pushd
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)
call "Development\Scripts\Windows\CallBuildTool.bat" -genproject %*
if errorlevel 1 goto Error_BuildToolFailed
if errorlevel 1 goto BuildToolFailed
rem Done.
popd
echo Done!
exit /B 0
:Error_BatchFileInWrongLocation
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.
:BuildToolFailed
echo Flax.Build tool failed.
echo.
pause
goto Exit
:Exit
rem Restore original directory before exit.
popd
exit /B 1

View File

@@ -6,32 +6,18 @@ setlocal
pushd
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.
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
echo Done!
exit /B 0
:Error_BatchFileInWrongLocation
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.
:BuildToolFailed
echo Flax.Build tool failed.
echo.
goto Exit
:Exit
rem Restore original directory before exit.
popd
exit /B 1

View File

@@ -6,32 +6,18 @@ setlocal
pushd
echo Building and packaging Flax Editor...
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 the build tool.
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
echo Done!
exit /B 0
:Error_BatchFileInWrongLocation
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.
:BuildToolFailed
echo Flax.Build tool failed.
echo.
goto Exit
:Exit
rem Restore original directory before exit.
popd
exit /B 1

View File

@@ -6,32 +6,18 @@ setlocal
pushd
echo Building and packaging platforms data...
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 the build tool.
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
echo Done!
exit /B 0
:Error_BatchFileInWrongLocation
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.
:BuildToolFailed
echo Flax.Build tool failed.
echo.
goto Exit
:Exit
rem Restore original directory before exit.
popd
exit /B 1

View File

@@ -14,12 +14,12 @@ if not exist "%appdata%\Flax\Versions.txt" (
)
set EngineLocation=%cd%
find /c "%EngineLocation%" "%appdata%\Flax\Versions.txt"
if %errorlevel% equ 1 goto notfound
if %errorlevel% equ 1 goto NotFound
echo Already registered.
goto Done
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 %EngineLocation%>>"%appdata%\Flax\Versions.txt"
goto Done
@@ -31,6 +31,5 @@ echo Done!
exit /B 0
:Exit
rem Restore original directory before exit.
popd
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 "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

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 "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

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 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
{

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.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.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 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 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.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.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.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
{

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
{

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.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;

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.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.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.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;

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.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.IO;
@@ -58,7 +58,7 @@ namespace FlaxEditor.Content
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.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;

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.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.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;

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;

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 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;

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 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 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;

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;

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.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 "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;

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

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 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 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.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 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.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 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.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.Threading.Tasks;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
@@ -40,5 +41,29 @@ namespace FlaxEditor.Content
if (Editor.CreateAsset(Editor.NewAssetType.CollisionData, outputPath))
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