Minor fixes and improvements
This commit is contained in:
@@ -884,6 +884,8 @@ namespace FlaxEditor.Modules
|
||||
return;
|
||||
var folder = node.Folder;
|
||||
var path = folder.Path;
|
||||
if (!Directory.Exists(path))
|
||||
return;
|
||||
var canHaveAssets = node.CanHaveAssets;
|
||||
|
||||
if (_isDuringFastSetup)
|
||||
|
||||
@@ -95,6 +95,8 @@ namespace FlaxEditor.SceneGraph
|
||||
return;
|
||||
|
||||
// Check if it has parent
|
||||
if (actor.Parent == null)
|
||||
return;
|
||||
var parentNode = SceneGraphFactory.FindNode(actor.Parent.ID) as ActorNode;
|
||||
if (parentNode == null)
|
||||
return;
|
||||
|
||||
@@ -165,8 +165,8 @@ inline Span<U> ToSpan(const Array<T, AllocationType>& data)
|
||||
return Span<U>((U*)data.Get(), data.Count());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline bool SpanContains(const Span<T> span, const T& value)
|
||||
template<typename T, typename ComparableType = T>
|
||||
inline bool SpanContains(const Span<T> span, const ComparableType& value)
|
||||
{
|
||||
for (int32 i = 0; i < span.Length(); i++)
|
||||
{
|
||||
|
||||
@@ -798,7 +798,7 @@ public:
|
||||
/// Tries to find the actor of the given type in this actor hierarchy (checks this actor and all children hierarchy).
|
||||
/// </summary>
|
||||
/// <param name="type">Type of the actor to search for. Includes any actors derived from the type. Supports interface types.</param>
|
||||
/// <param name="activeOnly">Finds only a active actor.</param>
|
||||
/// <param name="activeOnly">Finds only an active actor.</param>
|
||||
/// <returns>Actor instance if found, null otherwise.</returns>
|
||||
API_FUNCTION() Actor* FindActor(API_PARAM(Attributes="TypeReference(typeof(Actor))") const MClass* type, bool activeOnly = false) const;
|
||||
|
||||
@@ -822,33 +822,36 @@ public:
|
||||
/// <summary>
|
||||
/// Tries to find the actor of the given type in this actor hierarchy (checks this actor and all children hierarchy).
|
||||
/// </summary>
|
||||
/// <param name="activeOnly">Finds only an active actor.</param>
|
||||
/// <returns>Actor instance if found, null otherwise.</returns>
|
||||
template<typename T>
|
||||
FORCE_INLINE T* FindActor() const
|
||||
FORCE_INLINE T* FindActor(bool activeOnly = false) const
|
||||
{
|
||||
return (T*)FindActor(T::GetStaticClass());
|
||||
return (T*)FindActor(T::GetStaticClass(), activeOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to find the actor of the given type and name in this actor hierarchy (checks this actor and all children hierarchy).
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the actor.</param>
|
||||
/// <param name="activeOnly">Finds only an active actor.</param>
|
||||
/// <returns>Actor instance if found, null otherwise.</returns>
|
||||
template<typename T>
|
||||
FORCE_INLINE T* FindActor(const StringView& name) const
|
||||
FORCE_INLINE T* FindActor(const StringView& name, bool activeOnly = false) const
|
||||
{
|
||||
return (T*)FindActor(T::GetStaticClass(), name);
|
||||
return (T*)FindActor(T::GetStaticClass(), name, activeOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to find the actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy).
|
||||
/// </summary>
|
||||
/// <param name="tag">The tag of the actor to search for.</param>
|
||||
/// <param name="activeOnly">Finds only an active actor.</param>
|
||||
/// <returns>Actor instance if found, null otherwise.</returns>
|
||||
template<typename T>
|
||||
FORCE_INLINE T* FindActor(const Tag& tag) const
|
||||
FORCE_INLINE T* FindActor(const Tag& tag, bool activeOnly = false) const
|
||||
{
|
||||
return (T*)FindActor(T::GetStaticClass(), tag);
|
||||
return (T*)FindActor(T::GetStaticClass(), tag, activeOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -39,70 +39,70 @@ public:
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the point location in 3D (world-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point location (world-space).</returns>
|
||||
API_FUNCTION() Vector3 GetSplinePoint(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the point location in 3D (local-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point location (local-space).</returns>
|
||||
API_FUNCTION() Vector3 GetSplineLocalPoint(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the point rotation in 3D (world-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point rotation (world-space).</returns>
|
||||
API_FUNCTION() Quaternion GetSplineOrientation(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the point rotation in 3D (local-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point rotation (local-space).</returns>
|
||||
API_FUNCTION() Quaternion GetSplineLocalOrientation(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the point scale in 3D (world-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point scale (world-space).</returns>
|
||||
API_FUNCTION() Vector3 GetSplineScale(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the point scale in 3D (local-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point scale (local-space).</returns>
|
||||
API_FUNCTION() Vector3 GetSplineLocalScale(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the transformation in 3D (world-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point transformation (world-space).</returns>
|
||||
API_FUNCTION() Transform GetSplineTransform(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve at the given time and calculates the transformation in 3D (local-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve point transformation (local-space).</returns>
|
||||
API_FUNCTION() Transform GetSplineLocalTransform(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve direction (forward vector, aka position 1st derivative) at the given time in 3D (world-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve direction (world-space).</returns>
|
||||
API_FUNCTION() Vector3 GetSplineDirection(float time) const;
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates the spline curve direction (forward vector, aka position 1st derivative) at the given time in 3D (local-space).
|
||||
/// </summary>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp).</param>
|
||||
/// <param name="time">The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length.</param>
|
||||
/// <returns>The calculated curve direction (local-space).</returns>
|
||||
API_FUNCTION() Vector3 GetSplineLocalDirection(float time) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user