mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +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();
|
glPushMatrix();
|
||||||
glm::vec3 textPosition;
|
glm::vec3 textPosition;
|
||||||
getSkeletonModel().getNeckPosition(textPosition);
|
if (getSkeletonModel().getNeckPosition(textPosition)) {
|
||||||
textPosition += getBodyUpDirection() * getHeadHeight() * 1.1f;
|
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);
|
glTranslatef(textPosition.x, textPosition.y, textPosition.z);
|
||||||
|
|
||||||
// we need "always facing camera": we must remove the camera rotation from the stack
|
// 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?
|
// TODO? resurrect headMouse stuff?
|
||||||
//_headMouseX = _glWidget->width() / 2;
|
//_headMouseX = _glWidget->width() / 2;
|
||||||
//_headMouseY = _glWidget->height() / 2;
|
//_headMouseY = _glWidget->height() / 2;
|
||||||
|
_skeletonModel.reset();
|
||||||
getHead()->reset();
|
getHead()->reset();
|
||||||
getHand()->reset();
|
getHand()->reset();
|
||||||
|
|
||||||
|
|
|
@ -130,9 +130,16 @@ void Model::init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Model::reset() {
|
void Model::reset() {
|
||||||
|
if (_jointStates.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach (Model* attachment, _attachments) {
|
foreach (Model* attachment, _attachments) {
|
||||||
attachment->reset();
|
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() {
|
void Model::clearShapes() {
|
||||||
|
|
Loading…
Reference in a new issue