void EditorNode::setTransform(Ogre::Matrix4 transform) { Ogre::Vector3 position, scale; Ogre::Quaternion orientation; transform.decomposition(position, scale, orientation); scene_node->setPosition(position); scene_node->setScale(scale); scene_node->setOrientation(orientation); }
HavokNode::HavokNode(string name, hkGeometry *geometry, LibGens::Matrix4 transform, Ogre::SceneManager *scene_manager) { type = EDITOR_NODE_HAVOK; scene_node = scene_manager->getRootSceneNode()->createChildSceneNode(); havok_name = name; buildHavokMesh(scene_node, havok_name, geometry, scene_manager, EDITOR_NODE_QUERY_HAVOK, GENERAL_MESH_GROUP); Ogre::Matrix4 matrix = Ogre::Matrix4(transform.m[0][0], transform.m[0][1], transform.m[0][2], transform.m[0][3], transform.m[1][0], transform.m[1][1], transform.m[1][2], transform.m[1][3], transform.m[2][0], transform.m[2][1], transform.m[2][2], transform.m[2][3], transform.m[3][0], transform.m[3][1], transform.m[3][2], transform.m[3][3]); matrix.decomposition(position, scale, rotation); scene_node->setPosition(position); scene_node->setScale(scale); scene_node->setOrientation(rotation); scene_node->getUserObjectBindings().setUserAny(EDITOR_NODE_BINDING, Ogre::Any((EditorNode *)this)); selected = false; }