Commits

Jeremy Sandell committed db31610

added overload for createChildSceneNode

Comments (0)

Files changed (4)

contrib/d2/import/llcoi/ogre_interface.d

 // Ogre::SceneNode
 SceneNodeHandle create_child_scenenode(const char* node_name);
 
+SceneNodeHandle scenenode_create_child_scenenode(SceneNodeHandle handle, const char* name, const ref coiVector3 translate, const ref coiQuaternion rotate);
+
+SceneNodeHandle scenenode_create_child_scenenode_anon(SceneNodeHandle handle, ref const(coiVector3) translate, ref const(coiQuaternion) rotate);
+
 void attach_entity_to_scenenode(EntityHandle entity_handle, SceneNodeHandle scenenode_handle);
 
 void scenenode_update(SceneNodeHandle scenenode_handle, int update_children, int parent_has_changed);
 
 void scenenode_pitch(SceneNodeHandle scenenode_handle, coiReal radians, transform_space relative_to);
 
-SceneNodeHandle scenenode_create_child_scenenode(SceneNodeHandle handle, const char* name, const ref coiVector3 translate, const ref coiQuaternion rotate);
 
 // Viewports
 void viewport_set_background_colour(ViewportHandle viewport_handle, float r, float g, float b, float a);

contrib/d2/import/llcoi/ogre_interface.di

 // Ogre::SceneNode
 SceneNodeHandle create_child_scenenode(const char* node_name);
 
+SceneNodeHandle scenenode_create_child_scenenode(SceneNodeHandle handle, const char* name, const ref coiVector3 translate, const ref coiQuaternion rotate);
+
+SceneNodeHandle scenenode_create_child_scenenode_anon(SceneNodeHandle handle, ref const(coiVector3) translate, ref const(coiQuaternion) rotate);
+
 void attach_entity_to_scenenode(EntityHandle entity_handle, SceneNodeHandle scenenode_handle);
 
 void scenenode_update(SceneNodeHandle scenenode_handle, int update_children, int parent_has_changed);
 
 void scenenode_pitch(SceneNodeHandle scenenode_handle, coiReal radians, transform_space relative_to);
 
-SceneNodeHandle scenenode_create_child_scenenode(SceneNodeHandle handle, const char* name, const ref coiVector3 translate, const ref coiQuaternion rotate);
 
 // Viewports
 void viewport_set_background_colour(ViewportHandle viewport_handle, float r, float g, float b, float a);

interface/include/scenenode_bind.h

 // Scene nodes
 DLL SceneNodeHandle create_child_scenenode(const char* node_name);
 
+DLL SceneNodeHandle scenenode_create_child_scenenode_anon(SceneNodeHandle handle, const coiVector3* translate, const coiQuaternion* rotate);
+
 DLL void attach_entity_to_scenenode(EntityHandle entity_handle, SceneNodeHandle scenenode_handle);
 
 DLL void scenenode_update(SceneNodeHandle scenenode_handle, int update_children, int parent_has_changed);

interface/source/scenenode_bind.cpp

     return static_cast<SceneNodeHandle>(scene_node);
 }
 
+SceneNodeHandle scenenode_create_child_scenenode_anon(SceneNodeHandle handle, const coiVector3* translate, const coiQuaternion* rotate)
+{
+    Ogre::SceneNode* parent = static_cast<Ogre::SceneNode*>(handle);
+    const Ogre::Vector3 trans(translate->x, translate->y, translate->z);
+    const Ogre::Quaternion rot(rotate->w, rotate->x, rotate->y, rotate->z);
+
+    Ogre::SceneNode* child = parent->createChildSceneNode(trans, rot);
+
+    return static_cast<SceneNodeHandle>(child);
+}
+
 // Ogre::SceneNode::attachObject(Ogre::MovableObject*)
 void attach_entity_to_scenenode(EntityHandle entity_handle, SceneNodeHandle scenenode_handle)
 {