Added Get Direction Vector node for Vector2,3 and 4
Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
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 <
|
||||
AbsoluteNode
|
||||
, AddNode
|
||||
@@ -295,6 +311,7 @@ namespace ScriptCanvas
|
||||
, SlerpNode
|
||||
, SubtractNode
|
||||
, 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");
|
||||
|
||||
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 <
|
||||
AbsoluteNode
|
||||
, AddNode
|
||||
@@ -403,6 +420,7 @@ namespace ScriptCanvas
|
||||
|
||||
, SlerpNode
|
||||
, SubtractNode
|
||||
, DirectionToNode
|
||||
|
||||
#if ENABLE_EXTENDED_MATH_SUPPORT
|
||||
, 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");
|
||||
|
||||
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 <
|
||||
AbsoluteNode,
|
||||
AddNode,
|
||||
@@ -260,7 +276,8 @@ namespace ScriptCanvas
|
||||
#endif
|
||||
|
||||
ReciprocalNode,
|
||||
SubtractNode
|
||||
SubtractNode,
|
||||
DirectionToNode
|
||||
> ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user