Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. class Scene {
  2. World* world
  3. Player* player
  4. Enemy* boss
  5. Camera* camera
  6. }
  7.  
  8. State* gameState = new State();
  9. gameState->addScene(scene);
  10.  
  11. State::update(double delta) {
  12. scene->update(delta);
  13. }
  14.  
  15. State::update(double delta) {
  16. physicsSystem->applyPhysics(scene);
  17. }
  18.  
  19. State::render() {
  20. renderSystem->render(scene);
  21. }
  22.  
  23. RenderSystem::renderScene(Scene* scene) {
  24. Camera* camera = scene->camera;
  25. lookAt(camera); // Set up the appropriate viewing matrices based on
  26. // the camera location and direction
  27.  
  28. renderHeightmap(scene->getWorld()->getHeightMap()); // Just as an example, you might
  29. // use a height map as your world
  30. // representation.
  31. renderModel(scene->getPlayer()->getType()); // getType() will return, for example "orc"
  32. // or "human"
  33.  
  34. renderModel(scene->getBoss()->getType());
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement