Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.51 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <memory>
  4.  
  5. #include <ppgso/ppgso.h>
  6. #include "object.h"
  7. #include "scene.h"
  8. #include "player.h"
  9.  
  10. /*!
  11.  * Simple asteroid object
  12.  * This sphere object represents an instance of mesh geometry
  13.  * It initializes and loads all resources only once
  14.  * It will move down along the Y axis and self delete when reaching below -10
  15.  */
  16. class playerHp final : public Object {
  17. private:
  18.     // Static resources (Shared between instances)
  19.     static std::unique_ptr<ppgso::Mesh> mesh;
  20.     static std::unique_ptr<ppgso::Shader> shader;
  21.     static std::unique_ptr<ppgso::Texture> texture;
  22.     glm::vec3 rotMomentum;
  23.     Object *parent;
  24.  
  25.  
  26.     /*!
  27.      * Split the asteroid into multiple pieces and spawn an explosion object.
  28.      *
  29.      * @param scene - Scene to place pieces and explosion into
  30.      * @param explosionPosition - Initial position of the explosion
  31.      * @param explosionScale - Scale of the explosion
  32.      * @param pieces - Asteroid pieces to generate
  33.      */
  34.  
  35. public:
  36.     /*!
  37.      * Create new asteroid
  38.      */
  39.     playerHp(Object *parent);
  40.  
  41.     /*!
  42.      * Update asteroid
  43.      * @param scene Scene to interact with
  44.      * @param dt Time delta for animation purposes
  45.      * @return
  46.      */
  47.     bool update(Scene &scene, float dt,int offset);
  48.  
  49.     /*!
  50.      * Render asteroid
  51.      * @param scene Scene to render in
  52.      */
  53.     void render(Scene &scene) override;
  54.  
  55.     /*!
  56.      * Custom click event for asteroid
  57.      */
  58.  
  59.    // void generateModelMatrix() override;
  60. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement