mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:37:27 +02:00
Fix invalid reference
This commit is contained in:
parent
22faf211bf
commit
cd8ad23dd1
2 changed files with 6 additions and 4 deletions
|
@ -138,7 +138,8 @@ static AnimPose composeAnimPose(const HFMJoint& joint, const glm::quat rotation,
|
||||||
|
|
||||||
void ScriptableAvatar::update(float deltatime) {
|
void ScriptableAvatar::update(float deltatime) {
|
||||||
// Run animation
|
// Run animation
|
||||||
if (_animation && _animation->isLoaded() && _animation->getFrames().size() > 0 && !_bind.isNull() && _bind->isLoaded()) {
|
auto frames = _animation->getFrames();
|
||||||
|
if (_animation && _animation->isLoaded() && frames.size() > 0 && !_bind.isNull() && _bind->isLoaded()) {
|
||||||
if (!_animSkeleton) {
|
if (!_animSkeleton) {
|
||||||
_animSkeleton = std::make_shared<AnimSkeleton>(_bind->getHFMModel());
|
_animSkeleton = std::make_shared<AnimSkeleton>(_bind->getHFMModel());
|
||||||
}
|
}
|
||||||
|
@ -157,9 +158,9 @@ void ScriptableAvatar::update(float deltatime) {
|
||||||
_jointData.resize(nJoints);
|
_jointData.resize(nJoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int frameCount = _animation->getFrames().size();
|
const int frameCount = frames.size();
|
||||||
const HFMAnimationFrame& floorFrame = _animation->getFrames().at((int)glm::floor(currentFrame) % frameCount);
|
const HFMAnimationFrame& floorFrame = frames.at((int)glm::floor(currentFrame) % frameCount);
|
||||||
const HFMAnimationFrame& ceilFrame = _animation->getFrames().at((int)glm::ceil(currentFrame) % frameCount);
|
const HFMAnimationFrame& ceilFrame = frames.at((int)glm::ceil(currentFrame) % frameCount);
|
||||||
const float frameFraction = glm::fract(currentFrame);
|
const float frameFraction = glm::fract(currentFrame);
|
||||||
std::vector<AnimPose> poses = _animSkeleton->getRelativeDefaultPoses();
|
std::vector<AnimPose> poses = _animSkeleton->getRelativeDefaultPoses();
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,7 @@ bool QmlWindowClass::isVisible() {
|
||||||
return quickItem->isVisible();
|
return quickItem->isVisible();
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "QmlWindowClass::isVisible: asQuickItem() returned NULL";
|
qDebug() << "QmlWindowClass::isVisible: asQuickItem() returned NULL";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue