mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 17:39:46 +00:00
feat: entity rotation interpolation
This commit is contained in:
parent
e24bae86eb
commit
9846ad289a
9 changed files with 82 additions and 15 deletions
|
|
@ -160,17 +160,17 @@ void SkeletonConfig::update(
|
|||
const glm::vec3& position,
|
||||
const glm::vec3& scale
|
||||
) const {
|
||||
if (skeleton.interpolation.isEnabled()) {
|
||||
const auto& interpolation = skeleton.interpolation;
|
||||
update(
|
||||
0,
|
||||
skeleton,
|
||||
root.get(),
|
||||
build_matrix(rotation, interpolation.getCurrent(), scale)
|
||||
);
|
||||
} else {
|
||||
update(0, skeleton, root.get(), build_matrix(rotation, position, scale));
|
||||
glm::vec3 pos = position;
|
||||
const auto& interpolation = skeleton.interpolation;
|
||||
if (interpolation.isEnabled() && interpolation.isRefreshed()) {
|
||||
pos = interpolation.getCurrent();
|
||||
}
|
||||
glm::mat3 rot = rotation;
|
||||
const auto& rotationInterpolation = skeleton.rotationInterpolation;
|
||||
if (rotationInterpolation.isEnabled() && rotationInterpolation.isRefreshed()) {
|
||||
rot = glm::mat3_cast(rotationInterpolation.getCurrent());
|
||||
}
|
||||
update(0, skeleton, root.get(), build_matrix(rot, pos, scale));
|
||||
}
|
||||
|
||||
void SkeletonConfig::render(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue