diff --git a/Engine.cc b/Engine.cc index 0aa2eea..997bf64 100644 --- a/Engine.cc +++ b/Engine.cc @@ -96,6 +96,7 @@ Engine::Engine(const string & path, Video & video) : m_video(video) { m_next_object_index = 1; + m_next_joint_index = 1; m_next_text_index = 1; m_eye[0] = 0; m_eye[1] = -1; @@ -306,7 +307,9 @@ int Engine::addAMotor(Object * o1, Object * o2) if (o2 != NULL) b2 = o2->getBody(); dJointID j = dJointCreateAMotor(m_world.getWorldID(), 0); - /* TODO: finish */ + int id = m_next_joint_index++; + m_joints[id] = j; + return id; } void Engine::removeObject(int id) diff --git a/Engine.h b/Engine.h index d7c329b..781d5de 100644 --- a/Engine.h +++ b/Engine.h @@ -213,6 +213,7 @@ class Engine std::map m_objects; std::map m_joints; int m_next_object_index; + int m_next_joint_index; int m_next_text_index; GLdouble m_eye[3]; GLdouble m_center[3];