Fix build regression from #2299

This commit is contained in:
Wojtek Figat
2024-03-04 21:30:04 +01:00
parent 0604a0393d
commit e4583907e2
2 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,11 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#if USE_LARGE_WORLDS
using Real = System.Double;
#else
using Real = System.Single;
#endif
using System;
using System.Collections.Generic;
using FlaxEditor.Content;
@@ -24,9 +30,8 @@ namespace FlaxEditor.SceneGraph.Actors
{
}
/// <inheritdoc />
public override bool OnVertexSnap(ref Ray ray, float hitDistance, out Vector3 result)
public override bool OnVertexSnap(ref Ray ray, Real hitDistance, out Vector3 result)
{
// Find the closest vertex to bounding box point (collision detection approximation)
result = ray.GetPoint(hitDistance);
@@ -37,7 +42,7 @@ namespace FlaxEditor.SceneGraph.Actors
if (_vertices == null)
_vertices = new();
var pointLocal = (Float3)Actor.Transform.WorldToLocal(result);
var minDistance = float.MaxValue;
var minDistance = Real.MaxValue;
var lodIndex = 0; // TODO: use LOD index based on the game view
var lod = model.LODs[lodIndex];
{

View File

@@ -359,7 +359,7 @@ namespace FlaxEditor.SceneGraph
/// <param name="hitDistance">Hit distance from ray to object bounding box.</param>
/// <param name="result">The result point on the object mesh that is closest to the specified location.</param>
/// <returns>True if got a valid result value, otherwise false (eg. if missing data or not initialized).</returns>
public virtual bool OnVertexSnap(ref Ray ray, float hitDistance, out Vector3 result)
public virtual bool OnVertexSnap(ref Ray ray, Real hitDistance, out Vector3 result)
{
result = Vector3.Zero;
return false;