Added Get Direction Vector node for Vector2,3 and 4

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

@ -2771,6 +2771,71 @@
<source>VECTOR2_CREATEONE_OUTPUT0_TOOLTIP</source> <source>VECTOR2_CREATEONE_OUTPUT0_TOOLTIP</source>
<translation></translation> <translation></translation>
</message> </message>
<message id="VECTOR2_DIRECTIONTO_NAME">
<source>VECTOR2_DIRECTIONTO_NAME</source>
<comment>Class/Bus: Vector2 Event/Method: DirectionTo</comment>
<translation type="unfinished">Get Direction Vector</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTO_CATEGORY">
<source>VECTOR2_DIRECTIONTO_CATEGORY</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTO_OUT_NAME">
<source>VECTOR2_DIRECTIONTO_OUT_NAME</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTO_OUT_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_OUT_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTOL_IN_NAME">
<source>VECTOR2_DIRECTIONTOL_IN_NAME</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTO_IN_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_IN_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_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>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM0_NAME">
<source>VECTOR2_DIRECTIONTO_PARAM0_NAME</source>
<comment>Simple Type: Vector2 C++ Type: Vector2*</comment>
<translation type="unfinished">From</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM0_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_PARAM0_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM1_NAME">
<source>VECTOR2_DIRECTIONTO_PARAM1_NAME</source>
<comment>Simple Type: Vector2 C++ Type: Vector2*</comment>
<translation type="unfinished">To</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM1_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_PARAM1_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM2_NAME">
<source>VECTOR2_DIRECTIONTO_PARAM2_NAME</source>
<comment>Simple Type: Vector2 C++ Type: Vector2*</comment>
<translation type="unfinished">Scale</translation>
</message>
<message id="VECTOR2_DIRECTIONTO_PARAM2_TOOLTIP">
<source>VECTOR2_DIRECTIONTO_PARAM2_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR2_GETPROJECTED_NAME"> <message id="VECTOR2_GETPROJECTED_NAME">
<source>VECTOR2_GETPROJECTED_NAME</source> <source>VECTOR2_GETPROJECTED_NAME</source>
<comment>Class/Bus: Vector2 Event/Method: GetProjected</comment> <comment>Class/Bus: Vector2 Event/Method: GetProjected</comment>
@ -32262,6 +32327,71 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
<source>VECTOR4_GETRECIPROCAL_PARAM0_TOOLTIP</source> <source>VECTOR4_GETRECIPROCAL_PARAM0_TOOLTIP</source>
<translation></translation> <translation></translation>
</message> </message>
<message id="VECTOR4_DIRECTIONTO_NAME">
<source>VECTOR4_DIRECTIONTO_NAME</source>
<comment>Class/Bus: Vector4 Event/Method: DirectionTo</comment>
<translation type="unfinished">Get Direction Vector</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_CATEGORY">
<source>VECTOR4_DIRECTIONTO_CATEGORY</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUT_NAME">
<source>VECTOR4_DIRECTIONTO_OUT_NAME</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUT_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_OUT_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTOL_IN_NAME">
<source>VECTOR4_DIRECTIONTOL_IN_NAME</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_IN_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_IN_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_NAME">
<source>VECTOR4_DIRECTIONTO_OUTPUT0_NAME</source>
<comment>C++ Type: const Vector4</comment>
<translation type="unfinished">Direction</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM0_NAME">
<source>VECTOR4_DIRECTIONTO_PARAM0_NAME</source>
<comment>Simple Type: Vector4 C++ Type: Vector4*</comment>
<translation type="unfinished">From</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM0_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_PARAM0_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM1_NAME">
<source>VECTOR4_DIRECTIONTO_PARAM1_NAME</source>
<comment>Simple Type: Vector4 C++ Type: Vector4*</comment>
<translation type="unfinished">To</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM1_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_PARAM1_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM2_NAME">
<source>VECTOR4_DIRECTIONTO_PARAM2_NAME</source>
<comment>Simple Type: Vector4 C++ Type: Vector4*</comment>
<translation type="unfinished">Scale</translation>
</message>
<message id="VECTOR4_DIRECTIONTO_PARAM2_TOOLTIP">
<source>VECTOR4_DIRECTIONTO_PARAM2_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_AXISX_NAME"> <message id="VECTOR4_AXISX_NAME">
<source>VECTOR4_AXISX_NAME</source> <source>VECTOR4_AXISX_NAME</source>
<comment>Class/Bus: Vector4 Event/Method: CreateAxisX</comment> <comment>Class/Bus: Vector4 Event/Method: CreateAxisX</comment>
@ -37469,6 +37599,71 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
<source>VECTOR3_GETRECIPROCAL_PARAM0_TOOLTIP</source> <source>VECTOR3_GETRECIPROCAL_PARAM0_TOOLTIP</source>
<translation></translation> <translation></translation>
</message> </message>
<message id="VECTOR3_DIRECTIONTO_NAME">
<source>VECTOR3_DIRECTIONTO_NAME</source>
<comment>Class/Bus: Vector3 Event/Method: DirectionTo</comment>
<translation type="unfinished">Get Direction Vector</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTO_CATEGORY">
<source>VECTOR3_DIRECTIONTO_CATEGORY</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTO_OUT_NAME">
<source>VECTOR3_DIRECTIONTO_OUT_NAME</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTO_OUT_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_OUT_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTOL_IN_NAME">
<source>VECTOR3_DIRECTIONTOL_IN_NAME</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTO_IN_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_IN_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR4_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>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM0_NAME">
<source>VECTOR3_DIRECTIONTO_PARAM0_NAME</source>
<comment>Simple Type: Vector3 C++ Type: Vector3*</comment>
<translation type="unfinished">From</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM0_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_PARAM0_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM1_NAME">
<source>VECTOR3_DIRECTIONTO_PARAM1_NAME</source>
<comment>Simple Type: Vector3 C++ Type: Vector3*</comment>
<translation type="unfinished">To</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM1_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_PARAM1_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM2_NAME">
<source>VECTOR3_DIRECTIONTO_PARAM2_NAME</source>
<comment>Simple Type: Vector3 C++ Type: Vector3*</comment>
<translation type="unfinished">Scale</translation>
</message>
<message id="VECTOR3_DIRECTIONTO_PARAM2_TOOLTIP">
<source>VECTOR3_DIRECTIONTO_PARAM2_TOOLTIP</source>
<translation></translation>
</message>
<message id="VECTOR3_PROJECT_NAME"> <message id="VECTOR3_PROJECT_NAME">
<source>VECTOR3_PROJECT_NAME</source> <source>VECTOR3_PROJECT_NAME</source>
<comment>Class/Bus: Vector3 Event/Method: Project</comment> <comment>Class/Bus: Vector3 Event/Method: Project</comment>

@ -243,6 +243,22 @@ namespace ScriptCanvas
} }
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToPerpendicular, k_categoryName, "{CC4DC102-8B50-4828-BA94-0586F34E0D37}", "returns the vector (-Source.y, Source.x), a 90 degree, positive rotation", "Source"); SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToPerpendicular, k_categoryName, "{CC4DC102-8B50-4828-BA94-0586F34E0D37}", "returns the vector (-Source.y, Source.x), a 90 degree, positive rotation", "Source");
AZ_INLINE void DirectionToDefaults(Node& node)
{
SetDefaultValuesByIndex<0>::_(node, Data::Vector2Type());
SetDefaultValuesByIndex<1>::_(node, Data::Vector2Type());
SetDefaultValuesByIndex<2>::_(node, Data::NumberType(1.));
}
AZ_INLINE Vector2Type DirectionTo(const Vector2Type from, const Vector2Type to, NumberType optionalScale = 1.f)
{
Vector2Type r = to - from;
r.Normalize();
r.SetLength(optionalScale);
return r;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{49A2D7F6-6CD3-420E-8A79-D46B00DB6CED}", "Given two points in space, return a direction vector", "From", "To", "Scale");
using Registrar = RegistrarGeneric < using Registrar = RegistrarGeneric <
AbsoluteNode AbsoluteNode
, AddNode , AddNode
@ -295,6 +311,7 @@ namespace ScriptCanvas
, SlerpNode , SlerpNode
, SubtractNode , SubtractNode
, ToPerpendicularNode , ToPerpendicularNode
, DirectionToNode
> ; > ;
} }

@ -329,6 +329,23 @@ namespace ScriptCanvas
} }
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ZAxisCross, k_categoryName, "{29206E84-392C-412E-9DD5-781B2759260D}", "returns the vector cross product of Z-Axis X Source", "Source"); SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ZAxisCross, k_categoryName, "{29206E84-392C-412E-9DD5-781B2759260D}", "returns the vector cross product of Z-Axis X Source", "Source");
AZ_INLINE void DirectionToDefaults(Node& node)
{
SetDefaultValuesByIndex<0>::_(node, Data::Vector3Type());
SetDefaultValuesByIndex<1>::_(node, Data::Vector3Type());
SetDefaultValuesByIndex<2>::_(node, Data::NumberType(1.));
}
AZ_INLINE Vector3Type DirectionTo(const Vector3Type from, const Vector3Type to, NumberType optionalScale = 1.f)
{
Vector3Type r = to - from;
r.Normalize();
r.SetLength(optionalScale);
return r;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{28FBD529-4C9A-4E34-B8A0-A13B5DB3C331}", "Given two points in space, return a direction vector", "From", "To", "Scale");
using Registrar = RegistrarGeneric < using Registrar = RegistrarGeneric <
AbsoluteNode AbsoluteNode
, AddNode , AddNode
@ -403,6 +420,7 @@ namespace ScriptCanvas
, SlerpNode , SlerpNode
, SubtractNode , SubtractNode
, DirectionToNode
#if ENABLE_EXTENDED_MATH_SUPPORT #if ENABLE_EXTENDED_MATH_SUPPORT
, XAxisCrossNode , XAxisCrossNode

@ -214,6 +214,22 @@ namespace ScriptCanvas
} }
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_DEPRECATED(Subtract, k_categoryName, "{A5FA6465-9C39-4A44-BD7C-E8ECF9503E46}", "This node is deprecated, use Subtract (-), it provides contextual type and slots", "A", "B"); SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_DEPRECATED(Subtract, k_categoryName, "{A5FA6465-9C39-4A44-BD7C-E8ECF9503E46}", "This node is deprecated, use Subtract (-), it provides contextual type and slots", "A", "B");
AZ_INLINE void DirectionToDefaults(Node& node)
{
SetDefaultValuesByIndex<0>::_(node, Data::Vector4Type());
SetDefaultValuesByIndex<1>::_(node, Data::Vector4Type());
SetDefaultValuesByIndex<2>::_(node, Data::NumberType(1.));
}
AZ_INLINE Vector4Type DirectionTo(const Vector4Type from, const Vector4Type to, NumberType optionalScale = 1.f)
{
Vector4Type r = to - from;
r.Normalize();
r.SetLength(optionalScale);
return r;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(DirectionTo, DirectionToDefaults, k_categoryName, "{463762DE-E541-4AFE-80C2-FED1C5273319}", "Given two points in space, return a direction vector", "From", "To", "Scale");
using Registrar = RegistrarGeneric < using Registrar = RegistrarGeneric <
AbsoluteNode, AbsoluteNode,
AddNode, AddNode,
@ -260,7 +276,8 @@ namespace ScriptCanvas
#endif #endif
ReciprocalNode, ReciprocalNode,
SubtractNode SubtractNode,
DirectionToNode
> ; > ;
} }

Loading…
Cancel
Save