Engine calling OdeWorld::pickObjects; still need to reverse map OdeWorld::Object -> Engine::Object ID's

git-svn-id: svn://anubis/anaglym/trunk@252 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2010-02-21 17:10:35 +00:00
parent f230fb648b
commit f9d1fde72a

View File

@ -652,23 +652,16 @@ refptr< vector<int> > Engine::pickObjects(int x, int y)
initial_direction[0] = x - m_video.getWidth() / 2; initial_direction[0] = x - m_video.getWidth() / 2;
initial_direction[1] = m_screen_dist; initial_direction[1] = m_screen_dist;
initial_direction[2] = m_video.getHeight() / 2 - y; initial_direction[2] = m_video.getHeight() / 2 - y;
//dMultiply0(rotated_direction, initial_direction, r, 1, 3, 3);
dMultiply0(rotated_direction, r, initial_direction, 3, 3, 1); dMultiply0(rotated_direction, r, initial_direction, 3, 3, 1);
normalize(rotated_direction); normalize(rotated_direction);
/* TODO: finish */
refptr< vector<float> > args = new vector<float>();
args->push_back(0.5);
for (float d = 3.0; d < 10.0; d += 2.0)
{
int o = addObject(false, false, OdeWorld::SPHERE, args);
m_objects[o]->setPosition(
m_eye[0] + d * rotated_direction[0],
m_eye[1] + d * rotated_direction[1],
m_eye[2] + d * rotated_direction[2]);
}
return new vector<int>(); refptr< vector<OdeWorld::Object *> > objects =
m_world.pickObjects(m_eye[0], m_eye[1], m_eye[2],
rotated_direction[0], rotated_direction[1], rotated_direction[2]);
refptr< vector<int> > ret = new vector<int>();
/* TODO: finish */
return ret;
} }
void Engine::debug_hook(lua_Debug * debug) void Engine::debug_hook(lua_Debug * debug)