Updates GetDirectionVector nodes to also return the distance between the points

Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com>
monroegm-disable-blank-issue-2
lsemp3d 4 years ago
parent 760acdcdcc
commit 1f0fcf2aa2

@ -2778,7 +2778,7 @@
</message>
<message id="VECTOR2_DIRECTIONTO_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_TOOLTIP</source>
<translation>Returns a direction vector between two points, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0</translation>
<translation>Returns a direction vector between two points and the distance between them, by default the direction will be normalized, it may be optionally scaled using the Scale parameter if different from 1.0</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_CATEGORY">
<source>VECTOR2_DIRECTIONTO_CATEGORY</source>
@ -2800,14 +2800,23 @@
<source>VECTOR2_DIRECTIONTO_IN_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_NAME">
<message id="VECTOR2_DIRECTIONTO_OUTPUT0_NAME">
<source>VECTOR2_DIRECTIONTO_OUTPUT0_NAME</source>
<comment>C++ Type: const Vector2</comment>
<translation type="unfinished">Direction</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_OUTPUT0_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
<translation></translation>
<translation>The direction between To and From normalized and optionally scaled</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_OUTPUT1_NAME">
<source>VECTOR2_DIRECTIONTO_OUTPUT1_NAME</source>
<comment>C++ Type: float</comment>
<translation type="unfinished">Distance</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_OUTPUT1_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_OUTPUT1_TOOLTIP</source>
<translation>The distance between To and From</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM0_NAME">
<source>VECTOR2_DIRECTIONTO_PARAM0_NAME</source>
@ -32334,7 +32343,7 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
</message>
<message id="VECTOR4_DIRECTIONTO_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_TOOLTIP</source>
<translation>Returns a direction vector between two points, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0</translation>
<translation>Returns a direction vector between two points and the distance between them, by default the direction will be normalized, it may be optionally scaled using the Scale parameter if different from 1.0</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_CATEGORY">
<source>VECTOR4_DIRECTIONTO_CATEGORY</source>
@ -32363,7 +32372,16 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
<translation></translation>
<translation>The direction between To and From normalized and optionally scaled</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT1_NAME">
<source>VECTOR4_DIRECTIONTO_OUTPUT1_NAME</source>
<comment>C++ Type: float</comment>
<translation type="unfinished">Distance</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT1_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_OUTPUT1_TOOLTIP</source>
<translation>The distance between To and From</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM0_NAME">
<source>VECTOR4_DIRECTIONTO_PARAM0_NAME</source>
@ -37606,7 +37624,7 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
</message>
<message id="VECTOR3_DIRECTIONTO_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_TOOLTIP</source>
<translation>Returns a direction vector between two points, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0</translation>
<translation>Returns a direction vector between two points and the distance between them, by default the direction will be normalized, it may be optionally scaled using the Scale parameter if different from 1.0</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_CATEGORY">
<source>VECTOR3_DIRECTIONTO_CATEGORY</source>
@ -37628,14 +37646,23 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
<source>VECTOR3_DIRECTIONTO_IN_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_NAME">
<message id="VECTOR3_DIRECTIONTO_OUTPUT0_NAME">
<source>VECTOR3_DIRECTIONTO_OUTPUT0_NAME</source>
<comment>C++ Type: const Vector3</comment>
<translation type="unfinished">Direction</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_OUTPUT0_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
<translation></translation>
<translation>The direction between To and From normalized and optionally scaled</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_OUTPUT1_NAME">
<source>VECTOR3_DIRECTIONTO_OUTPUT1_NAME</source>
<comment>C++ Type: float</comment>
<translation type="unfinished">Distance</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_OUTPUT1_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_OUTPUT1_TOOLTIP</source>
<translation>The distance between To and From</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM0_NAME">
<source>VECTOR3_DIRECTIONTO_PARAM0_NAME</source>

@ -250,14 +250,14 @@ namespace ScriptCanvas
SetDefaultValuesByIndex<2>::_(node, Data::NumberType(1.));
}
AZ_INLINE Vector2Type DirectionTo(const Vector2Type from, const Vector2Type to, NumberType optionalScale = 1.f)
AZ_INLINE std::tuple<Vector2Type, NumberType> DirectionTo(const Vector2Type from, const Vector2Type to, NumberType optionalScale = 1.f)
{
Vector2Type r = to - from;
r.Normalize();
float length = r.NormalizeWithLength();
r.SetLength(optionalScale);
return r;
return std::make_tuple(r, length);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{49A2D7F6-6CD3-420E-8A79-D46B00DB6CED}", "Returns a direction vector between two points, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0", "From", "To", "Scale");
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{49A2D7F6-6CD3-420E-8A79-D46B00DB6CED}", "Returns a direction vector between two points and the distance between them, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0", "From", "To", "Scale");
using Registrar = RegistrarGeneric <
AbsoluteNode

@ -336,14 +336,14 @@ namespace ScriptCanvas
SetDefaultValuesByIndex<2>::_(node, Data::NumberType(1.));
}
AZ_INLINE Vector3Type DirectionTo(const Vector3Type from, const Vector3Type to, NumberType optionalScale = 1.f)
AZ_INLINE std::tuple<Vector3Type, NumberType> DirectionTo(const Vector3Type from, const Vector3Type to, NumberType optionalScale = 1.f)
{
Vector3Type r = to - from;
r.Normalize();
float length = r.NormalizeWithLength();
r.SetLength(optionalScale);
return r;
return std::make_tuple(r, length);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{28FBD529-4C9A-4E34-B8A0-A13B5DB3C331}", "Returns a direction vector between two points, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0", "From", "To", "Scale");
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{28FBD529-4C9A-4E34-B8A0-A13B5DB3C331}", "Returns a direction vector between two points and the distance between them, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0", "From", "To", "Scale");
using Registrar = RegistrarGeneric <

@ -221,14 +221,14 @@ namespace ScriptCanvas
SetDefaultValuesByIndex<2>::_(node, Data::NumberType(1.));
}
AZ_INLINE Vector4Type DirectionTo(const Vector4Type from, const Vector4Type to, NumberType optionalScale = 1.f)
AZ_INLINE std::tuple<Vector4Type, NumberType> DirectionTo(const Vector4Type from, const Vector4Type to, NumberType optionalScale = 1.f)
{
Vector4Type r = to - from;
r.Normalize();
float length = r.NormalizeWithLength();
r.SetLength(optionalScale);
return r;
return std::make_tuple(r, length);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{463762DE-E541-4AFE-80C2-FED1C5273319}", "Returns a direction vector between two points, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0", "From", "To", "Scale");
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{463762DE-E541-4AFE-80C2-FED1C5273319}", false, "Returns a direction vector between two points and the distance between them, by default the direction will be normalized, but it may be optionally scaled using the Scale parameter if different from 1.0", "From", "To", "Scale");
using Registrar = RegistrarGeneric <
AbsoluteNode,

Loading…
Cancel
Save