Implemented KRNode::setWorldTranslation()
Implemented KRNode::setWorldRotation() Implemented KRNode::setWorldScale() --HG-- extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%40206
This commit is contained in:
@@ -119,6 +119,36 @@ void KRNode::setLocalTranslation(const KRVector3 &v, bool set_original) {
|
|||||||
}
|
}
|
||||||
invalidateModelMatrix();
|
invalidateModelMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KRNode::setWorldTranslation(const KRVector3 &v)
|
||||||
|
{
|
||||||
|
if(m_parentNode) {
|
||||||
|
setLocalTranslation(KRMat4::Dot(m_parentNode->getInverseModelMatrix(), v));
|
||||||
|
} else {
|
||||||
|
setLocalTranslation(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void KRNode::setWorldRotation(const KRVector3 &v)
|
||||||
|
{
|
||||||
|
if(m_parentNode) {
|
||||||
|
setLocalRotation(KRMat4::DotNoTranslate(m_parentNode->getInverseModelMatrix(), v));
|
||||||
|
} else {
|
||||||
|
setLocalRotation(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void KRNode::setWorldScale(const KRVector3 &v)
|
||||||
|
{
|
||||||
|
if(m_parentNode) {
|
||||||
|
setLocalScale(KRMat4::DotNoTranslate(m_parentNode->getInverseModelMatrix(), v));
|
||||||
|
} else {
|
||||||
|
setLocalScale(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void KRNode::setLocalScale(const KRVector3 &v, bool set_original) {
|
void KRNode::setLocalScale(const KRVector3 &v, bool set_original) {
|
||||||
m_localScale = v;
|
m_localScale = v;
|
||||||
if(set_original) {
|
if(set_original) {
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ public:
|
|||||||
const KRVector3 getWorldScale();
|
const KRVector3 getWorldScale();
|
||||||
const KRVector3 getWorldRotation();
|
const KRVector3 getWorldRotation();
|
||||||
|
|
||||||
|
void setWorldTranslation(const KRVector3 &v);
|
||||||
|
void setWorldScale(const KRVector3 &v);
|
||||||
|
void setWorldRotation(const KRVector3 &v);
|
||||||
|
|
||||||
virtual KRAABB getBounds();
|
virtual KRAABB getBounds();
|
||||||
const KRMat4 &getModelMatrix();
|
const KRMat4 &getModelMatrix();
|
||||||
const KRMat4 &getInverseModelMatrix();
|
const KRMat4 &getInverseModelMatrix();
|
||||||
|
|||||||
Reference in New Issue
Block a user