Files
FlaxEngine/Source/Editor/SceneGraph/Actors/CameraNode.cs
Wojciech Figat 93f0b0e2e8 Fix type usage
2022-12-19 10:10:26 +01:00

42 lines
1.1 KiB
C#

// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
#if USE_LARGE_WORLDS
using Real = System.Double;
#else
using Real = System.Single;
#endif
using FlaxEngine;
namespace FlaxEditor.SceneGraph.Actors
{
/// <summary>
/// Scene tree node for <see cref="Camera"/> actor type.
/// </summary>
/// <seealso cref="ActorNode" />
[HideInEditor]
public sealed class CameraNode : ActorNode
{
/// <inheritdoc />
public CameraNode(Actor actor)
: base(actor)
{
}
/// <inheritdoc />
public override bool RayCastSelf(ref RayCastData ray, out Real distance, out Vector3 normal)
{
normal = Vector3.Up;
// Check if skip raycasts
if ((ray.Flags & RayCastData.FlagTypes.SkipEditorPrimitives) == RayCastData.FlagTypes.SkipEditorPrimitives)
{
distance = 0;
return false;
}
return Camera.Internal_IntersectsItselfEditor(FlaxEngine.Object.GetUnmanagedPtr(_actor), ref ray.Ray, out distance);
}
}
}