}
-void GameLayer::pushedOntoEngine()
+void GameLayer::addedToCore()
{
Mf::core.push(mHud);
mLine.a.set(20, 10);
mLine.b.set(19, 14);
- mSphere.point.set(22, 5);
- mSphere.radius = 2;
+ mCircle.point.set(22, 5);
+ mCircle.radius = 2;
mRayTimer.init(boost::bind(&GameLayer::rayTimer, this),
1.0, Mf::Timer::REPEAT);
void GameLayer::rayTimer()
{
- Mf::Ray<2>::Intersection meh;
- std::list<Mf::Ray<2>::Intersection> hits;
+ Mf::Ray2::Contact meh;
+ std::list<Mf::Ray2::Contact> hits;
Mf::Vector2 point;
bool bam = mLine.intersectRay(mRay, meh);
hits.push_back(meh);
}
- bam = mSphere.intersectRay(mRay, meh);
+ bam = mCircle.intersectRay(mRay, meh);
if (bam)
{
meh.normal.normalize();
{
hits.front().normal.normalize();
mRay.solve(point, hits.front().distance);
- //Mf::logInfo << "scene: d = " << hits.front().distance << std::endl;
- //Mf::logInfo << " P = " << point << std::endl;
- //Mf::logInfo << " n = " << hits.front().normal << std::endl;
+ Mf::logInfo << "scene: d = " << hits.front().distance << std::endl;
+ Mf::logInfo << " P = " << point << std::endl;
+ Mf::logInfo << " n = " << hits.front().normal << std::endl;
}
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
mState.scene->drawIfVisible(alpha, mState.camera.getFrustum());
-
mState.heroine->draw(alpha);
mRay.draw();
mLine.draw();
- mSphere.draw();
+ mCircle.draw();
}
bool GameLayer::handleEvent(const Mf::Event& event)