From 5f859d9101dd40ca002369dd272ecb6819013ca3 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 28 Jan 2010 06:12:55 +0000 Subject: [PATCH] addAMotor() more complete git-svn-id: svn://anubis/anaglym/trunk@230 99a6e188-d820-4881-8870-2d33a10e2619 --- Engine.cc | 5 ++++- Engine.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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];