diff --git a/Source/Engine/Core/Types/Variant.h b/Source/Engine/Core/Types/Variant.h index 5c057bc65..da00d1b62 100644 --- a/Source/Engine/Core/Types/Variant.h +++ b/Source/Engine/Core/Types/Variant.h @@ -69,10 +69,12 @@ API_STRUCT(InBuild) struct FLAXENGINE_API VariantType MAX, #if USE_LARGE_WORLDS + Real = Double, Vector2 = Double2, Vector3 = Double3, Vector4 = Double4, #else + Real = Float, Vector2 = Float2, Vector3 = Float3, Vector4 = Float4, diff --git a/Source/Engine/Foliage/Foliage.cpp b/Source/Engine/Foliage/Foliage.cpp index 459f1b662..1fe9e39a9 100644 --- a/Source/Engine/Foliage/Foliage.cpp +++ b/Source/Engine/Foliage/Foliage.cpp @@ -198,7 +198,7 @@ void Foliage::DrawCluster(DrawContext& context, FoliageCluster* cluster, DrawCal sphere.Center -= context.ViewOrigin; if (Float3::Distance(context.LodView.Position, sphere.Center) - (float)sphere.Radius < instance.CullDistance && context.RenderContext.View.CullingFrustum.Intersects(sphere) && - RenderTools::ComputeBoundsScreenRadiusSquared(sphere.Center, sphere.Radius, context.RenderContext.View) * context.ViewScreenSizeSq >= context.MinObjectPixelSizeSq) + RenderTools::ComputeBoundsScreenRadiusSquared(sphere.Center, (float)sphere.Radius, context.RenderContext.View) * context.ViewScreenSizeSq >= context.MinObjectPixelSizeSq) { const auto modelFrame = instance.DrawState.PrevFrame + 1; diff --git a/Source/Engine/Level/Actors/Spline.cpp b/Source/Engine/Level/Actors/Spline.cpp index d6c2417c8..271609396 100644 --- a/Source/Engine/Level/Actors/Spline.cpp +++ b/Source/Engine/Level/Actors/Spline.cpp @@ -507,7 +507,7 @@ namespace return; Spline::Keyframe* prev = spline->Curve.GetKeyframes().Get(); Vector3 prevPos = transform.LocalToWorld(prev->Value.Translation); - float distance = Vector3::Distance(prevPos, DebugDraw::GetViewPos()); + Real distance = Vector3::Distance(prevPos, DebugDraw::GetViewPos()); if (distance < METERS_TO_UNITS(800)) // 800m { // Bezier curve diff --git a/Source/Engine/Renderer/GBufferPass.cpp b/Source/Engine/Renderer/GBufferPass.cpp index e62970f83..6b3a655c0 100644 --- a/Source/Engine/Renderer/GBufferPass.cpp +++ b/Source/Engine/Renderer/GBufferPass.cpp @@ -425,7 +425,7 @@ void GBufferPass::DrawSky(RenderContext& renderContext, GPUContext* context) BoundingSphere frustumBounds; renderContext.View.CullingFrustum.GetSphere(frustumBounds); origin = frustumBounds.Center; - size = frustumBounds.Radius; + size = (float)frustumBounds.Radius; } Matrix::Scaling(size / ((float)box.GetSize().Y * 0.5f) * 0.95f, m1); // Scale to fit whole view frustum Matrix::CreateWorld(origin, Float3::Up, Float3::Backward, m2); // Rotate sphere model diff --git a/Source/Engine/Renderer/RenderList.cpp b/Source/Engine/Renderer/RenderList.cpp index 2bb206d6e..8f28977eb 100644 --- a/Source/Engine/Renderer/RenderList.cpp +++ b/Source/Engine/Renderer/RenderList.cpp @@ -704,7 +704,7 @@ void RenderList::AddDrawCall(const RenderContextBatch& renderContextBatch, DrawP if (drawModes != DrawPass::None && (staticFlags & renderContext.View.StaticFlagsMask) == renderContext.View.StaticFlagsCompare && renderContext.View.CullingFrustum.Intersects(bounds) && - RenderTools::ComputeBoundsScreenRadiusSquared(bounds.Center, bounds.Radius, renderContext.View) * (renderContext.View.ScreenSize.X * renderContext.View.ScreenSize.Y) >= minObjectPixelSizeSq) + RenderTools::ComputeBoundsScreenRadiusSquared(bounds.Center, (float)bounds.Radius, renderContext.View) * (renderContext.View.ScreenSize.X * renderContext.View.ScreenSize.Y) >= minObjectPixelSizeSq) { renderContext.List->ShadowDepthDrawCallsList.Indices.Add(index); } diff --git a/Source/Engine/Tools/ModelTool/ModelTool.cpp b/Source/Engine/Tools/ModelTool/ModelTool.cpp index e3da92da2..977ddb947 100644 --- a/Source/Engine/Tools/ModelTool/ModelTool.cpp +++ b/Source/Engine/Tools/ModelTool/ModelTool.cpp @@ -443,7 +443,7 @@ bool ModelTool::GenerateModelSDF(Model* inputModel, const ModelData* modelData, minDistance *= -1; // Voxel is inside the geometry so turn it into negative distance to the surface const int32 xAddress = x + yAddress; - formatWrite(voxels.Get() + xAddress * formatStride, minDistance * encodeMAD.X + encodeMAD.Y); + formatWrite(voxels.Get() + xAddress * formatStride, (float)minDistance * encodeMAD.X + encodeMAD.Y); } } }; diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index eb4ec604f..3e50670bc 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -230,7 +230,7 @@ namespace Flax.Build.Bindings case "uint32": return "VariantType(VariantType::Uint)"; case "int64": return "VariantType(VariantType::Int64)"; case "uint64": return "VariantType(VariantType::Uint64)"; - case "Real": + case "Real": return "VariantType(VariantType::Real)"; case "float": return "VariantType(VariantType::Float)"; case "double": return "VariantType(VariantType::Double)"; case "StringAnsiView":