Various fixes to allow compiling negine with custom build configurations
This commit is contained in:
@@ -610,6 +610,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
|
|||||||
#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest) DebugDraw::DrawTriangle(v0, v1, v2, color, duration, depthTest)
|
#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest) DebugDraw::DrawTriangle(v0, v1, v2, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, color, duration, depthTest)
|
#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, color, duration, depthTest)
|
#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, color, duration, depthTest)
|
||||||
|
#define DEBUG_DRAW_TRIANGLES_EX2(vertices, indices, transform, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, transform, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest) DebugDraw::DrawSphere(sphere, color, duration, depthTest)
|
#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest) DebugDraw::DrawSphere(sphere, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawTube(position, orientation, radius, length, color, duration, depthTest)
|
#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawTube(position, orientation, radius, length, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_BOX(box, color, duration, depthTest) DebugDraw::DrawBox(box, color, duration, depthTest)
|
#define DEBUG_DRAW_BOX(box, color, duration, depthTest) DebugDraw::DrawBox(box, color, duration, depthTest)
|
||||||
@@ -638,6 +639,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
|
|||||||
#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest)
|
#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest)
|
#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest)
|
#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest)
|
||||||
|
#define DEBUG_DRAW_TRIANGLES_EX2(vertices, indices, transform, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest)
|
#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest)
|
#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest)
|
||||||
#define DEBUG_DRAW_BOX(box, color, duration, depthTest)
|
#define DEBUG_DRAW_BOX(box, color, duration, depthTest)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ void BoxVolume::SetSize(const Vector3& value)
|
|||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
#include "Engine/Debug/DebugDraw.h"
|
#include "Engine/Debug/DebugDraw.h"
|
||||||
|
#include "Engine/Core/Math/Color.h"
|
||||||
|
|
||||||
Color BoxVolume::GetWiresColor()
|
Color BoxVolume::GetWiresColor()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,14 +15,12 @@ class SceneObject;
|
|||||||
/// <seealso cref="JsonAssetBase" />
|
/// <seealso cref="JsonAssetBase" />
|
||||||
API_CLASS(NoSpawn) class FLAXENGINE_API Prefab : public JsonAssetBase
|
API_CLASS(NoSpawn) class FLAXENGINE_API Prefab : public JsonAssetBase
|
||||||
{
|
{
|
||||||
DECLARE_ASSET_HEADER(Prefab);
|
DECLARE_ASSET_HEADER(Prefab);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool _isCreatingDefaultInstance;
|
bool _isCreatingDefaultInstance;
|
||||||
Actor* _defaultInstance;
|
Actor* _defaultInstance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The serialized scene objects amount (actors and scripts).
|
/// The serialized scene objects amount (actors and scripts).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -49,11 +47,9 @@ public:
|
|||||||
Dictionary<Guid, const void*> ObjectsCache;
|
Dictionary<Guid, const void*> ObjectsCache;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the root object identifier (prefab object ID). Asset must be loaded.
|
/// Gets the root object identifier (prefab object ID). Asset must be loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The ID.</returns>
|
|
||||||
Guid GetRootObjectId() const
|
Guid GetRootObjectId() const
|
||||||
{
|
{
|
||||||
ASSERT(IsLoaded());
|
ASSERT(IsLoaded());
|
||||||
@@ -74,7 +70,6 @@ public:
|
|||||||
API_FUNCTION() SceneObject* GetDefaultInstance(API_PARAM(Ref) const Guid& objectId);
|
API_FUNCTION() SceneObject* GetDefaultInstance(API_PARAM(Ref) const Guid& objectId);
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Applies the difference from the prefab object instance, saves the changes and synchronizes them with the active instances of the prefab asset.
|
/// Applies the difference from the prefab object instance, saves the changes and synchronizes them with the active instances of the prefab asset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -83,11 +78,9 @@ public:
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="targetActor">The root actor of spawned prefab instance to use as modified changes sources.</param>
|
/// <param name="targetActor">The root actor of spawned prefab instance to use as modified changes sources.</param>
|
||||||
bool ApplyAll(Actor* targetActor);
|
bool ApplyAll(Actor* targetActor);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
typedef Array<AssetReference<Prefab>> NestedPrefabsList;
|
typedef Array<AssetReference<Prefab>> NestedPrefabsList;
|
||||||
bool ApplyAllInternal(Actor* targetActor, bool linkTargetActorObjectToPrefab);
|
bool ApplyAllInternal(Actor* targetActor, bool linkTargetActorObjectToPrefab);
|
||||||
@@ -99,7 +92,6 @@ private:
|
|||||||
void DeleteDefaultInstance();
|
void DeleteDefaultInstance();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [JsonAssetBase]
|
// [JsonAssetBase]
|
||||||
LoadResult loadAsset() override;
|
LoadResult loadAsset() override;
|
||||||
void unload(bool isReloading) override;
|
void unload(bool isReloading) override;
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if object has a parent assigned.
|
/// Returns true if object has a parent assigned.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if has parent, otherwise false.</returns>
|
|
||||||
API_PROPERTY() FORCE_INLINE bool HasParent() const
|
API_PROPERTY() FORCE_INLINE bool HasParent() const
|
||||||
{
|
{
|
||||||
return _parent != nullptr;
|
return _parent != nullptr;
|
||||||
@@ -114,7 +113,6 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the parent actor (or null if object has no parent).
|
/// Gets the parent actor (or null if object has no parent).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The parent actor.</returns>
|
|
||||||
API_PROPERTY(Attributes="HideInEditor")
|
API_PROPERTY(Attributes="HideInEditor")
|
||||||
FORCE_INLINE Actor* GetParent() const
|
FORCE_INLINE Actor* GetParent() const
|
||||||
{
|
{
|
||||||
@@ -160,7 +158,6 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this object has a valid linkage to the prefab asset.
|
/// Gets a value indicating whether this object has a valid linkage to the prefab asset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if actor has valid prefab link, otherwise false.</returns>
|
|
||||||
API_PROPERTY() FORCE_INLINE bool HasPrefabLink() const
|
API_PROPERTY() FORCE_INLINE bool HasPrefabLink() const
|
||||||
{
|
{
|
||||||
return _prefabID.IsValid();
|
return _prefabID.IsValid();
|
||||||
@@ -169,7 +166,6 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the prefab asset ID. Empty if no prefab link exists.
|
/// Gets the prefab asset ID. Empty if no prefab link exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The prefab asset ID.</returns>
|
|
||||||
API_PROPERTY() FORCE_INLINE Guid GetPrefabID() const
|
API_PROPERTY() FORCE_INLINE Guid GetPrefabID() const
|
||||||
{
|
{
|
||||||
return _prefabID;
|
return _prefabID;
|
||||||
@@ -178,7 +174,6 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the ID of the object within a prefab that is used for synchronization with this object. Empty if no prefab link exists.
|
/// Gets the ID of the object within a prefab that is used for synchronization with this object. Empty if no prefab link exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The prefab object ID.</returns>
|
|
||||||
API_PROPERTY() FORCE_INLINE Guid GetPrefabObjectID() const
|
API_PROPERTY() FORCE_INLINE Guid GetPrefabObjectID() const
|
||||||
{
|
{
|
||||||
return _prefabObjectID;
|
return _prefabObjectID;
|
||||||
|
|||||||
@@ -110,8 +110,10 @@ bool LocalizedStringTable::Save(const StringView& path)
|
|||||||
writer.EndObject();
|
writer.EndObject();
|
||||||
|
|
||||||
// Save asset
|
// Save asset
|
||||||
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
const bool saveResult = CreateJson::Create(path.HasChars() ? path : StringView(GetPath()), outputData, TypeName);
|
const bool saveResult = CreateJson::Create(path.HasChars() ? path : StringView(GetPath()), outputData, TypeName);
|
||||||
if (saveResult)
|
if (saveResult)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
LOG(Error, "Cannot save \'{0}\'", ToString());
|
LOG(Error, "Cannot save \'{0}\'", ToString());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ void NavigationSettings::Apply()
|
|||||||
if (area.Id < DT_MAX_AREAS)
|
if (area.Id < DT_MAX_AREAS)
|
||||||
{
|
{
|
||||||
NavMeshRuntime::NavAreasCosts[area.Id] = area.Cost;
|
NavMeshRuntime::NavAreasCosts[area.Id] = area.Cost;
|
||||||
#if USE_EDITOR
|
#if COMPILE_WITH_DEBUG_DRAW
|
||||||
NavMeshRuntime::NavAreasColors[area.Id] = area.Color;
|
NavMeshRuntime::NavAreasColors[area.Id] = area.Color;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
#include "ParticleEmitterFunction.h"
|
#include "ParticleEmitterFunction.h"
|
||||||
#include "Engine/ShadersCompilation/Config.h"
|
#include "Engine/ShadersCompilation/Config.h"
|
||||||
|
#include "Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h"
|
||||||
#if BUILD_DEBUG
|
#if BUILD_DEBUG
|
||||||
#include "Engine/Engine/Globals.h"
|
#include "Engine/Engine/Globals.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -26,7 +27,6 @@
|
|||||||
#include "Engine/Graphics/Shaders/Cache/ShaderStorage.h"
|
#include "Engine/Graphics/Shaders/Cache/ShaderStorage.h"
|
||||||
#endif
|
#endif
|
||||||
#if COMPILE_WITH_PARTICLE_GPU_GRAPH && COMPILE_WITH_SHADER_COMPILER
|
#if COMPILE_WITH_PARTICLE_GPU_GRAPH && COMPILE_WITH_SHADER_COMPILER
|
||||||
#include "Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h"
|
|
||||||
#include "Engine/Utilities/Encryption.h"
|
#include "Engine/Utilities/Encryption.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ void BoxCollider::SetSize(const Float3& value)
|
|||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
#include "Engine/Debug/DebugDraw.h"
|
#include "Engine/Debug/DebugDraw.h"
|
||||||
|
#include "Engine/Core/Math/Color.h"
|
||||||
#include "Engine/Graphics/RenderView.h"
|
#include "Engine/Graphics/RenderView.h"
|
||||||
|
|
||||||
void BoxCollider::DrawPhysicsDebug(RenderView& view)
|
void BoxCollider::DrawPhysicsDebug(RenderView& view)
|
||||||
@@ -31,9 +32,9 @@ void BoxCollider::DrawPhysicsDebug(RenderView& view)
|
|||||||
if (!view.CullingFrustum.Intersects(sphere))
|
if (!view.CullingFrustum.Intersects(sphere))
|
||||||
return;
|
return;
|
||||||
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
||||||
DebugDraw::DrawBox(_bounds, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
DEBUG_DRAW_BOX(_bounds, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
||||||
else
|
else
|
||||||
DebugDraw::DrawWireBox(_bounds, Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_WIRE_BOX(_bounds, Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoxCollider::OnDebugDraw()
|
void BoxCollider::OnDebugDraw()
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ void CapsuleCollider::DrawPhysicsDebug(RenderView& view)
|
|||||||
const float radius = Math::Max(Math::Abs(_radius) * scaling, minSize);
|
const float radius = Math::Max(Math::Abs(_radius) * scaling, minSize);
|
||||||
const float height = Math::Max(Math::Abs(_height) * scaling, minSize);
|
const float height = Math::Max(Math::Abs(_height) * scaling, minSize);
|
||||||
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
||||||
DebugDraw::DrawTube(_transform.LocalToWorld(_center), rot, radius, height, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
DEBUG_DRAW_TUBE(_transform.LocalToWorld(_center), rot, radius, height, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
||||||
else
|
else
|
||||||
DebugDraw::DrawWireTube(_transform.LocalToWorld(_center), rot, radius, height, Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_WIRE_TUBE(_transform.LocalToWorld(_center), rot, radius, height, Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CapsuleCollider::OnDebugDrawSelected()
|
void CapsuleCollider::OnDebugDrawSelected()
|
||||||
|
|||||||
@@ -179,9 +179,9 @@ void CharacterController::DrawPhysicsDebug(RenderView& view)
|
|||||||
const float radius = Math::Max(Math::Abs(_radius) * scaling, minSize);
|
const float radius = Math::Max(Math::Abs(_radius) * scaling, minSize);
|
||||||
const float height = Math::Max(Math::Abs(_height) * scaling, minSize);
|
const float height = Math::Max(Math::Abs(_height) * scaling, minSize);
|
||||||
if (view.Mode == ViewMode::PhysicsColliders)
|
if (view.Mode == ViewMode::PhysicsColliders)
|
||||||
DebugDraw::DrawTube(_transform.LocalToWorld(_center), Quaternion::Euler(90, 0, 0), radius, height, Color::LightYellow, 0, true);
|
DEBUG_DRAW_TUBE(_transform.LocalToWorld(_center), Quaternion::Euler(90, 0, 0), radius, height, Color::LightYellow, 0, true);
|
||||||
else
|
else
|
||||||
DebugDraw::DrawWireTube(_transform.LocalToWorld(_center), Quaternion::Euler(90, 0, 0), radius, height, Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_WIRE_TUBE(_transform.LocalToWorld(_center), Quaternion::Euler(90, 0, 0), radius, height, Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterController::OnDebugDrawSelected()
|
void CharacterController::OnDebugDrawSelected()
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ void MeshCollider::DrawPhysicsDebug(RenderView& view)
|
|||||||
Array<Float3>* vertexBuffer;
|
Array<Float3>* vertexBuffer;
|
||||||
Array<int32>* indexBuffer;
|
Array<int32>* indexBuffer;
|
||||||
CollisionData->GetDebugTriangles(vertexBuffer, indexBuffer);
|
CollisionData->GetDebugTriangles(vertexBuffer, indexBuffer);
|
||||||
DebugDraw::DrawTriangles(*vertexBuffer, *indexBuffer, _transform.GetWorld(), _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
DEBUG_DRAW_TRIANGLES_EX2(*vertexBuffer, *indexBuffer, _transform.GetWorld(), _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DebugDraw::DrawLines(CollisionData->GetDebugLines(), _transform.GetWorld(), Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_LINES(CollisionData->GetDebugLines(), _transform.GetWorld(), Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ void SphereCollider::DrawPhysicsDebug(RenderView& view)
|
|||||||
if (!view.CullingFrustum.Intersects(sphere))
|
if (!view.CullingFrustum.Intersects(sphere))
|
||||||
return;
|
return;
|
||||||
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
||||||
DebugDraw::DrawSphere(_sphere, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
DEBUG_DRAW_SPHERE(_sphere, _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
||||||
else
|
else
|
||||||
DebugDraw::DrawWireSphere(_sphere, Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_WIRE_SPHERE(_sphere, Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SphereCollider::OnDebugDrawSelected()
|
void SphereCollider::OnDebugDrawSelected()
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ void SplineCollider::DrawPhysicsDebug(RenderView& view)
|
|||||||
if (!view.CullingFrustum.Intersects(sphere))
|
if (!view.CullingFrustum.Intersects(sphere))
|
||||||
return;
|
return;
|
||||||
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
||||||
DebugDraw::DrawTriangles(_vertexBuffer, _indexBuffer, Color::CornflowerBlue, 0, true);
|
DEBUG_DRAW_WIRE_TRIANGLES_EX(_vertexBuffer, _indexBuffer, Color::CornflowerBlue, 0, true);
|
||||||
else
|
else
|
||||||
DebugDraw::DrawWireTriangles(_vertexBuffer, _indexBuffer, Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_WIRE_TRIANGLES_EX(_vertexBuffer, _indexBuffer, Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplineCollider::OnDebugDrawSelected()
|
void SplineCollider::OnDebugDrawSelected()
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ void D6Joint::OnDebugDrawSelected()
|
|||||||
const float twistSize = 9.0f;
|
const float twistSize = 9.0f;
|
||||||
const Color swingColor = Color::Green.AlphaMultiplied(0.6f);
|
const Color swingColor = Color::Green.AlphaMultiplied(0.6f);
|
||||||
const Color twistColor = Color::Yellow.AlphaMultiplied(0.5f);
|
const Color twistColor = Color::Yellow.AlphaMultiplied(0.5f);
|
||||||
DebugDraw::DrawWireArrow(target, targetRotation, swingSize / 100.0f * 0.5f, Color::Red, 0, false);
|
DEBUG_DRAW_WIRE_ARROW(target, targetRotation, swingSize / 100.0f * 0.5f, Color::Red, 0, false);
|
||||||
if (_motion[(int32)D6JointAxis::SwingY] == D6JointMotion::Locked && _motion[(int32)D6JointAxis::SwingZ] == D6JointMotion::Locked)
|
if (_motion[(int32)D6JointAxis::SwingY] == D6JointMotion::Locked && _motion[(int32)D6JointAxis::SwingZ] == D6JointMotion::Locked)
|
||||||
{
|
{
|
||||||
// Swing is locked
|
// Swing is locked
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ float HingeJoint::GetCurrentVelocity() const
|
|||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
#include "Engine/Debug/DebugDraw.h"
|
#include "Engine/Debug/DebugDraw.h"
|
||||||
|
#include "Engine/Core/Math/Color.h"
|
||||||
|
|
||||||
void HingeJoint::OnDebugDrawSelected()
|
void HingeJoint::OnDebugDrawSelected()
|
||||||
{
|
{
|
||||||
@@ -62,8 +63,8 @@ void HingeJoint::OnDebugDrawSelected()
|
|||||||
const Quaternion targetRotation = GetTargetOrientation() * xRotation;
|
const Quaternion targetRotation = GetTargetOrientation() * xRotation;
|
||||||
const float size = 15.0f;
|
const float size = 15.0f;
|
||||||
const Color color = Color::Green.AlphaMultiplied(0.6f);
|
const Color color = Color::Green.AlphaMultiplied(0.6f);
|
||||||
DebugDraw::DrawWireArrow(source, sourceRotation, size / 100.0f * 0.5f, Color::Red, 0, false);
|
DEBUG_DRAW_WIRE_ARROW(source, sourceRotation, size / 100.0f * 0.5f, Color::Red, 0, false);
|
||||||
DebugDraw::DrawWireArrow(target, targetRotation, size / 100.0f * 0.5f, Color::Blue, 0, false);
|
DEBUG_DRAW_WIRE_ARROW(target, targetRotation, size / 100.0f * 0.5f, Color::Blue, 0, false);
|
||||||
if (_flags & HingeJointFlag::Limit)
|
if (_flags & HingeJointFlag::Limit)
|
||||||
{
|
{
|
||||||
const float upper = Math::Max(_limit.Upper, _limit.Lower);
|
const float upper = Math::Max(_limit.Upper, _limit.Lower);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ void SphericalJoint::SetLimit(const LimitConeRange& value)
|
|||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
#include "Engine/Debug/DebugDraw.h"
|
#include "Engine/Debug/DebugDraw.h"
|
||||||
|
#include "Engine/Core/Math/Color.h"
|
||||||
|
|
||||||
void SphericalJoint::OnDebugDrawSelected()
|
void SphericalJoint::OnDebugDrawSelected()
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,7 @@ void SphericalJoint::OnDebugDrawSelected()
|
|||||||
const Vector3 target = GetTargetPosition();
|
const Vector3 target = GetTargetPosition();
|
||||||
const float size = 15.0f;
|
const float size = 15.0f;
|
||||||
const Color color = Color::Green.AlphaMultiplied(0.6f);
|
const Color color = Color::Green.AlphaMultiplied(0.6f);
|
||||||
DebugDraw::DrawWireArrow(source, GetOrientation(), size / 100.0f * 0.5f, Color::Red, 0, false);
|
DEBUG_DRAW_WIRE_ARROW(source, GetOrientation(), size / 100.0f * 0.5f, Color::Red, 0, false);
|
||||||
if (_flags & SphericalJointFlag::Limit)
|
if (_flags & SphericalJointFlag::Limit)
|
||||||
{
|
{
|
||||||
DEBUG_DRAW_CONE(source, GetOrientation(), size, _limit.YLimitAngle * DegreesToRadians, _limit.ZLimitAngle * DegreesToRadians, color, 0, false);
|
DEBUG_DRAW_CONE(source, GetOrientation(), size, _limit.YLimitAngle * DegreesToRadians, _limit.ZLimitAngle * DegreesToRadians, color, 0, false);
|
||||||
|
|||||||
@@ -838,7 +838,7 @@ bool TerrainPatch::SetupHeightMap(int32 heightMapLength, const float* heightMap,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if USE_EDITOR
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Import data to the asset file
|
// Import data to the asset file
|
||||||
@@ -897,7 +897,7 @@ bool TerrainPatch::SetupHeightMap(int32 heightMapLength, const float* heightMap,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
if (!useVirtualStorage)
|
if (!useVirtualStorage)
|
||||||
{
|
{
|
||||||
// Import data to the asset file
|
// Import data to the asset file
|
||||||
@@ -1072,7 +1072,7 @@ bool TerrainPatch::SetupSplatMap(int32 index, int32 splatMapLength, const Color3
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if USE_EDITOR
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Import data to the asset file
|
// Import data to the asset file
|
||||||
@@ -1659,7 +1659,7 @@ bool TerrainPatch::ModifySplatMap(int32 index, const Color32* samples, const Int
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if USE_EDITOR
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Prepare asset path for the non-virtual asset
|
// Prepare asset path for the non-virtual asset
|
||||||
@@ -2254,7 +2254,7 @@ void TerrainPatch::DrawPhysicsDebug(RenderView& view)
|
|||||||
|
|
||||||
if (view.Mode == ViewMode::PhysicsColliders)
|
if (view.Mode == ViewMode::PhysicsColliders)
|
||||||
{
|
{
|
||||||
DebugDraw::DrawTriangles(GetCollisionTriangles(), Color::DarkOliveGreen, 0, true);
|
DEBUG_DRAW_TRIANGLES(GetCollisionTriangles(), Color::DarkOliveGreen, 0, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2264,7 +2264,7 @@ void TerrainPatch::DrawPhysicsDebug(RenderView& view)
|
|||||||
{
|
{
|
||||||
if (_debugLines.IsEmpty())
|
if (_debugLines.IsEmpty())
|
||||||
CacheDebugLines();
|
CacheDebugLines();
|
||||||
DebugDraw::DrawLines(_debugLines, world, Color::GreenYellow * 0.8f, 0, true);
|
DEBUG_DRAW_LINES(_debugLines, world, Color::GreenYellow * 0.8f, 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,7 +390,8 @@ bool ModelTool::ImportData(const String& path, ImportedModelData& data, Options&
|
|||||||
if (ImportDataOpenFBX(importPath.Get(), data, options, errorMsg))
|
if (ImportDataOpenFBX(importPath.Get(), data, options, errorMsg))
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
#error Cannot use Model Tool without any importing backend!
|
LOG(Error, "Compiled without model importing backend.");
|
||||||
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Remove temporary file
|
// Remove temporary file
|
||||||
@@ -809,6 +810,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
|
|||||||
} while (importedFileNames.Contains(filename));
|
} while (importedFileNames.Contains(filename));
|
||||||
}
|
}
|
||||||
importedFileNames.Add(filename);
|
importedFileNames.Add(filename);
|
||||||
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
auto assetPath = autoImportOutput / filename + ASSET_FILES_EXTENSION_WITH_DOT;
|
auto assetPath = autoImportOutput / filename + ASSET_FILES_EXTENSION_WITH_DOT;
|
||||||
TextureTool::Options textureOptions;
|
TextureTool::Options textureOptions;
|
||||||
switch (texture.Type)
|
switch (texture.Type)
|
||||||
@@ -825,6 +827,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
|
|||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
AssetsImportingManager::ImportIfEdited(texture.FilePath, assetPath, texture.AssetID, &textureOptions);
|
AssetsImportingManager::ImportIfEdited(texture.FilePath, assetPath, texture.AssetID, &textureOptions);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare material
|
// Prepare material
|
||||||
@@ -854,6 +857,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
|
|||||||
} while (importedFileNames.Contains(filename));
|
} while (importedFileNames.Contains(filename));
|
||||||
}
|
}
|
||||||
importedFileNames.Add(filename);
|
importedFileNames.Add(filename);
|
||||||
|
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||||
auto assetPath = autoImportOutput / filename + ASSET_FILES_EXTENSION_WITH_DOT;
|
auto assetPath = autoImportOutput / filename + ASSET_FILES_EXTENSION_WITH_DOT;
|
||||||
CreateMaterial::Options materialOptions;
|
CreateMaterial::Options materialOptions;
|
||||||
materialOptions.Diffuse.Color = material.Diffuse.Color;
|
materialOptions.Diffuse.Color = material.Diffuse.Color;
|
||||||
@@ -873,6 +877,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
|
|||||||
if (!Math::IsOne(material.Opacity.Value) || material.Opacity.TextureIndex != -1)
|
if (!Math::IsOne(material.Opacity.Value) || material.Opacity.TextureIndex != -1)
|
||||||
materialOptions.Info.BlendMode = MaterialBlendMode::Transparent;
|
materialOptions.Info.BlendMode = MaterialBlendMode::Transparent;
|
||||||
AssetsImportingManager::Create(AssetsImportingManager::CreateMaterialTag, assetPath, material.AssetID, &materialOptions);
|
AssetsImportingManager::Create(AssetsImportingManager::CreateMaterialTag, assetPath, material.AssetID, &materialOptions);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare import transformation
|
// Prepare import transformation
|
||||||
@@ -953,6 +958,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
|
|||||||
}
|
}
|
||||||
if (collisionModel.LODs.HasItems())
|
if (collisionModel.LODs.HasItems())
|
||||||
{
|
{
|
||||||
|
#if COMPILE_WITH_PHYSICS_COOKING
|
||||||
// Create collision
|
// Create collision
|
||||||
CollisionCooking::Argument arg;
|
CollisionCooking::Argument arg;
|
||||||
arg.Type = CollisionDataType::TriangleMesh;
|
arg.Type = CollisionDataType::TriangleMesh;
|
||||||
@@ -962,6 +968,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
|
|||||||
{
|
{
|
||||||
LOG(Error, "Failed to create collision mesh.");
|
LOG(Error, "Failed to create collision mesh.");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user