+void SceneNode::apply_xform()
+{
+ update_node();
+
+ // apply post-order to make sure we don't affect the children xform by our reset
+
+ int nchild = children.size();
+ for(int i=0; i<nchild; i++) {
+ children[i]->apply_xform();
+ }
+
+ int nobj = obj.size();
+ for(int i=0; i<nobj; i++) {
+ if(obj[i]->get_type() == OBJ_MESH) {
+ ObjMesh *om = (ObjMesh*)obj[i];
+ if(om->mesh) {
+ om->mesh->apply_xform(xform);
+ }
+ }
+ }
+
+ pos = Vec3(0, 0, 0);
+ rot = Quat::identity;
+ scale = Vec3(1, 1, 1);
+}