Refactor engine to support double-precision vectors
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
#if USE_LARGE_WORLDS
|
||||
using Real = System.Double;
|
||||
#else
|
||||
using Real = System.Single;
|
||||
#endif
|
||||
|
||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
@@ -89,7 +95,7 @@ namespace FlaxEditor.SceneGraph
|
||||
/// <param name="distance">The result distance.</param>
|
||||
/// <param name="flags">The raycasting flags.</param>
|
||||
/// <returns>Hit object or null if there is no intersection at all.</returns>
|
||||
public SceneGraphNode RayCast(ref Ray ray, ref Ray view, out float distance, RayCastData.FlagTypes flags = RayCastData.FlagTypes.None)
|
||||
public SceneGraphNode RayCast(ref Ray ray, ref Ray view, out Real distance, RayCastData.FlagTypes flags = RayCastData.FlagTypes.None)
|
||||
{
|
||||
var data = new RayCastData
|
||||
{
|
||||
@@ -109,7 +115,7 @@ namespace FlaxEditor.SceneGraph
|
||||
/// <param name="normal">The result intersection surface normal vector.</param>
|
||||
/// <param name="flags">The raycasting flags.</param>
|
||||
/// <returns>Hit object or null if there is no intersection at all.</returns>
|
||||
public SceneGraphNode RayCast(ref Ray ray, ref Ray view, out float distance, out Vector3 normal, RayCastData.FlagTypes flags = RayCastData.FlagTypes.None)
|
||||
public SceneGraphNode RayCast(ref Ray ray, ref Ray view, out Real distance, out Vector3 normal, RayCastData.FlagTypes flags = RayCastData.FlagTypes.None)
|
||||
{
|
||||
var data = new RayCastData
|
||||
{
|
||||
@@ -131,7 +137,7 @@ namespace FlaxEditor.SceneGraph
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool RayCastSelf(ref RayCastData ray, out float distance, out Vector3 normal)
|
||||
public override bool RayCastSelf(ref RayCastData ray, out Real distance, out Vector3 normal)
|
||||
{
|
||||
distance = 0;
|
||||
normal = Vector3.Up;
|
||||
|
||||
Reference in New Issue
Block a user