ScripCanvas

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
pappeste 5 years ago committed by Esteban Papp
parent 2943f16d11
commit b52516cdec

@ -2219,7 +2219,7 @@ namespace ScriptCanvas
const_cast<Datum*>(this)->InitializeOverloadedStorage(Data::FromAZType(description.m_typeId), eOriginality::Copy); const_cast<Datum*>(this)->InitializeOverloadedStorage(Data::FromAZType(description.m_typeId), eOriginality::Copy);
if (!Data::IsValueType(m_type) && !SatisfiesTraits(description.m_traits)) if (!Data::IsValueType(m_type) && !SatisfiesTraits(static_cast<AZ::u8>(description.m_traits)))
{ {
return AZ::Failure(AZStd::string("Attempting to convert null value to BehaviorValueParameter that expects reference or value")); return AZ::Failure(AZStd::string("Attempting to convert null value to BehaviorValueParameter that expects reference or value"));
} }

@ -116,7 +116,7 @@ namespace ScriptCanvas
auto nodeable = AZ::ScriptValue<EBusHandler*>::StackRead(lua, k_nodeableIndex); auto nodeable = AZ::ScriptValue<EBusHandler*>::StackRead(lua, k_nodeableIndex);
AZ_Assert(nodeable, "Failed to read EBusHandler"); AZ_Assert(nodeable, "Failed to read EBusHandler");
const int eventIndex = lua_tointeger(lua, k_eventNameIndex); const int eventIndex = static_cast<int>(lua_tointeger(lua, k_eventNameIndex));
AZ_Assert(eventIndex != -1, "Event index was not found for %s", nodeable->GetEBusName().data()); AZ_Assert(eventIndex != -1, "Event index was not found for %s", nodeable->GetEBusName().data());
// install the generic hook for the event // install the generic hook for the event
nodeable->HandleEvent(eventIndex); nodeable->HandleEvent(eventIndex);
@ -143,7 +143,7 @@ namespace ScriptCanvas
auto nodeable = AZ::ScriptValue<EBusHandler*>::StackRead(lua, k_nodeableIndex); auto nodeable = AZ::ScriptValue<EBusHandler*>::StackRead(lua, k_nodeableIndex);
AZ_Assert(nodeable, "Failed to read EBusHandler"); AZ_Assert(nodeable, "Failed to read EBusHandler");
const int eventIndex = lua_tointeger(lua, k_eventNameIndex); const int eventIndex = static_cast<int>(lua_tointeger(lua, k_eventNameIndex));
AZ_Assert(eventIndex != -1, "Event index was not found for %s", nodeable->GetEBusName().data()); AZ_Assert(eventIndex != -1, "Event index was not found for %s", nodeable->GetEBusName().data());
// install the generic hook for the event // install the generic hook for the event
nodeable->HandleEvent(eventIndex); nodeable->HandleEvent(eventIndex);

@ -92,7 +92,7 @@ namespace ScriptCanvas
AZ_INLINE AABBType FromCenterRadius(const Vector3Type center, const NumberType radius) AZ_INLINE AABBType FromCenterRadius(const Vector3Type center, const NumberType radius)
{ {
return AABBType::CreateCenterRadius(center, radius); return AABBType::CreateCenterRadius(center, static_cast<float>(radius));
} }
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromCenterRadius, k_categoryName, "{5FEFD1BF-DC5B-4AFA-892F-082D92492548}", "returns the AABB with Min = Center - Vector3(radius, radius, radius), Max = Center + Vector3(radius, radius, radius)", "Center", "Radius"); SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromCenterRadius, k_categoryName, "{5FEFD1BF-DC5B-4AFA-892F-082D92492548}", "returns the AABB with Min = Center - Vector3(radius, radius, radius), Max = Center + Vector3(radius, radius, radius)", "Center", "Radius");

@ -55,7 +55,7 @@ namespace ScriptCanvas
AZ_INLINE TransformType FromScale(NumberType scale) AZ_INLINE TransformType FromScale(NumberType scale)
{ {
return TransformType::CreateUniformScale(scale); return TransformType::CreateUniformScale(static_cast<float>(scale));
} }
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromScale, k_categoryName, "{4B6454BC-015C-41BB-9C78-34ADBCF70187}", "returns a transform which applies the specified uniform Scale, but no rotation or translation", "Scale"); SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromScale, k_categoryName, "{4B6454BC-015C-41BB-9C78-34ADBCF70187}", "returns a transform which applies the specified uniform Scale, but no rotation or translation", "Scale");
@ -143,7 +143,7 @@ namespace ScriptCanvas
AZ_INLINE TransformType MultiplyByUniformScale(TransformType source, NumberType scale) AZ_INLINE TransformType MultiplyByUniformScale(TransformType source, NumberType scale)
{ {
source.MultiplyByUniformScale(scale); source.MultiplyByUniformScale(static_cast<float>(scale));
return source; return source;
} }
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(MultiplyByUniformScale, k_categoryName, "{90472D62-65A8-40C1-AB08-FA66D793F689}", "returns Source multiplied uniformly by Scale", "Source", "Scale"); SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(MultiplyByUniformScale, k_categoryName, "{90472D62-65A8-40C1-AB08-FA66D793F689}", "returns Source multiplied uniformly by Scale", "Source", "Scale");

@ -114,7 +114,7 @@ namespace ScriptCanvas::Nodeables::Spawning
AZ::Vector3 rotationCopy = rotation; AZ::Vector3 rotationCopy = rotation;
AZ::Quaternion rotationQuat = AZ::Quaternion::CreateFromEulerAnglesDegrees(rotationCopy); AZ::Quaternion rotationQuat = AZ::Quaternion::CreateFromEulerAnglesDegrees(rotationCopy);
entityTransform->SetWorldTM(AZ::Transform(translation, rotationQuat, scale)); entityTransform->SetWorldTM(AZ::Transform(translation, rotationQuat, static_cast<float>(scale)));
} }
}; };

@ -82,12 +82,12 @@ namespace ScriptCanvas
void DelayNodeable::Reset(Data::NumberType countdownSeconds, Data::BooleanType looping, Data::NumberType holdTime) void DelayNodeable::Reset(Data::NumberType countdownSeconds, Data::BooleanType looping, Data::NumberType holdTime)
{ {
InitiateCountdown(true, countdownSeconds, looping, holdTime); InitiateCountdown(true, static_cast<float>(countdownSeconds), looping, static_cast<float>(holdTime));
} }
void DelayNodeable::Start(Data::NumberType countdownSeconds, Data::BooleanType looping, Data::NumberType holdTime) void DelayNodeable::Start(Data::NumberType countdownSeconds, Data::BooleanType looping, Data::NumberType holdTime)
{ {
InitiateCountdown(false, countdownSeconds, looping, holdTime); InitiateCountdown(false, static_cast<float>(countdownSeconds), looping, static_cast<float>(holdTime));
} }
} }
} }

@ -47,7 +47,7 @@ namespace ScriptCanvas
void DurationNodeable::Start(Data::NumberType duration) void DurationNodeable::Start(Data::NumberType duration)
{ {
m_elapsedTime = 0.0f; m_elapsedTime = 0.0f;
m_duration = duration; m_duration = static_cast<float>(duration);
AZ::TickBus::Handler::BusConnect(); AZ::TickBus::Handler::BusConnect();
} }
} }

@ -110,7 +110,7 @@ namespace ScriptCanvas
AZ_INLINE AZ::Vector3 NormalizeWithDefault(const AZ::Vector3& source, const Data::NumberType tolerance, [[maybe_unused]] const Data::BooleanType fakeValueForTestingDefault) AZ_INLINE AZ::Vector3 NormalizeWithDefault(const AZ::Vector3& source, const Data::NumberType tolerance, [[maybe_unused]] const Data::BooleanType fakeValueForTestingDefault)
{ {
AZ_TracePrintf("SC", "The fake value for testing default is %s\n", fakeValueForTestingDefault ? "True" : "False"); AZ_TracePrintf("SC", "The fake value for testing default is %s\n", fakeValueForTestingDefault ? "True" : "False");
return source.GetNormalizedSafe(tolerance); return source.GetNormalizedSafe(static_cast<float>(tolerance));
} }
void NormalizeWithDefaultInputOverrides(Node& node) { SetDefaultValuesByIndex< 1, 2 >::_(node, 3.3, true); } void NormalizeWithDefaultInputOverrides(Node& node) { SetDefaultValuesByIndex< 1, 2 >::_(node, 3.3, true); }

Loading…
Cancel
Save