correct spelling mistakes and doc's
Co-Authored-By: Menotdan <32620310+Menotdan@users.noreply.github.com>
This commit is contained in:
@@ -534,13 +534,13 @@ void Quaternion::RotationYawPitchRoll(float yaw, float pitch, float roll, Quater
|
||||
result.Z = cosYawOver2 * cosPitchOver2 * sinRollOver2 - sinYawOver2 * sinPitchOver2 * cosRollOver2;
|
||||
}
|
||||
|
||||
Quaternion Quaternion::GetRotacionFromNormal(const Vector3& InNormal, const Transform& InRefrenceTransform)
|
||||
Quaternion Quaternion::GetRotationFromNormal(const Vector3& InNormal, const Transform& InReferenceTransform)
|
||||
{
|
||||
Float3 up = InRefrenceTransform.GetUp();
|
||||
Float3 up = InReferenceTransform.GetUp();
|
||||
auto dot = Vector3::Dot(InNormal, up);
|
||||
if (Math::NearEqual(Math::Abs(dot), 1))
|
||||
{
|
||||
up = InRefrenceTransform.GetRight();
|
||||
up = InReferenceTransform.GetRight();
|
||||
}
|
||||
return Quaternion::LookRotation(InNormal, up);
|
||||
}
|
||||
|
||||
@@ -1480,13 +1480,13 @@ namespace FlaxEngine
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets rotacion for normal in relation to transform<br/>
|
||||
/// Funcion especially created for aligned with axis aligned faces
|
||||
/// use full with <seealso cref="Physics.RayCast"/>
|
||||
/// Gets rotation from a normal in relation to a transform.<br/>
|
||||
/// This function is especially useful for axis aligned faces,
|
||||
/// and with <seealso cref="Physics.RayCast(Vector3, Vector3, out RayCastHit, float, uint, bool)"/>.
|
||||
///
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> GetRotacionFromNormalExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see langword="class" /> GetRotationFromNormalExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see cref="Actor"/> RayOrgin;<br/>
|
||||
/// <see langword="public" /> <see cref="Actor"/> SomeObject;<br/>
|
||||
/// <see langword="public" /> <see langword="override" /> <see langword="void" /> <see cref="Script.OnFixedUpdate"/><br/>
|
||||
@@ -1497,7 +1497,7 @@ namespace FlaxEngine
|
||||
/// <see cref="Transform"/> transform = Hit.Collider.Transform;
|
||||
/// <see cref="Vector3"/> point = Hit.Point;
|
||||
/// <see cref="Vector3"/> normal = Hit.Normal;
|
||||
/// <see cref="Quaternion"/> rot = <see cref="Quaternion"/>.GetRotacionFromNormal(normal,transform);
|
||||
/// <see cref="Quaternion"/> rot = <see cref="Quaternion"/>.GetRotationFromNormal(normal,transform);
|
||||
/// SomeObject.Position = point;
|
||||
/// SomeObject.Orientation = rot;
|
||||
/// }
|
||||
@@ -1506,18 +1506,18 @@ namespace FlaxEngine
|
||||
/// </code>
|
||||
/// </example>
|
||||
/// </summary>
|
||||
/// <param name="InNormal">the normal vector</param>
|
||||
/// <param name="InRefrenceTransform">relative to</param>
|
||||
/// <returns>normal as rotacion</returns>
|
||||
public static Quaternion GetRotacionFromNormal(Vector3 InNormal, Transform InRefrenceTransform)
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InReferenceTransform">The reference transform.</param>
|
||||
/// <returns>The rotation from the normal vector.</returns>
|
||||
public static Quaternion GetRotationFromNormal(Vector3 InNormal, Transform InReferenceTransform)
|
||||
{
|
||||
Float3 up = InRefrenceTransform.Up;
|
||||
Float3 up = InReferenceTransform.Up;
|
||||
var dot = Vector3.Dot(InNormal, up);
|
||||
if (Mathf.NearEqual(Math.Abs(dot), 1))
|
||||
{
|
||||
up = InRefrenceTransform.Right;
|
||||
up = InReferenceTransform.Right;
|
||||
}
|
||||
return Quaternion.LookRotation(InNormal, up);
|
||||
return LookRotation(InNormal, up);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -663,14 +663,14 @@ public:
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets rotacion for normal in relation to transform<br/>
|
||||
/// Funcion especially created for aligned with axis aligned faces
|
||||
/// use full with <seealso cref="Physics::RayCast"/>
|
||||
/// Gets rotation from a normal in relation to a transform.<br/>
|
||||
/// This function is especially useful for axis aligned faces,
|
||||
/// and with <seealso cref="Physics::RayCast"/>.
|
||||
/// </summary>
|
||||
/// <param name="InNormal">the normal vector</param>
|
||||
/// <param name="InRefrenceTransform">relative to</param>
|
||||
/// <returns>normal as rotacion</returns>
|
||||
static Quaternion GetRotacionFromNormal(const Vector3& InNormal, const Transform& InRefrenceTransform);
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InReferenceTransform">The reference transform.</param>
|
||||
/// <returns>The rotation from the normal vector.</returns>
|
||||
static Quaternion GetRotationFromNormal(const Vector3& InNormal, const Transform& InReferenceTransform);
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -253,26 +253,26 @@ void Transform::Lerp(const Transform& t1, const Transform& t2, float amount, Tra
|
||||
Float3::Lerp(t1.Scale, t2.Scale, amount, result.Scale);
|
||||
}
|
||||
|
||||
inline Transform Transform::AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize)
|
||||
inline Transform Transform::AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion::GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion::GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return Transform(Vector3::SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, Vector3(0, 0, InNormalOffset), rot, InGridSize), rot, InReturnScale);
|
||||
}
|
||||
|
||||
inline Transform Transform::AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize)
|
||||
inline Transform Transform::AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion::GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion::GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return Transform(Vector3::SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, Vector3(0, 0, InNormalOffset), rot, InGridSize), rot, Float3::One);
|
||||
}
|
||||
|
||||
inline Transform Transform::AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize)
|
||||
inline Transform Transform::AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion::GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion::GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return Transform(Vector3::SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, InNormalOffset, rot, InGridSize), rot, InReturnScale);
|
||||
}
|
||||
|
||||
inline Transform Transform::AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize)
|
||||
inline Transform Transform::AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion::GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion::GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return Transform(Vector3::SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, InNormalOffset, rot, InGridSize), rot, Float3::One);
|
||||
}
|
||||
|
||||
@@ -478,12 +478,12 @@ namespace FlaxEngine
|
||||
Float3.Lerp(ref start.Scale, ref end.Scale, amount, out result.Scale);
|
||||
}
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// Combines the functions: <br/>
|
||||
/// <see cref="Vector3.SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="Quaternion.GetRotacionFromNormal"/>
|
||||
/// <see cref="Quaternion.GetRotationFromNormal"/>.
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotacionToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotationToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see cref="float"/> Offset = 50.0f;<br/>
|
||||
/// <see langword="public" /> <see cref="Vector3"/> GridSize = <see cref="Vector3.One"/> * 20.0f;<br/>
|
||||
/// <see langword="public" /> <see cref="Actor"/> RayOrgin;<br/>
|
||||
@@ -495,7 +495,7 @@ namespace FlaxEngine
|
||||
/// <see cref="Transform"/> transform = Hit.Collider.Transform;
|
||||
/// <see cref="Vector3"/> point = Hit.Point;
|
||||
/// <see cref="Vector3"/> normal = Hit.Normal;
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotacionToNormalAndSnapToGrid
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotationToNormalAndSnapToGrid
|
||||
/// (
|
||||
/// point,
|
||||
/// normal,
|
||||
@@ -512,24 +512,24 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// <param name="InReturnScale">return scale</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform</returns>
|
||||
public static Transform AlignRotacionToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, float InNormalOffset, Transform InRelativeTo, Float3 InReturnScale, Vector3 InGridSize)
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <param name="InReturnScale">The scale to apply to the transform.</param>
|
||||
/// <returns>The rotated and snapped transform.</returns>
|
||||
public static Transform AlignRotationToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, float InNormalOffset, Transform InRelativeTo, Float3 InReturnScale, Vector3 InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion.GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion.GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return new Transform(Vector3.SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, new Vector3(0, 0, InNormalOffset), rot, InGridSize), rot, InReturnScale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// Combines the functions: <br/>
|
||||
/// <see cref="Vector3.SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="Quaternion.GetRotacionFromNormal"/>
|
||||
/// <see cref="Quaternion.GetRotationFromNormal"/>.
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotacionToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotationToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see cref="float"/> Offset = 50.0f;<br/>
|
||||
/// <see langword="public" /> <see cref="Vector3"/> GridSize = <see cref="Vector3.One"/> * 20.0f;<br/>
|
||||
/// <see langword="public" /> <see cref="Actor"/> RayOrgin;<br/>
|
||||
@@ -541,7 +541,7 @@ namespace FlaxEngine
|
||||
/// <see cref="Transform"/> transform = Hit.Collider.Transform;
|
||||
/// <see cref="Vector3"/> point = Hit.Point;
|
||||
/// <see cref="Vector3"/> normal = Hit.Normal;
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotacionToNormalAndSnapToGrid
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotationToNormalAndSnapToGrid
|
||||
/// (
|
||||
/// point,
|
||||
/// normal,
|
||||
@@ -557,23 +557,23 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform with scale <see cref="Float3.One"/> </returns>
|
||||
public static Transform AlignRotacionToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, float InNormalOffset, Transform InRelativeTo, Vector3 InGridSize)
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <returns>The rotated and snapped transform with scale <see cref="Float3.One"/>.</returns>
|
||||
public static Transform AlignRotationToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, float InNormalOffset, Transform InRelativeTo, Vector3 InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion.GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion.GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return new Transform(Vector3.SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, new Vector3(0, 0, InNormalOffset), rot, InGridSize), rot, Float3.One);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// Combines the functions:<br/>
|
||||
/// <see cref="Vector3.SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="Quaternion.GetRotacionFromNormal"/>
|
||||
/// <see cref="Quaternion.GetRotationFromNormal"/>.
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotacionToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotationToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see cref="Vector3"/> Offset = new Vector3(0, 0, 50f);<br/>
|
||||
/// <see langword="public" /> <see cref="Vector3"/> GridSize = <see cref="Vector3.One"/> * 20.0f;<br/>
|
||||
/// <see langword="public" /> <see cref="Actor"/> RayOrgin;<br/>
|
||||
@@ -585,7 +585,7 @@ namespace FlaxEngine
|
||||
/// <see cref="Transform"/> transform = Hit.Collider.Transform;
|
||||
/// <see cref="Vector3"/> point = Hit.Point;
|
||||
/// <see cref="Vector3"/> normal = Hit.Normal;
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotacionToNormalAndSnapToGrid
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotationToNormalAndSnapToGrid
|
||||
/// (
|
||||
/// point,
|
||||
/// normal,
|
||||
@@ -602,25 +602,24 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// <param name="InReturnScale">return scale</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform</returns>
|
||||
public static Transform AlignRotacionToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, Vector3 InNormalOffset, Transform InRelativeTo, Float3 InReturnScale, Vector3 InGridSize)
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <param name="InReturnScale">The scale to apply to the transform.</param>
|
||||
/// <returns>The rotated and snapped transform.</returns>
|
||||
public static Transform AlignRotationToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, Vector3 InNormalOffset, Transform InRelativeTo, Float3 InReturnScale, Vector3 InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion.GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion.GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return new Transform(Vector3.SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, InNormalOffset, rot, InGridSize), rot, InReturnScale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// Combines the functions:<br/>
|
||||
/// <see cref="Vector3.SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="Quaternion.GetRotacionFromNormal"/>
|
||||
/// <see cref="Quaternion.GetRotationFromNormal"/>.
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotacionToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see langword="class" /> AlignRotationToObjectAndSnapToGridExample : <see cref="Script"/><br/>
|
||||
/// <see langword="public" /> <see cref="Vector3"/> Offset = new Vector3(0, 0, 50f);<br/>
|
||||
/// <see langword="public" /> <see cref="Vector3"/> GridSize = <see cref="Vector3.One"/> * 20.0f;<br/>
|
||||
/// <see langword="public" /> <see cref="Actor"/> RayOrgin;<br/>
|
||||
@@ -632,7 +631,7 @@ namespace FlaxEngine
|
||||
/// <see cref="Transform"/> transform = Hit.Collider.Transform;
|
||||
/// <see cref="Vector3"/> point = Hit.Point;
|
||||
/// <see cref="Vector3"/> normal = Hit.Normal;
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotacionToNormalAndSnapToGrid
|
||||
/// SomeObject.Transform = <see cref="Transform"/>.AlignRotationToNormalAndSnapToGrid
|
||||
/// (
|
||||
/// point,
|
||||
/// normal,
|
||||
@@ -648,14 +647,13 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform with scale <see cref="Float3.One"/> </returns>
|
||||
public static Transform AlignRotacionToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, Vector3 InNormalOffset, Transform InRelativeTo, Vector3 InGridSize)
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <returns>The rotated and snapped transform with scale <see cref="Float3.One"/>.</returns>
|
||||
public static Transform AlignRotationToNormalAndSnapToGrid(Vector3 InPoint, Vector3 InNormal, Vector3 InNormalOffset, Transform InRelativeTo, Vector3 InGridSize)
|
||||
{
|
||||
Quaternion rot = Quaternion.GetRotacionFromNormal(InNormal, InRelativeTo);
|
||||
Quaternion rot = Quaternion.GetRotationFromNormal(InNormal, InRelativeTo);
|
||||
return new Transform(Vector3.SnapToRotatedGridWithOffset(InPoint, InRelativeTo.Translation, InNormalOffset, rot, InGridSize), rot, Float3.One);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,20 +18,20 @@ API_STRUCT() struct FLAXENGINE_API Transform
|
||||
/// <summary>
|
||||
/// The translation vector of the transform.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(10), EditorDisplay(null, \"Position\"), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
Vector3 Translation;
|
||||
API_FIELD(Attributes = "EditorOrder(10), EditorDisplay(null, \"Position\"), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
Vector3 Translation;
|
||||
|
||||
/// <summary>
|
||||
/// The rotation of the transform.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(20), EditorDisplay(null, \"Rotation\"), ValueCategory(Utils.ValueCategory.Angle)")
|
||||
Quaternion Orientation;
|
||||
API_FIELD(Attributes = "EditorOrder(20), EditorDisplay(null, \"Rotation\"), ValueCategory(Utils.ValueCategory.Angle)")
|
||||
Quaternion Orientation;
|
||||
|
||||
/// <summary>
|
||||
/// The scale vector of the transform.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(30), Limit(float.MinValue, float.MaxValue, 0.01f)")
|
||||
Float3 Scale;
|
||||
API_FIELD(Attributes = "EditorOrder(30), Limit(float.MinValue, float.MaxValue, 0.01f)")
|
||||
Float3 Scale;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
@@ -291,63 +291,61 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// <see cref="SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="GetRotacionFromNormal"/>
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// <param name="InReturnScale">return scale</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform</returns>
|
||||
inline static Transform AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// <see cref="SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="GetRotacionFromNormal"/>
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform with scale <see cref="Float3.One"/> </returns>
|
||||
inline static Transform AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// <see cref="SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="GetRotacionFromNormal"/>
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// <param name="InReturnScale">return scale</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform</returns>
|
||||
inline static Transform AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo,const Float3& InReturnScale,const Vector3& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// combines funcions <br/>
|
||||
/// Combines the functions: <br/>
|
||||
/// <see cref="SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="GetRotacionFromNormal"/>
|
||||
/// <see cref="GetRotationFromNormal"/>.
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local grid offset to applay after snaping</param>
|
||||
/// <param name="InNormal">Normal vector</param>
|
||||
/// <param name="InRelativeTo">Realative transform</param>
|
||||
/// InRefrenceTransform
|
||||
/// <returns>rotated and snaped transform with scale <see cref="Float3.One"/> </returns>
|
||||
inline static Transform AlignRotacionToNormalAndSnapToGrid(const Vector3& InPoint,const Vector3& InNormal,const Vector3& InNormalOffset, const Transform& InRelativeTo,const Vector3& InGridSize);
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <param name="InReturnScale">The scale to apply to the transform.</param>
|
||||
/// <returns>The rotated and snapped transform.</returns>
|
||||
static Transform AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// Combines the functions: <br/>
|
||||
/// <see cref="Vector3.SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="Quaternion.GetRotationFromNormal"/>.
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <returns>The rotated and snapped transform with scale <see cref="Float3.One"/>.</returns>
|
||||
static Transform AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, float InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// Combines the functions: <br/>
|
||||
/// <see cref="SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="GetRotationFromNormal"/>.
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <param name="InReturnScale">The scale to apply to the transform.</param>
|
||||
/// <returns>The rotated and snapped transform.</returns>
|
||||
static Transform AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo, const Float3& InReturnScale, const Vector3& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// Combines the functions: <br/>
|
||||
/// <see cref="Vector3.SnapToRotatedGridWithOffset"/>,<br/>
|
||||
/// <see cref="Quaternion.GetRotationFromNormal"/>.
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InNormalOffset">The local Z grid offset to apply after snapping.</param>
|
||||
/// <param name="InNormal">The normal vector.</param>
|
||||
/// <param name="InRelativeTo">The relative transform.</param>
|
||||
/// <returns>The rotated and snapped transform with scale <see cref="Float3.One"/>.</returns>
|
||||
static Transform AlignRotationToNormalAndSnapToGrid(const Vector3& InPoint, const Vector3& InNormal, const Vector3& InNormalOffset, const Transform& InRelativeTo, const Vector3& InGridSize);
|
||||
|
||||
|
||||
public:
|
||||
FORCE_INLINE Transform operator*(const Transform& other) const
|
||||
|
||||
@@ -1672,7 +1672,7 @@ namespace FlaxEngine
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Snaps the input position into the grid.
|
||||
/// Snaps the input position onto the grid.
|
||||
/// </summary>
|
||||
/// <param name="pos">The position to snap.</param>
|
||||
/// <param name="gridSize">The size of the grid.</param>
|
||||
@@ -1686,8 +1686,8 @@ namespace FlaxEngine
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Snaps the <paramref name="InPoint"/> on to rotate grid.<br/>
|
||||
/// for world aligned grid snapping use <b><see cref="Vector3.SnapToGrid"/></b> instead
|
||||
/// Snaps the <paramref name="InPoint"/> onto the rotated grid.<br/>
|
||||
/// For world aligned grid snapping use <b><see cref="SnapToGrid"/></b> instead.
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> SnapToRotatedGridExample : <see cref="Script"/><br/>
|
||||
@@ -1723,7 +1723,7 @@ namespace FlaxEngine
|
||||
return (SnapToGrid(p, InGridSize) * InOrientation) + InCenterPoint;
|
||||
}
|
||||
/// <summary>
|
||||
/// The same as <see cref="SnapToRotatedGrid"/> but with local offset applied after point is spapend
|
||||
/// The same as <see cref="SnapToRotatedGrid"/> but with local offset applied after point is snapped.
|
||||
/// <example><para><b>Example code:</b></para>
|
||||
/// <code>
|
||||
/// <see langword="public" /> <see langword="class" /> SnapToRotatedGridWithOffsetExample : <see cref="Script"/><br/>
|
||||
@@ -1739,7 +1739,7 @@ namespace FlaxEngine
|
||||
/// <see cref="FlaxEngine.Transform"/> transform = Hit.Collider.Transform;
|
||||
/// <see cref="Vector3"/> point = Hit.Point;
|
||||
/// <see cref="Vector3"/> normal = Hit.Normal;
|
||||
/// <see cref="Quaternion"/> rot = <see cref="Quaternion"/>.GetRotacionFromNormal(normal,transform);
|
||||
/// <see cref="Quaternion"/> rot = <see cref="Quaternion"/>.GetRotationFromNormal(normal,transform);
|
||||
/// point = <see cref="Vector3"/>.SnapToRotatedGridWithOffset(point,position,Offset,rot,GridSize);
|
||||
/// SomeObject.Position = point;
|
||||
/// }
|
||||
@@ -1752,8 +1752,8 @@ namespace FlaxEngine
|
||||
/// <param name="InCenterPoint">The center point.</param>
|
||||
/// <param name="InOrientation">The rotation of the grid.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InOffset">The local grid offset to applay after snaping</param>
|
||||
/// <returns></returns>
|
||||
/// <param name="InOffset">The local grid offset to apply after snapping.</param>
|
||||
/// <returns>The position snapped to the grid, with offset applied.</returns>
|
||||
public static Vector3 SnapToRotatedGridWithOffset(Vector3 InPoint, Vector3 InCenterPoint, Vector3 InOffset, Quaternion InOrientation, Vector3 InGridSize)
|
||||
{
|
||||
return ((SnapToGrid((InPoint - InCenterPoint) * InOrientation.Conjugated(), InGridSize) + InOffset) * InOrientation) + InCenterPoint;
|
||||
|
||||
@@ -929,33 +929,34 @@ public:
|
||||
static FLAXENGINE_API T Angle(const Vector3Base& from, const Vector3Base& to);
|
||||
|
||||
/// <summary>
|
||||
/// Snaps the input position into the grid.
|
||||
/// Snaps the input position onto the grid.
|
||||
/// </summary>
|
||||
/// <param name="pos">The position to snap.</param>
|
||||
/// <param name="gridSize">The size of the grid.</param>
|
||||
/// <returns>The position snapped to the grid.</returns>
|
||||
static Vector3Base SnapToGrid(const Vector3Base& pos,const Vector3Base& gridSize);
|
||||
static FLAXENGINE_API Vector3Base SnapToGrid(const Vector3Base& pos, const Vector3Base& gridSize);
|
||||
|
||||
/// <summary>
|
||||
/// Snaps the <paramref name="InPoint"/> on to rotate grid.<br/>
|
||||
/// for world aligned grid snapping use <b><see cref="Vector3::SnapToGrid"/></b> instead
|
||||
/// Snaps the <paramref name="InPoint"/> onto the rotated grid.<br/>
|
||||
/// For world aligned grid snapping use <b><see cref="SnapToGrid"/></b> instead.
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InCenterPoint">The center point.</param>
|
||||
/// <param name="InOrientation">The rotation of the grid.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <returns>The position snapped to the grid.</returns>
|
||||
static Vector3Base SnapToRotatedGrid(const Vector3Base& InPoint, const Vector3Base& InCenterPoint, const Quaternion& InOrientation, const Vector3Base& InGridSize);
|
||||
static FLAXENGINE_API Vector3Base SnapToRotatedGrid(const Vector3Base& InPoint, const Vector3Base& InCenterPoint, const Quaternion& InOrientation, const Vector3Base& InGridSize);
|
||||
|
||||
/// <summary>
|
||||
/// The same as <see cref="SnapToRotatedGrid"/> but with local offset applied after point is spapend
|
||||
/// The same as <see cref="SnapToRotatedGrid"/> but with local offset applied after point is snapped.
|
||||
/// </summary>
|
||||
/// <param name="InPoint">The position to snap.</param>
|
||||
/// <param name="InCenterPoint">The center point.</param>
|
||||
/// <param name="InOrientation">The rotation of the grid.</param>
|
||||
/// <param name="InGridSize">The size of the grid.</param>
|
||||
/// <param name="InOffset">The local grid offset to applay after snaping</param>
|
||||
/// <returns></returns>
|
||||
static Vector3Base SnapToRotatedGridWithOffset(const Vector3Base& InPoint, const Vector3Base& InCenterPoint, const Vector3Base& InOffset, const Quaternion& InOrientation, const Vector3Base& InGridSize);
|
||||
/// <param name="InOffset">The local grid offset to apply after snapping.</param>
|
||||
/// <returns>The position snapped to the grid, with offset applied.</returns>
|
||||
static FLAXENGINE_API Vector3Base SnapToRotatedGridWithOffset(const Vector3Base& InPoint, const Vector3Base& InCenterPoint, const Vector3Base& InOffset, const Quaternion& InOrientation, const Vector3Base& InGridSize);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user