fix: general optimization, lazy cooking, transform caching, fix geometry copying
This commit is contained in:
@@ -29,6 +29,32 @@ ga::Attribute::Attribute(std::string name, ga::AttributeType type)
|
||||
|
||||
}
|
||||
|
||||
ga::Attribute::Attribute(const Attribute& other)
|
||||
{
|
||||
type_ = other.type_;
|
||||
private_= other.private_;
|
||||
hidden_ = other.hidden_;
|
||||
readOnly_ = other.readOnly_;
|
||||
name_ = other.name_;
|
||||
|
||||
switch(type_)
|
||||
{
|
||||
case(AttrType::intT):
|
||||
intStore_=std::make_shared<std::vector<int>>(*other.intStore_);
|
||||
break;
|
||||
case(AttrType::floatT):
|
||||
floatStore_=std::make_shared<std::vector<float>>(*other.floatStore_);
|
||||
break;
|
||||
case(AttrType::vectorT):
|
||||
vector3Store_=std::make_shared<std::vector<enzo::bt::Vector3>>(*other.vector3Store_);
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("Type " + std::to_string(static_cast<int>(type_)) + " was not properly accounted for");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ga::AttributeType ga::Attribute::getType()
|
||||
{
|
||||
return type_;
|
||||
|
||||
Reference in New Issue
Block a user