X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FGameLayer.cc;h=331d04fbc9db98f81d02ba12a3c07c9fea618fed;hp=3a0ea09eba80e44fb81dda883975bf5bd1c66f43;hb=76b3f4be992514a740ac03cdbdd57844142a0b4c;hpb=b714ba98cb92a1be42acba91d44fe5bfb0783a3b diff --git a/src/GameLayer.cc b/src/GameLayer.cc index 3a0ea09..331d04f 100644 --- a/src/GameLayer.cc +++ b/src/GameLayer.cc @@ -114,7 +114,7 @@ GameLayer::GameLayer() : } -void GameLayer::pushedOntoEngine() +void GameLayer::addedToCore() { Mf::core.push(mHud); @@ -123,8 +123,8 @@ void GameLayer::pushedOntoEngine() 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); @@ -155,8 +155,8 @@ void GameLayer::thinkTimer() void GameLayer::rayTimer() { - Mf::Ray<2>::Intersection meh; - std::list::Intersection> hits; + Mf::Ray2::Contact meh; + std::list hits; Mf::Vector2 point; bool bam = mLine.intersectRay(mRay, meh); @@ -166,7 +166,7 @@ void GameLayer::rayTimer() hits.push_back(meh); } - bam = mSphere.intersectRay(mRay, meh); + bam = mCircle.intersectRay(mRay, meh); if (bam) { meh.normal.normalize(); @@ -177,9 +177,9 @@ void GameLayer::rayTimer() { 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; } } @@ -195,12 +195,11 @@ void GameLayer::draw(Mf::Scalar alpha) const 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)