mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
add interface for getters for specific joints
This commit is contained in:
parent
4ffaa7db8e
commit
0b1fa4f60f
3 changed files with 43 additions and 3 deletions
|
@ -107,8 +107,8 @@ public:
|
|||
Q_INVOKABLE void setEngineMaxDrawnOverlay3DItems(int count) { _maxDrawnOverlay3DItems = count; }
|
||||
Q_INVOKABLE int getEngineMaxDrawnOverlay3DItems() { return _maxDrawnOverlay3DItems; }
|
||||
|
||||
Q_INVOKABLE void setEngineDisplayItemStatus(bool display) { _drawItemStatus = display; }
|
||||
Q_INVOKABLE bool doEngineDisplayItemStatus() { return _drawItemStatus; }
|
||||
Q_INVOKABLE void setEngineDisplayItemStatus(uint32_t display) { _drawItemStatus = display; }
|
||||
Q_INVOKABLE uint32_t doEngineDisplayItemStatus() { return _drawItemStatus; }
|
||||
|
||||
Q_INVOKABLE void setEngineDisplayHitEffect(bool display) { _drawHitEffect = display; }
|
||||
Q_INVOKABLE bool doEngineDisplayHitEffect() { return _drawHitEffect; }
|
||||
|
@ -143,7 +143,7 @@ protected:
|
|||
int _maxDrawnTransparentItems = -1;
|
||||
int _maxDrawnOverlay3DItems = -1;
|
||||
|
||||
bool _drawItemStatus = false;
|
||||
uint32_t _drawItemStatus = false;
|
||||
|
||||
bool _drawHitEffect = false;
|
||||
|
||||
|
|
|
@ -121,6 +121,12 @@ const glm::vec3& SpatiallyNestable::getPosition() const {
|
|||
return _absolutePositionCache;
|
||||
}
|
||||
|
||||
const glm::vec3& SpatiallyNestable::getPosition(int jointIndex) const {
|
||||
getTransform(); // update _worldTransformCache
|
||||
// XXX ... something with joints
|
||||
return _absolutePositionCache;
|
||||
}
|
||||
|
||||
void SpatiallyNestable::setPosition(const glm::vec3& position) {
|
||||
Transform parentTransform = getParentTransform();
|
||||
Transform myWorldTransform;
|
||||
|
@ -135,6 +141,11 @@ const glm::quat& SpatiallyNestable::getOrientation() const {
|
|||
return _absoluteRotationCache;
|
||||
}
|
||||
|
||||
const glm::quat& SpatiallyNestable::getOrientation(int jointIndex) const {
|
||||
// XXX something with joints...
|
||||
return getOrientation();
|
||||
}
|
||||
|
||||
void SpatiallyNestable::setOrientation(const glm::quat& orientation) {
|
||||
Transform parentTransform = getParentTransform();
|
||||
Transform myWorldTransform;
|
||||
|
@ -149,6 +160,12 @@ const Transform& SpatiallyNestable::getTransform() const {
|
|||
return _worldTransformCache;
|
||||
}
|
||||
|
||||
const Transform& SpatiallyNestable::getTransform(int jointIndex) const {
|
||||
getTransform(); // update _worldTransformCache
|
||||
// XXX ... something with joints
|
||||
return _worldTransformCache;
|
||||
}
|
||||
|
||||
void SpatiallyNestable::setTransform(const Transform& transform) {
|
||||
Transform parentTransform = getParentTransform();
|
||||
Transform::inverseMult(_transform, parentTransform, transform);
|
||||
|
@ -158,6 +175,11 @@ const glm::vec3& SpatiallyNestable::getScale() const {
|
|||
return _transform.getScale();
|
||||
}
|
||||
|
||||
const glm::vec3& SpatiallyNestable::getScale(int jointIndex) const {
|
||||
// XXX ... something with joints
|
||||
return getScale();
|
||||
}
|
||||
|
||||
void SpatiallyNestable::setScale(const glm::vec3& scale) {
|
||||
_transform.setScale(scale);
|
||||
}
|
||||
|
@ -204,3 +226,11 @@ QList<SpatiallyNestablePointer> SpatiallyNestable::getChildren() const {
|
|||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
const Transform& SpatiallyNestable::getJointTransformInObjectFrame(int jointIndex) const {
|
||||
_jointInObjectFrameCache.resize(jointIndex);
|
||||
// XXX
|
||||
_jointInObjectFrameCache[jointIndex] = Transform();
|
||||
return _jointInObjectFrameCache[jointIndex];
|
||||
}
|
||||
|
|
|
@ -59,11 +59,17 @@ public:
|
|||
virtual void setPosition(const glm::vec3& position);
|
||||
|
||||
virtual const glm::quat& getOrientation() const;
|
||||
virtual const glm::quat& getOrientation(int jointIndex) const;
|
||||
virtual void setOrientation(const glm::quat& orientation);
|
||||
|
||||
virtual const glm::vec3& getScale() const;
|
||||
virtual void setScale(const glm::vec3& scale);
|
||||
|
||||
// get world location of a specific joint
|
||||
virtual const Transform& getTransform(int jointIndex) const;
|
||||
virtual const glm::vec3& getPosition(int jointIndex) const;
|
||||
virtual const glm::vec3& getScale(int jointIndex) const;
|
||||
|
||||
// object's parent's frame
|
||||
virtual const Transform& getLocalTransform() const;
|
||||
virtual void setLocalTransform(const Transform& transform);
|
||||
|
@ -80,6 +86,9 @@ public:
|
|||
QList<SpatiallyNestablePointer> getChildren() const;
|
||||
NestableTypes::NestableType getNestableType() const { return _nestableType; }
|
||||
|
||||
// this object's frame
|
||||
virtual const Transform& getJointTransformInObjectFrame(int jointIndex) const;
|
||||
|
||||
protected:
|
||||
NestableTypes::NestableType _nestableType; // EntityItem or an AvatarData
|
||||
QUuid _id;
|
||||
|
@ -102,6 +111,7 @@ private:
|
|||
mutable glm::quat _absoluteRotationCache;
|
||||
mutable Transform _worldTransformCache;
|
||||
mutable bool _parentKnowsMe = false;
|
||||
mutable QVector<Transform> _jointInObjectFrameCache;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue