- aabb_.init(Mf::Vector3(current.position[0]-16.0, current.position[1]-16.0, z),
- Mf::Vector3(current.position[0]+16.0, current.position[1]+16.0, z));
- sphere_.point = Mf::Vector3(current.position[0], current.position[1], z);
- sphere_.radius = (aabb_.min - sphere_.point).length();
+ //Mf::Vector2 position = cml::lerp(mPrevState.position, mState.position, alpha);
+ Mf::State2 state = getState(alpha);
+ Mf::Vector2 position = state.position;
+
+ //glColor3f(1.0f, 1.0f, 1.0f);
+ tilemap.bind();
+
+ Mf::Texture::TileIndex frame = animation.getFrame();
+ Mf::Texture::Orientation orientation = Mf::Texture::NORMAL;
+
+ if (mState.velocity[0] < 0.0) orientation = Mf::Texture::REVERSE;
+
+ Mf::Scalar coords[8];
+ tilemap.getTileCoords(frame, coords, orientation);
+
+ Mf::Scalar s = 0.5;
+
+ glBegin(GL_TRIANGLE_FAN);
+ glTexCoord(coords[0], coords[1]);
+ glVertex(position[0]-s, position[1]-s);
+ glTexCoord(coords[2], coords[3]);
+ glVertex(position[0]+s, position[1]-s);
+ glTexCoord(coords[4], coords[5]);
+ glVertex(position[0]+s, position[1]+s);
+ glTexCoord(coords[6], coords[7]);
+ glVertex(position[0]-s, position[1]+s);
+ glEnd();