mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 07:54:36 +02:00
Updated property in MyAvatar.h
This commit is contained in:
parent
a33bc3722d
commit
5fadfa5275
6 changed files with 2 additions and 21 deletions
|
@ -154,6 +154,7 @@ class MyAvatar : public Avatar {
|
|||
*
|
||||
* @property {Vec3} qmlPosition - A synonym for <code>position</code> for use by QML.
|
||||
*
|
||||
* @property {Vec3} feetPosition - The position of the avatar's feet.
|
||||
* @property {boolean} shouldRenderLocally=true - If <code>true</code> then your avatar is rendered for you in Interface,
|
||||
* otherwise it is not rendered for you (but it is still rendered for other users).
|
||||
* @property {Vec3} motorVelocity=Vec3.ZERO - The target velocity of your avatar to be achieved by a scripted motor.
|
||||
|
@ -340,6 +341,7 @@ class MyAvatar : public Avatar {
|
|||
Q_PROPERTY(QVector3D qmlPosition READ getQmlPosition)
|
||||
QVector3D getQmlPosition() { auto p = getWorldPosition(); return QVector3D(p.x, p.y, p.z); }
|
||||
|
||||
Q_PROPERTY(glm::vec3 feetPosition READ getWorldFeetPosition WRITE goToFeetLocation)
|
||||
Q_PROPERTY(bool shouldRenderLocally READ getShouldRenderLocally WRITE setShouldRenderLocally)
|
||||
Q_PROPERTY(glm::vec3 motorVelocity READ getScriptedMotorVelocity WRITE setScriptedMotorVelocity)
|
||||
Q_PROPERTY(float motorTimescale READ getScriptedMotorTimescale WRITE setScriptedMotorTimescale)
|
||||
|
|
|
@ -1848,13 +1848,6 @@ void Avatar::setPositionViaScript(const glm::vec3& position) {
|
|||
updateAttitude(getWorldOrientation());
|
||||
}
|
||||
|
||||
void Avatar::setFeetPositionViaScript(const glm::vec3& position) {
|
||||
auto feetAjustment = getWorldPosition() - getWorldFeetPosition();
|
||||
auto _goToPosition = position + feetAjustment;
|
||||
setWorldPosition(_goToPosition);
|
||||
updateAttitude(getWorldOrientation());
|
||||
}
|
||||
|
||||
void Avatar::setOrientationViaScript(const glm::quat& orientation) {
|
||||
setWorldOrientation(orientation);
|
||||
updateAttitude(orientation);
|
||||
|
|
|
@ -437,7 +437,6 @@ public:
|
|||
Q_INVOKABLE glm::vec3 getWorldFeetPosition();
|
||||
|
||||
void setPositionViaScript(const glm::vec3& position) override;
|
||||
void setFeetPositionViaScript(const glm::vec3& position) override;
|
||||
void setOrientationViaScript(const glm::quat& orientation) override;
|
||||
|
||||
/**jsdoc
|
||||
|
|
|
@ -488,7 +488,6 @@ class AvatarData : public QObject, public SpatiallyNestable {
|
|||
// IMPORTANT: The JSDoc for the following properties should be copied to MyAvatar.h and ScriptableAvatar.h.
|
||||
/*
|
||||
* @property {Vec3} position - The position of the avatar.
|
||||
* @property {Vec3} feetPosition - The feet position of the avatar.
|
||||
* @property {number} scale=1.0 - The scale of the avatar. The value can be set to anything between <code>0.005</code> and
|
||||
* <code>1000.0</code>. When the scale value is fetched, it may temporarily be further limited by the domain's settings.
|
||||
* @property {number} density - The density of the avatar in kg/m<sup>3</sup>. The density is used to work out its mass in
|
||||
|
@ -537,7 +536,6 @@ class AvatarData : public QObject, public SpatiallyNestable {
|
|||
* <em>Read-only.</em>
|
||||
*/
|
||||
Q_PROPERTY(glm::vec3 position READ getWorldPosition WRITE setPositionViaScript)
|
||||
Q_PROPERTY(glm::vec3 feetPosition READ getWorldFeetPosition WRITE setFeetPositionViaScript)
|
||||
Q_PROPERTY(float scale READ getDomainLimitedScale WRITE setTargetScale)
|
||||
Q_PROPERTY(float density READ getDensity)
|
||||
Q_PROPERTY(glm::vec3 handPosition READ getHandPosition WRITE setHandPosition)
|
||||
|
@ -631,7 +629,6 @@ public:
|
|||
void setBodyRoll(float bodyRoll);
|
||||
|
||||
virtual void setPositionViaScript(const glm::vec3& position);
|
||||
virtual void setFeetPositionViaScript(const glm::vec3& position);
|
||||
virtual void setOrientationViaScript(const glm::quat& orientation);
|
||||
|
||||
virtual void updateAttitude(const glm::quat& orientation) {}
|
||||
|
|
|
@ -31,13 +31,6 @@ glm::vec3 ScriptAvatarData::getPosition() const {
|
|||
return glm::vec3();
|
||||
}
|
||||
}
|
||||
glm::vec3 ScriptAvatarData::getFeetPosition() const {
|
||||
if (AvatarSharedPointer sharedAvatarData = _avatarData.lock()) {
|
||||
return sharedAvatarData->getWorldFeetPosition();
|
||||
} else {
|
||||
return glm::vec3();
|
||||
}
|
||||
}
|
||||
float ScriptAvatarData::getTargetScale() const {
|
||||
if (AvatarSharedPointer sharedAvatarData = _avatarData.lock()) {
|
||||
return sharedAvatarData->getTargetScale();
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
* Information about an avatar.
|
||||
* @typedef {object} AvatarData
|
||||
* @property {Vec3} position - The avatar's position.
|
||||
* @property {Vec3} feetPosition - The avatar's feet position.
|
||||
* @property {number} scale - The target scale of the avatar without any restrictions on permissible values imposed by the
|
||||
* domain.
|
||||
* @property {Vec3} handPosition - A user-defined hand position, in world coordinates. The position moves with the avatar but
|
||||
|
@ -71,7 +70,6 @@ class ScriptAvatarData : public QObject {
|
|||
// PHYSICAL PROPERTIES: POSITION AND ORIENTATION
|
||||
//
|
||||
Q_PROPERTY(glm::vec3 position READ getPosition)
|
||||
Q_PROPERTY(glm::vec3 feetPosition READ getFeetPosition)
|
||||
Q_PROPERTY(float scale READ getTargetScale)
|
||||
Q_PROPERTY(glm::vec3 handPosition READ getHandPosition)
|
||||
Q_PROPERTY(float bodyPitch READ getBodyPitch)
|
||||
|
@ -126,7 +124,6 @@ public:
|
|||
// PHYSICAL PROPERTIES: POSITION AND ORIENTATION
|
||||
//
|
||||
glm::vec3 getPosition() const;
|
||||
glm::vec3 getFeetPosition() const;
|
||||
float getTargetScale() const;
|
||||
glm::vec3 getHandPosition() const;
|
||||
float getBodyPitch() const;
|
||||
|
|
Loading…
Reference in a new issue