Add support for Quaternion in GPU particles graph

#2901
This commit is contained in:
Wojtek Figat
2024-12-06 17:38:16 +01:00
parent ce23c2efaf
commit 0cf31395b5
5 changed files with 9 additions and 11 deletions

View File

@@ -92,9 +92,13 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value)
value = Value(cv.W);
break;
}
// Rotation
case 8:
{
value = Value::Zero;
const float pitch = (float)node->Values[0];
const float yaw = (float)node->Values[1];
const float roll = (float)node->Values[2];
value = Value(Quaternion::Euler(pitch, yaw, roll));
break;
}
// PI

View File

@@ -460,6 +460,7 @@ ShaderGraphValue ShaderGraphValue::Cast(const ShaderGraphValue& v, VariantType::
case VariantType::Types::Float4:
case VariantType::Types::Double4:
case VariantType::Types::Color:
case VariantType::Types::Quaternion:
switch (v.Type)
{
case VariantType::Types::Bool:
@@ -485,16 +486,6 @@ ShaderGraphValue ShaderGraphValue::Cast(const ShaderGraphValue& v, VariantType::
break;
}
break;
case VariantType::Types::Quaternion:
switch (v.Type)
{
case VariantType::Types::Color:
case VariantType::Types::Float4:
case VariantType::Types::Double4:
format = TEXT("{}");
break;
}
break;
}
if (format == nullptr)
{

View File

@@ -79,6 +79,7 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value)
value = cv.W;
break;
}
// Rotation
case 8:
{
const float pitch = (float)node->Values[0];