mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
fix: destroyed skeleton config access on skeleton reload
This commit is contained in:
parent
33db2633a2
commit
9893c09fd5
9 changed files with 35 additions and 22 deletions
|
|
@ -37,15 +37,9 @@ rigging::Skeleton* Entity::getSkeleton() const {
|
|||
return registry.try_get<rigging::Skeleton>(entity);
|
||||
}
|
||||
|
||||
void Entity::setRig(const rigging::SkeletonConfig* rigConfig) {
|
||||
void Entity::setRig(std::shared_ptr<const rigging::SkeletonConfig> rigConfig) {
|
||||
auto& skeleton = registry.get<rigging::Skeleton>(entity);
|
||||
skeleton.config = rigConfig;
|
||||
skeleton.pose.matrices.resize(
|
||||
rigConfig->getBones().size(), glm::mat4(1.0f)
|
||||
);
|
||||
skeleton.calculated.matrices.resize(
|
||||
rigConfig->getBones().size(), glm::mat4(1.0f)
|
||||
);
|
||||
skeleton.setConfig(std::move(rigConfig));
|
||||
}
|
||||
|
||||
dv::value Entity::serialize() const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue