feat: add eigen vector type

This commit is contained in:
parker
2025-07-02 12:43:20 +01:00
parent 6463fe2a7f
commit f1d825d513
8 changed files with 66 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
#include <optional>
#include <vector>
#include "Engine/Operator/Attribute.h"
#include "Engine/Types.h"
#include <iostream>
@@ -23,14 +24,24 @@ public:
// get attribute data pointer
// TODO: check types match
// TODO: add the other types
// int
if constexpr (std::is_same<int, T>::value)
{
data_=attribute->intStore_;
}
// float
else if constexpr (std::is_same<float, T>::value)
{
data_=attribute->floatStore_;
}
// vector 3
else if constexpr (std::is_same<enzo::bt::Vector3, T>::value)
{
data_=attribute->vector3Store_;
}
else
{
throw std::runtime_error("Type " + std::to_string(static_cast<int>(type_)) + " was not properly accounted for");
@@ -75,5 +86,6 @@ private:
using AttributeHandleInt = AttributeHandle<int>;
using AttributeHandleFloat = AttributeHandle<float>;
using AttributeHandleVector3 = AttributeHandle<enzo::bt::Vector3>;
}