Implemented KRNode::getWorldRotation()

Implemented KRNode::getWorldScale()
Implemented KRNode::getWorldTranslation()

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%40204
This commit is contained in:
kearwood
2013-01-03 21:42:50 +00:00
parent 4b8302b794
commit 86d5a4e6a6
2 changed files with 10 additions and 9 deletions

View File

@@ -157,14 +157,15 @@ const KRVector3 &KRNode::getInitialLocalRotation() {
return m_initialLocalRotation; return m_initialLocalRotation;
} }
const KRVector3 &KRNode::getWorldTranslation() { const KRVector3 KRNode::getWorldTranslation() {
return m_localTranslation; return KRMat4::Dot(getModelMatrix(), KRVector3::Zero());
} }
const KRVector3 &KRNode::getWorldScale() {
return m_localScale; const KRVector3 KRNode::getWorldScale() {
return KRMat4::DotNoTranslate(getModelMatrix(), m_localScale);
} }
const KRVector3 &KRNode::getWorldRotation() { const KRVector3 KRNode::getWorldRotation() {
return m_localRotation; return KRMat4::DotNoTranslate(getModelMatrix(), m_localRotation);
} }
std::string KRNode::getElementName() { std::string KRNode::getElementName() {

View File

@@ -65,9 +65,9 @@ public:
const KRVector3 &getInitialLocalScale(); const KRVector3 &getInitialLocalScale();
const KRVector3 &getInitialLocalRotation(); const KRVector3 &getInitialLocalRotation();
const KRVector3 &getWorldTranslation(); const KRVector3 getWorldTranslation();
const KRVector3 &getWorldScale(); const KRVector3 getWorldScale();
const KRVector3 &getWorldRotation(); const KRVector3 getWorldRotation();
virtual KRAABB getBounds(); virtual KRAABB getBounds();
const KRMat4 &getModelMatrix(); const KRMat4 &getModelMatrix();