void SceneNode::Draw(SceneManager *sceneManager, Mesh* debugMesh) { sceneManager->PreRender(true); if (gameObject3D != NULL) { sceneManager->RenderPush(gameObject3D->getProperties().modelProperties); #if _DEBUG if (debugMesh != NULL) { MS modelStack; modelStack.LoadIdentity(); modelStack.PushMatrix(); modelStack.Translate(gameObject3D->getHitbox().getMidPoint().x, gameObject3D->getHitbox().getMidPoint().y, gameObject3D->getHitbox().getMidPoint().z); modelStack.MultMatrix(gameObject3D->getProperties().rotation); modelStack.Scale(gameObject3D->getHitbox().getLength(), gameObject3D->getHitbox().getHeight(), gameObject3D->getHitbox().getDepth()); sceneManager->Render3DMesh(debugMesh, false); modelStack.PopMatrix(); } #endif sceneManager->Render3DMesh(gameObject3D->getMesh(), gameObject3D->getReflectLight()); } for (unsigned i = 0; i < childNodes.size(); ++i) { this->childNodes[i]->DrawChild(sceneManager, debugMesh); } if (gameObject3D != NULL) { sceneManager->RenderPop(); } }
void CFood::RenderItem(MS& modelStack) { float C = Charge * 8; C = C > 1 ? 1 : C; modelStack.Translate(0, translation.y, translation.z); modelStack.Translate((currentWeapbobX + translation.x) * (1 - C), currentWeapbobY * (1 - C), 0); modelStack.Translate(0, bobY * C, 0); modelStack.Rotate(-45 * (1 - C), 0, 1, 0); modelStack.Rotate(90, 1, 0, 0); modelStack.Scale(2, 4, 2); }
void Entity::RenderObject(MS& modelStack) { modelStack.Translate(position); modelStack.Rotate(hOrientation, 0, 1, 0); modelStack.Scale(size); }