mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
copy into new vector
This commit is contained in:
parent
06c5fa0585
commit
ffdbc12968
2 changed files with 19 additions and 5 deletions
|
@ -39,8 +39,9 @@ HeadData::HeadData(AvatarData* owningAvatar) :
|
||||||
_rightEyeBlink(0.0f),
|
_rightEyeBlink(0.0f),
|
||||||
_averageLoudness(0.0f),
|
_averageLoudness(0.0f),
|
||||||
_browAudioLift(0.0f),
|
_browAudioLift(0.0f),
|
||||||
_owningAvatar(owningAvatar),
|
_baseBlendshapeCoefficients(QVector<float>(0, 0.0f)),
|
||||||
_baseBlendshapeCoefficients(QVector<float>(0, 0))
|
_currBlendShapeCoefficients(QVector<float>(0, 0.0f)),
|
||||||
|
_owningAvatar(owningAvatar)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -89,10 +90,22 @@ static const QMap<QString, int>& getBlendshapesLookupMap() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector<float>& HeadData::getSummedBlendshapeCoefficients() {
|
const QVector<float>& HeadData::getSummedBlendshapeCoefficients() {
|
||||||
for (int i = 0; i < _baseBlendshapeCoefficients.size(); i++) {
|
int maxSize = std::max(_baseBlendshapeCoefficients.size(), _blendshapeCoefficients.size());
|
||||||
_blendshapeCoefficients[i] += _baseBlendshapeCoefficients[i];
|
if (_currBlendShapeCoefficients.size() != maxSize) {
|
||||||
|
_currBlendShapeCoefficients.resize(maxSize);
|
||||||
}
|
}
|
||||||
return _blendshapeCoefficients;
|
|
||||||
|
for (int i = 0; i < maxSize; i++) {
|
||||||
|
if (i >= _baseBlendshapeCoefficients.size()) {
|
||||||
|
_currBlendShapeCoefficients[i] = _blendshapeCoefficients[i];
|
||||||
|
} else if (i >= _blendshapeCoefficients.size()) {
|
||||||
|
_currBlendShapeCoefficients[i] = _baseBlendshapeCoefficients[i];
|
||||||
|
} else {
|
||||||
|
_currBlendShapeCoefficients[i] = _baseBlendshapeCoefficients[i] + _blendshapeCoefficients[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _currBlendShapeCoefficients;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeadData::setBlendshape(QString name, float val) {
|
void HeadData::setBlendshape(QString name, float val) {
|
||||||
|
|
|
@ -94,6 +94,7 @@ protected:
|
||||||
|
|
||||||
QVector<float> _blendshapeCoefficients;
|
QVector<float> _blendshapeCoefficients;
|
||||||
QVector<float> _baseBlendshapeCoefficients;
|
QVector<float> _baseBlendshapeCoefficients;
|
||||||
|
QVector<float> _currBlendShapeCoefficients;
|
||||||
AvatarData* _owningAvatar;
|
AvatarData* _owningAvatar;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue