mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
Merge pull request #2548 from ey6es/master
Couple of quick fixes: reset the skeleton joints when space is pressed a...
This commit is contained in:
commit
8661bdf788
3 changed files with 15 additions and 3 deletions
|
@ -397,9 +397,13 @@ void Avatar::renderDisplayName() {
|
|||
|
||||
glPushMatrix();
|
||||
glm::vec3 textPosition;
|
||||
getSkeletonModel().getNeckPosition(textPosition);
|
||||
textPosition += getBodyUpDirection() * getHeadHeight() * 1.1f;
|
||||
|
||||
if (getSkeletonModel().getNeckPosition(textPosition)) {
|
||||
textPosition += getBodyUpDirection() * getHeadHeight() * 1.1f;
|
||||
} else {
|
||||
const float HEAD_PROPORTION = 0.75f;
|
||||
textPosition = _position + getBodyUpDirection() * (getBillboardSize() * HEAD_PROPORTION);
|
||||
}
|
||||
|
||||
glTranslatef(textPosition.x, textPosition.y, textPosition.z);
|
||||
|
||||
// we need "always facing camera": we must remove the camera rotation from the stack
|
||||
|
|
|
@ -79,6 +79,7 @@ void MyAvatar::reset() {
|
|||
// TODO? resurrect headMouse stuff?
|
||||
//_headMouseX = _glWidget->width() / 2;
|
||||
//_headMouseY = _glWidget->height() / 2;
|
||||
_skeletonModel.reset();
|
||||
getHead()->reset();
|
||||
getHand()->reset();
|
||||
|
||||
|
|
|
@ -130,9 +130,16 @@ void Model::init() {
|
|||
}
|
||||
|
||||
void Model::reset() {
|
||||
if (_jointStates.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
foreach (Model* attachment, _attachments) {
|
||||
attachment->reset();
|
||||
}
|
||||
const FBXGeometry& geometry = _geometry->getFBXGeometry();
|
||||
for (int i = 0; i < _jointStates.size(); i++) {
|
||||
_jointStates[i].rotation = geometry.joints.at(i).rotation;
|
||||
}
|
||||
}
|
||||
|
||||
void Model::clearShapes() {
|
||||
|
|
Loading…
Reference in a new issue