+ mRay.point = mState.heroine->getState().position;
+}
+
+void GameLayer::thinkTimer()
+{
+ mState.script.getRegistryTable().pushField("Think");
+ if (mState.script[-1].isFunction()) mState.script.call();
+ else mState.script.pop();
+}
+
+
+void GameLayer::rayTimer()
+{
+ Mf::Ray<2>::Intersection meh;
+ std::list<Mf::Ray<2>::Intersection> hits;
+ Mf::Vector2 point;
+
+ bool bam = mLine.intersectRay(mRay, meh);
+ if (bam)
+ {
+ meh.normal.normalize();
+ hits.push_back(meh);
+ }
+
+ bam = mSphere.intersectRay(mRay, meh);
+ if (bam)
+ {
+ meh.normal.normalize();
+ hits.push_back(meh);
+ }
+
+ if (mState.scene->castRay(mRay, hits))
+ {
+ 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;
+ }