/s/KRVector3/Vector3/g
This commit is contained in:
@@ -28,28 +28,28 @@
|
||||
KRNode::KRNode(KRScene &scene, std::string name) : KRContextObject(scene.getContext())
|
||||
{
|
||||
m_name = name;
|
||||
m_localScale = KRVector3::One();
|
||||
m_localRotation = KRVector3::Zero();
|
||||
m_localTranslation = KRVector3::Zero();
|
||||
m_localScale = Vector3::One();
|
||||
m_localRotation = Vector3::Zero();
|
||||
m_localTranslation = Vector3::Zero();
|
||||
m_initialLocalTranslation = m_localTranslation;
|
||||
m_initialLocalScale = m_localScale;
|
||||
m_initialLocalRotation = m_localRotation;
|
||||
|
||||
|
||||
|
||||
m_rotationOffset = KRVector3::Zero();
|
||||
m_scalingOffset = KRVector3::Zero();
|
||||
m_rotationPivot = KRVector3::Zero();
|
||||
m_scalingPivot = KRVector3::Zero();
|
||||
m_preRotation = KRVector3::Zero();
|
||||
m_postRotation = KRVector3::Zero();
|
||||
m_rotationOffset = Vector3::Zero();
|
||||
m_scalingOffset = Vector3::Zero();
|
||||
m_rotationPivot = Vector3::Zero();
|
||||
m_scalingPivot = Vector3::Zero();
|
||||
m_preRotation = Vector3::Zero();
|
||||
m_postRotation = Vector3::Zero();
|
||||
|
||||
m_initialRotationOffset = KRVector3::Zero();
|
||||
m_initialScalingOffset = KRVector3::Zero();
|
||||
m_initialRotationPivot = KRVector3::Zero();
|
||||
m_initialScalingPivot = KRVector3::Zero();
|
||||
m_initialPreRotation = KRVector3::Zero();
|
||||
m_initialPostRotation = KRVector3::Zero();
|
||||
m_initialRotationOffset = Vector3::Zero();
|
||||
m_initialScalingOffset = Vector3::Zero();
|
||||
m_initialRotationPivot = Vector3::Zero();
|
||||
m_initialScalingPivot = Vector3::Zero();
|
||||
m_initialPreRotation = Vector3::Zero();
|
||||
m_initialPostRotation = Vector3::Zero();
|
||||
|
||||
m_parentNode = NULL;
|
||||
m_pScene = &scene;
|
||||
@@ -123,15 +123,15 @@ tinyxml2::XMLElement *KRNode::saveXML(tinyxml2::XMLNode *parent) {
|
||||
tinyxml2::XMLElement *e = doc->NewElement(getElementName().c_str());
|
||||
tinyxml2::XMLNode *n = parent->InsertEndChild(e);
|
||||
e->SetAttribute("name", m_name.c_str());
|
||||
kraken::setXMLAttribute("translate", e, m_localTranslation, KRVector3::Zero());
|
||||
kraken::setXMLAttribute("scale", e, m_localScale, KRVector3::One());
|
||||
kraken::setXMLAttribute("rotate", e, (m_localRotation * (180.0f / M_PI)), KRVector3::Zero());
|
||||
kraken::setXMLAttribute("rotate_offset", e, m_rotationOffset, KRVector3::Zero());
|
||||
kraken::setXMLAttribute("scale_offset", e, m_scalingOffset, KRVector3::Zero());
|
||||
kraken::setXMLAttribute("rotate_pivot", e, m_rotationPivot, KRVector3::Zero());
|
||||
kraken::setXMLAttribute("scale_pivot", e, m_scalingPivot, KRVector3::Zero());
|
||||
kraken::setXMLAttribute("pre_rotate", e, (m_preRotation * (180.0f / M_PI)), KRVector3::Zero());
|
||||
kraken::setXMLAttribute("post_rotate", e, (m_postRotation * (180.0f / M_PI)), KRVector3::Zero());
|
||||
kraken::setXMLAttribute("translate", e, m_localTranslation, Vector3::Zero());
|
||||
kraken::setXMLAttribute("scale", e, m_localScale, Vector3::One());
|
||||
kraken::setXMLAttribute("rotate", e, (m_localRotation * (180.0f / M_PI)), Vector3::Zero());
|
||||
kraken::setXMLAttribute("rotate_offset", e, m_rotationOffset, Vector3::Zero());
|
||||
kraken::setXMLAttribute("scale_offset", e, m_scalingOffset, Vector3::Zero());
|
||||
kraken::setXMLAttribute("rotate_pivot", e, m_rotationPivot, Vector3::Zero());
|
||||
kraken::setXMLAttribute("scale_pivot", e, m_scalingPivot, Vector3::Zero());
|
||||
kraken::setXMLAttribute("pre_rotate", e, (m_preRotation * (180.0f / M_PI)), Vector3::Zero());
|
||||
kraken::setXMLAttribute("post_rotate", e, (m_postRotation * (180.0f / M_PI)), Vector3::Zero());
|
||||
|
||||
for(std::set<KRNode *>::iterator itr=m_childNodes.begin(); itr != m_childNodes.end(); ++itr) {
|
||||
KRNode *child = (*itr);
|
||||
@@ -142,19 +142,19 @@ tinyxml2::XMLElement *KRNode::saveXML(tinyxml2::XMLNode *parent) {
|
||||
|
||||
void KRNode::loadXML(tinyxml2::XMLElement *e) {
|
||||
m_name = e->Attribute("name");
|
||||
m_localTranslation = kraken::getXMLAttribute("translate", e, KRVector3::Zero());
|
||||
m_localScale = kraken::getXMLAttribute("scale", e, KRVector3::One());
|
||||
m_localRotation = kraken::getXMLAttribute("rotate", e, KRVector3::Zero());
|
||||
m_localTranslation = kraken::getXMLAttribute("translate", e, Vector3::Zero());
|
||||
m_localScale = kraken::getXMLAttribute("scale", e, Vector3::One());
|
||||
m_localRotation = kraken::getXMLAttribute("rotate", e, Vector3::Zero());
|
||||
m_localRotation *= M_PI / 180.0f; // Convert degrees to radians
|
||||
m_preRotation = kraken::getXMLAttribute("pre_rotate", e, KRVector3::Zero());
|
||||
m_preRotation = kraken::getXMLAttribute("pre_rotate", e, Vector3::Zero());
|
||||
m_preRotation *= M_PI / 180.0f; // Convert degrees to radians
|
||||
m_postRotation = kraken::getXMLAttribute("post_rotate", e, KRVector3::Zero());
|
||||
m_postRotation = kraken::getXMLAttribute("post_rotate", e, Vector3::Zero());
|
||||
m_postRotation *= M_PI / 180.0f; // Convert degrees to radians
|
||||
|
||||
m_rotationOffset = kraken::getXMLAttribute("rotate_offset", e, KRVector3::Zero());
|
||||
m_scalingOffset = kraken::getXMLAttribute("scale_offset", e, KRVector3::Zero());
|
||||
m_rotationPivot = kraken::getXMLAttribute("rotate_pivot", e, KRVector3::Zero());
|
||||
m_scalingPivot = kraken::getXMLAttribute("scale_pivot", e, KRVector3::Zero());
|
||||
m_rotationOffset = kraken::getXMLAttribute("rotate_offset", e, Vector3::Zero());
|
||||
m_scalingOffset = kraken::getXMLAttribute("scale_offset", e, Vector3::Zero());
|
||||
m_rotationPivot = kraken::getXMLAttribute("rotate_pivot", e, Vector3::Zero());
|
||||
m_scalingPivot = kraken::getXMLAttribute("scale_pivot", e, Vector3::Zero());
|
||||
|
||||
m_initialLocalTranslation = m_localTranslation;
|
||||
m_initialLocalScale = m_localScale;
|
||||
@@ -191,7 +191,7 @@ void KRNode::loadXML(tinyxml2::XMLElement *e) {
|
||||
}
|
||||
}
|
||||
|
||||
void KRNode::setLocalTranslation(const KRVector3 &v, bool set_original) {
|
||||
void KRNode::setLocalTranslation(const Vector3 &v, bool set_original) {
|
||||
m_localTranslation = v;
|
||||
if(set_original) {
|
||||
m_initialLocalTranslation = v;
|
||||
@@ -200,7 +200,7 @@ void KRNode::setLocalTranslation(const KRVector3 &v, bool set_original) {
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
|
||||
void KRNode::setWorldTranslation(const KRVector3 &v)
|
||||
void KRNode::setWorldTranslation(const Vector3 &v)
|
||||
{
|
||||
if(m_parentNode) {
|
||||
setLocalTranslation(KRMat4::Dot(m_parentNode->getInverseModelMatrix(), v));
|
||||
@@ -210,21 +210,21 @@ void KRNode::setWorldTranslation(const KRVector3 &v)
|
||||
}
|
||||
|
||||
|
||||
void KRNode::setWorldRotation(const KRVector3 &v)
|
||||
void KRNode::setWorldRotation(const Vector3 &v)
|
||||
{
|
||||
if(m_parentNode) {
|
||||
setLocalRotation((KRQuaternion(v) * -m_parentNode->getWorldRotation()).eulerXYZ());
|
||||
setPreRotation(KRVector3::Zero());
|
||||
setPostRotation(KRVector3::Zero());
|
||||
setPreRotation(Vector3::Zero());
|
||||
setPostRotation(Vector3::Zero());
|
||||
} else {
|
||||
setLocalRotation(v);
|
||||
setPreRotation(KRVector3::Zero());
|
||||
setPostRotation(KRVector3::Zero());
|
||||
setPreRotation(Vector3::Zero());
|
||||
setPostRotation(Vector3::Zero());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KRNode::setWorldScale(const KRVector3 &v)
|
||||
void KRNode::setWorldScale(const Vector3 &v)
|
||||
{
|
||||
if(m_parentNode) {
|
||||
setLocalScale(KRMat4::DotNoTranslate(m_parentNode->getInverseModelMatrix(), v));
|
||||
@@ -233,7 +233,7 @@ void KRNode::setWorldScale(const KRVector3 &v)
|
||||
}
|
||||
}
|
||||
|
||||
void KRNode::setLocalScale(const KRVector3 &v, bool set_original) {
|
||||
void KRNode::setLocalScale(const Vector3 &v, bool set_original) {
|
||||
m_localScale = v;
|
||||
if(set_original) {
|
||||
m_initialLocalScale = v;
|
||||
@@ -242,7 +242,7 @@ void KRNode::setLocalScale(const KRVector3 &v, bool set_original) {
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
|
||||
void KRNode::setLocalRotation(const KRVector3 &v, bool set_original) {
|
||||
void KRNode::setLocalRotation(const Vector3 &v, bool set_original) {
|
||||
m_localRotation = v;
|
||||
if(set_original) {
|
||||
m_initialLocalRotation = v;
|
||||
@@ -252,7 +252,7 @@ void KRNode::setLocalRotation(const KRVector3 &v, bool set_original) {
|
||||
}
|
||||
|
||||
|
||||
void KRNode::setRotationOffset(const KRVector3 &v, bool set_original)
|
||||
void KRNode::setRotationOffset(const Vector3 &v, bool set_original)
|
||||
{
|
||||
m_rotationOffset = v;
|
||||
if(set_original) {
|
||||
@@ -262,7 +262,7 @@ void KRNode::setRotationOffset(const KRVector3 &v, bool set_original)
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
|
||||
void KRNode::setScalingOffset(const KRVector3 &v, bool set_original)
|
||||
void KRNode::setScalingOffset(const Vector3 &v, bool set_original)
|
||||
{
|
||||
m_scalingOffset = v;
|
||||
if(set_original) {
|
||||
@@ -272,7 +272,7 @@ void KRNode::setScalingOffset(const KRVector3 &v, bool set_original)
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
|
||||
void KRNode::setRotationPivot(const KRVector3 &v, bool set_original)
|
||||
void KRNode::setRotationPivot(const Vector3 &v, bool set_original)
|
||||
{
|
||||
m_rotationPivot = v;
|
||||
if(set_original) {
|
||||
@@ -281,7 +281,7 @@ void KRNode::setRotationPivot(const KRVector3 &v, bool set_original)
|
||||
}
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
void KRNode::setScalingPivot(const KRVector3 &v, bool set_original)
|
||||
void KRNode::setScalingPivot(const Vector3 &v, bool set_original)
|
||||
{
|
||||
m_scalingPivot = v;
|
||||
if(set_original) {
|
||||
@@ -290,7 +290,7 @@ void KRNode::setScalingPivot(const KRVector3 &v, bool set_original)
|
||||
}
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
void KRNode::setPreRotation(const KRVector3 &v, bool set_original)
|
||||
void KRNode::setPreRotation(const Vector3 &v, bool set_original)
|
||||
{
|
||||
m_preRotation = v;
|
||||
if(set_original) {
|
||||
@@ -299,7 +299,7 @@ void KRNode::setPreRotation(const KRVector3 &v, bool set_original)
|
||||
}
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
void KRNode::setPostRotation(const KRVector3 &v, bool set_original)
|
||||
void KRNode::setPostRotation(const Vector3 &v, bool set_original)
|
||||
{
|
||||
m_postRotation = v;
|
||||
if(set_original) {
|
||||
@@ -309,80 +309,80 @@ void KRNode::setPostRotation(const KRVector3 &v, bool set_original)
|
||||
invalidateModelMatrix();
|
||||
}
|
||||
|
||||
const KRVector3 &KRNode::getRotationOffset()
|
||||
const Vector3 &KRNode::getRotationOffset()
|
||||
{
|
||||
return m_rotationOffset;
|
||||
}
|
||||
const KRVector3 &KRNode::getScalingOffset()
|
||||
const Vector3 &KRNode::getScalingOffset()
|
||||
{
|
||||
return m_scalingOffset;
|
||||
}
|
||||
const KRVector3 &KRNode::getRotationPivot()
|
||||
const Vector3 &KRNode::getRotationPivot()
|
||||
{
|
||||
return m_rotationPivot;
|
||||
}
|
||||
const KRVector3 &KRNode::getScalingPivot()
|
||||
const Vector3 &KRNode::getScalingPivot()
|
||||
{
|
||||
return m_scalingPivot;
|
||||
}
|
||||
const KRVector3 &KRNode::getPreRotation()
|
||||
const Vector3 &KRNode::getPreRotation()
|
||||
{
|
||||
return m_preRotation;
|
||||
}
|
||||
const KRVector3 &KRNode::getPostRotation()
|
||||
const Vector3 &KRNode::getPostRotation()
|
||||
{
|
||||
return m_postRotation;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialRotationOffset()
|
||||
const Vector3 &KRNode::getInitialRotationOffset()
|
||||
{
|
||||
return m_initialRotationOffset;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialScalingOffset()
|
||||
const Vector3 &KRNode::getInitialScalingOffset()
|
||||
{
|
||||
return m_initialScalingOffset;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialRotationPivot()
|
||||
const Vector3 &KRNode::getInitialRotationPivot()
|
||||
{
|
||||
return m_initialRotationPivot;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialScalingPivot()
|
||||
const Vector3 &KRNode::getInitialScalingPivot()
|
||||
{
|
||||
return m_initialScalingPivot;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialPreRotation()
|
||||
const Vector3 &KRNode::getInitialPreRotation()
|
||||
{
|
||||
return m_initialPreRotation;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialPostRotation()
|
||||
const Vector3 &KRNode::getInitialPostRotation()
|
||||
{
|
||||
return m_initialPostRotation;
|
||||
}
|
||||
|
||||
const KRVector3 &KRNode::getLocalTranslation() {
|
||||
const Vector3 &KRNode::getLocalTranslation() {
|
||||
return m_localTranslation;
|
||||
}
|
||||
const KRVector3 &KRNode::getLocalScale() {
|
||||
const Vector3 &KRNode::getLocalScale() {
|
||||
return m_localScale;
|
||||
}
|
||||
const KRVector3 &KRNode::getLocalRotation() {
|
||||
const Vector3 &KRNode::getLocalRotation() {
|
||||
return m_localRotation;
|
||||
}
|
||||
|
||||
const KRVector3 &KRNode::getInitialLocalTranslation() {
|
||||
const Vector3 &KRNode::getInitialLocalTranslation() {
|
||||
return m_initialLocalTranslation;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialLocalScale() {
|
||||
const Vector3 &KRNode::getInitialLocalScale() {
|
||||
return m_initialLocalScale;
|
||||
}
|
||||
const KRVector3 &KRNode::getInitialLocalRotation() {
|
||||
const Vector3 &KRNode::getInitialLocalRotation() {
|
||||
return m_initialLocalRotation;
|
||||
}
|
||||
|
||||
const KRVector3 KRNode::getWorldTranslation() {
|
||||
return localToWorld(KRVector3::Zero());
|
||||
const Vector3 KRNode::getWorldTranslation() {
|
||||
return localToWorld(Vector3::Zero());
|
||||
}
|
||||
|
||||
const KRVector3 KRNode::getWorldScale() {
|
||||
const Vector3 KRNode::getWorldScale() {
|
||||
return KRMat4::DotNoTranslate(getModelMatrix(), m_localScale);
|
||||
}
|
||||
|
||||
@@ -427,8 +427,8 @@ KRNode *KRNode::LoadXML(KRScene &scene, tinyxml2::XMLElement *e) {
|
||||
if(e->QueryFloatAttribute("rim_power", &rim_power) != tinyxml2::XML_SUCCESS) {
|
||||
rim_power = 0.0f;
|
||||
}
|
||||
KRVector3 rim_color = KRVector3::Zero();
|
||||
rim_color = kraken::getXMLAttribute("rim_color", e, KRVector3::Zero());
|
||||
Vector3 rim_color = Vector3::Zero();
|
||||
rim_color = kraken::getXMLAttribute("rim_color", e, Vector3::Zero());
|
||||
new_node = new KRModel(scene, szName, e->Attribute("mesh"), e->Attribute("light_map"), lod_min_coverage, receives_shadow, faces_camera, rim_color, rim_power);
|
||||
} else if(strcmp(szElementName, "collider") == 0) {
|
||||
new_node = new KRCollider(scene, szName, e->Attribute("mesh"), 65535, 1.0f);
|
||||
@@ -768,87 +768,87 @@ void KRNode::SetAttribute(node_attribute_type attrib, float v)
|
||||
//printf("%s - ", m_name.c_str());
|
||||
switch(attrib) {
|
||||
case KRENGINE_NODE_ATTRIBUTE_TRANSLATE_X:
|
||||
setLocalTranslation(KRVector3(v, m_localTranslation.y, m_localTranslation.z));
|
||||
setLocalTranslation(Vector3(v, m_localTranslation.y, m_localTranslation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_TRANSLATE_Y:
|
||||
setLocalTranslation(KRVector3(m_localTranslation.x, v, m_localTranslation.z));
|
||||
setLocalTranslation(Vector3(m_localTranslation.x, v, m_localTranslation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_TRANSLATE_Z:
|
||||
setLocalTranslation(KRVector3(m_localTranslation.x, m_localTranslation.y, v));
|
||||
setLocalTranslation(Vector3(m_localTranslation.x, m_localTranslation.y, v));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_SCALE_X:
|
||||
setLocalScale(KRVector3(v, m_localScale.y, m_localScale.z));
|
||||
setLocalScale(Vector3(v, m_localScale.y, m_localScale.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_SCALE_Y:
|
||||
setLocalScale(KRVector3(m_localScale.x, v, m_localScale.z));
|
||||
setLocalScale(Vector3(m_localScale.x, v, m_localScale.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_SCALE_Z:
|
||||
setLocalScale(KRVector3(m_localScale.x, m_localScale.y, v));
|
||||
setLocalScale(Vector3(m_localScale.x, m_localScale.y, v));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATE_X:
|
||||
setLocalRotation(KRVector3(v * DEGREES_TO_RAD, m_localRotation.y, m_localRotation.z));
|
||||
setLocalRotation(Vector3(v * DEGREES_TO_RAD, m_localRotation.y, m_localRotation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATE_Y:
|
||||
setLocalRotation(KRVector3(m_localRotation.x, v * DEGREES_TO_RAD, m_localRotation.z));
|
||||
setLocalRotation(Vector3(m_localRotation.x, v * DEGREES_TO_RAD, m_localRotation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATE_Z:
|
||||
setLocalRotation(KRVector3(m_localRotation.x, m_localRotation.y, v * DEGREES_TO_RAD));
|
||||
setLocalRotation(Vector3(m_localRotation.x, m_localRotation.y, v * DEGREES_TO_RAD));
|
||||
break;
|
||||
|
||||
|
||||
case KRENGINE_NODE_ATTRIBUTE_PRE_ROTATION_X:
|
||||
setPreRotation(KRVector3(v * DEGREES_TO_RAD, m_preRotation.y, m_preRotation.z));
|
||||
setPreRotation(Vector3(v * DEGREES_TO_RAD, m_preRotation.y, m_preRotation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_PRE_ROTATION_Y:
|
||||
setPreRotation(KRVector3(m_preRotation.x, v * DEGREES_TO_RAD, m_preRotation.z));
|
||||
setPreRotation(Vector3(m_preRotation.x, v * DEGREES_TO_RAD, m_preRotation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_PRE_ROTATION_Z:
|
||||
setPreRotation(KRVector3(m_preRotation.x, m_preRotation.y, v * DEGREES_TO_RAD));
|
||||
setPreRotation(Vector3(m_preRotation.x, m_preRotation.y, v * DEGREES_TO_RAD));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_POST_ROTATION_X:
|
||||
setPostRotation(KRVector3(v * DEGREES_TO_RAD, m_postRotation.y, m_postRotation.z));
|
||||
setPostRotation(Vector3(v * DEGREES_TO_RAD, m_postRotation.y, m_postRotation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_POST_ROTATION_Y:
|
||||
setPostRotation(KRVector3(m_postRotation.x, v * DEGREES_TO_RAD, m_postRotation.z));
|
||||
setPostRotation(Vector3(m_postRotation.x, v * DEGREES_TO_RAD, m_postRotation.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_POST_ROTATION_Z:
|
||||
setPostRotation(KRVector3(m_postRotation.x, m_postRotation.y, v * DEGREES_TO_RAD));
|
||||
setPostRotation(Vector3(m_postRotation.x, m_postRotation.y, v * DEGREES_TO_RAD));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATION_PIVOT_X:
|
||||
setRotationPivot(KRVector3(v, m_rotationPivot.y, m_rotationPivot.z));
|
||||
setRotationPivot(Vector3(v, m_rotationPivot.y, m_rotationPivot.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATION_PIVOT_Y:
|
||||
setRotationPivot(KRVector3(m_rotationPivot.x, v, m_rotationPivot.z));
|
||||
setRotationPivot(Vector3(m_rotationPivot.x, v, m_rotationPivot.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATION_PIVOT_Z:
|
||||
setRotationPivot(KRVector3(m_rotationPivot.x, m_rotationPivot.y, v));
|
||||
setRotationPivot(Vector3(m_rotationPivot.x, m_rotationPivot.y, v));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_SCALE_PIVOT_X:
|
||||
setScalingPivot(KRVector3(v, m_scalingPivot.y, m_scalingPivot.z));
|
||||
setScalingPivot(Vector3(v, m_scalingPivot.y, m_scalingPivot.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_SCALE_PIVOT_Y:
|
||||
setScalingPivot(KRVector3(m_scalingPivot.x, v, m_scalingPivot.z));
|
||||
setScalingPivot(Vector3(m_scalingPivot.x, v, m_scalingPivot.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_SCALE_PIVOT_Z:
|
||||
setScalingPivot(KRVector3(m_scalingPivot.x, m_scalingPivot.y, v));
|
||||
setScalingPivot(Vector3(m_scalingPivot.x, m_scalingPivot.y, v));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATE_OFFSET_X:
|
||||
setRotationOffset(KRVector3(v, m_rotationOffset.y, m_rotationOffset.z));
|
||||
setRotationOffset(Vector3(v, m_rotationOffset.y, m_rotationOffset.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATE_OFFSET_Y:
|
||||
setRotationOffset(KRVector3(m_rotationOffset.x, v, m_rotationOffset.z));
|
||||
setRotationOffset(Vector3(m_rotationOffset.x, v, m_rotationOffset.z));
|
||||
break;
|
||||
case KRENGINE_NODE_ATTRIBUTE_ROTATE_OFFSET_Z:
|
||||
setRotationOffset(KRVector3(m_rotationOffset.x, m_rotationOffset.y, v));
|
||||
setRotationOffset(Vector3(m_rotationOffset.x, m_rotationOffset.y, v));
|
||||
break;
|
||||
case KRENGINE_NODE_SCALE_OFFSET_X:
|
||||
setScalingOffset(KRVector3(v, m_scalingOffset.y, m_scalingOffset.z));
|
||||
setScalingOffset(Vector3(v, m_scalingOffset.y, m_scalingOffset.z));
|
||||
break;
|
||||
case KRENGINE_NODE_SCALE_OFFSET_Y:
|
||||
setScalingOffset(KRVector3(m_scalingOffset.x, v, m_scalingOffset.z));
|
||||
setScalingOffset(Vector3(m_scalingOffset.x, v, m_scalingOffset.z));
|
||||
break;
|
||||
case KRENGINE_NODE_SCALE_OFFSET_Z:
|
||||
setScalingOffset(KRVector3(m_scalingOffset.x, m_scalingOffset.y, v));
|
||||
setScalingOffset(Vector3(m_scalingOffset.x, m_scalingOffset.y, v));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -917,12 +917,12 @@ KRNode::LodVisibility KRNode::getLODVisibility()
|
||||
return m_lod_visible;
|
||||
}
|
||||
|
||||
const KRVector3 KRNode::localToWorld(const KRVector3 &local_point)
|
||||
const Vector3 KRNode::localToWorld(const Vector3 &local_point)
|
||||
{
|
||||
return KRMat4::Dot(getModelMatrix(), local_point);
|
||||
}
|
||||
|
||||
const KRVector3 KRNode::worldToLocal(const KRVector3 &world_point)
|
||||
const Vector3 KRNode::worldToLocal(const Vector3 &world_point)
|
||||
{
|
||||
return KRMat4::Dot(getInverseModelMatrix(), world_point);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user