mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Some code cleanup
This commit is contained in:
parent
42742ba1f9
commit
e6fd85f45a
3 changed files with 21 additions and 7 deletions
|
@ -89,10 +89,10 @@ Preference {
|
|||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
onClicked: {
|
||||
if(box1.checked) {
|
||||
if (box1.checked) {
|
||||
box1.checked = false;
|
||||
}
|
||||
if(!box1.checked && !box2.checked) {
|
||||
if (!box1.checked && !box2.checked) {
|
||||
box2.checked = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,9 @@ const float MIN_AVATAR_SPEED_SQUARED = MIN_AVATAR_SPEED * MIN_AVATAR_SPEED; // s
|
|||
const float YAW_SPEED_DEFAULT = 120.0f; // degrees/sec
|
||||
const float PITCH_SPEED_DEFAULT = 90.0f; // degrees/sec
|
||||
|
||||
const QString DOMINANT_HAND_LEFT = "left";
|
||||
const QString DOMINANT_HAND_RIGHT = "right";
|
||||
|
||||
// TODO: normalize avatar speed for standard avatar size, then scale all motion logic
|
||||
// to properly follow avatar size.
|
||||
float MAX_AVATAR_SPEED = 30.0f;
|
||||
|
@ -87,6 +90,9 @@ const float MyAvatar::ZOOM_MIN = 0.5f;
|
|||
const float MyAvatar::ZOOM_MAX = 25.0f;
|
||||
const float MyAvatar::ZOOM_DEFAULT = 1.5f;
|
||||
|
||||
const QString& DOMINANT_LEFT_HAND = "left";
|
||||
const QString& DOMINANT_RIGHT_HAND = "right";
|
||||
|
||||
// default values, used when avatar is missing joints... (avatar space)
|
||||
static const glm::quat DEFAULT_AVATAR_MIDDLE_EYE_ROT { Quaternions::Y_180 };
|
||||
static const glm::vec3 DEFAULT_AVATAR_MIDDLE_EYE_POS { 0.0f, 0.6f, 0.0f };
|
||||
|
@ -255,6 +261,12 @@ MyAvatar::~MyAvatar() {
|
|||
_lookAtTargetAvatar.reset();
|
||||
}
|
||||
|
||||
void MyAvatar::setDominantHand(const QString& hand) {
|
||||
if (hand == DOMINANT_HAND_LEFT || hand == DOMINANT_HAND_RIGHT) {
|
||||
_dominantHand = hand;
|
||||
}
|
||||
}
|
||||
|
||||
void MyAvatar::registerMetaTypes(QScriptEngine* engine) {
|
||||
QScriptValue value = engine->newQObject(this, QScriptEngine::QtOwnership, QScriptEngine::ExcludeDeleteLater | QScriptEngine::ExcludeChildObjects);
|
||||
engine->globalObject().setProperty("MyAvatar", value);
|
||||
|
|
|
@ -43,6 +43,12 @@ enum AudioListenerMode {
|
|||
FROM_CAMERA,
|
||||
CUSTOM
|
||||
};
|
||||
|
||||
enum DominantHand {
|
||||
LEFT_HAND,
|
||||
RIGHT_HAND
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(AudioListenerMode);
|
||||
|
||||
class MyAvatar : public Avatar {
|
||||
|
@ -339,11 +345,7 @@ public:
|
|||
Q_INVOKABLE bool getClearOverlayWhenMoving() const { return _clearOverlayWhenMoving; }
|
||||
Q_INVOKABLE void setClearOverlayWhenMoving(bool on) { _clearOverlayWhenMoving = on; }
|
||||
|
||||
Q_INVOKABLE void setDominantHand(const QString& hand) {
|
||||
if (hand == "left" || hand == "right") {
|
||||
_dominantHand = hand;
|
||||
}
|
||||
}
|
||||
Q_INVOKABLE void setDominantHand(const QString& hand);
|
||||
|
||||
Q_INVOKABLE QString getDominantHand() const { return _dominantHand; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue