Skip to content
Snippets Groups Projects
Select Git revision
  • 8afdfefce39f9243c6ff36d1696b811f5596ac42
  • main default protected
  • dev protected
  • feature/sound
  • v1.0.1
  • v1.0.0
6 results

DynamicObject.hpp

Blame
  • DynamicObject.hpp 1.59 KiB
    #pragma once
    #include "GameObject.hpp"
    
    /**
     * @class DynamicObject
     * @brief A class representing a dynamic object in the Box2D physics world.
     *
     * This class extends the `GameObject` class and adds functionality for objects that are affected by physics.
     * It allows dynamic objects to interact with other objects in the physics world, including applying forces and
     * responding to collisions.
     */
    class DynamicObject : public GameObject
    {
      public:
        /**
         * @brief Constructs a DynamicObject with the specified parameters.
         *
         * This constructor initializes a dynamic object in the provided Box2D world at a specified position,
         * with a given size, density, and friction. It also links the object to a game window for rendering and
         * a texture file for visual representation.
         *
         * @param world The Box2D world where the dynamic object will exist.
         * @param position The initial position of the dynamic object in the physics world.
         * @param size The size (width and height) of the dynamic object.
         * @param density The density of the dynamic object, used for physical simulations.
         * @param friction The friction coefficient that affects how the object interacts with other surfaces.
         * @param tilesheetManager The TilesheetManager object used for rendering the object's texture.
         * @param tileIDs The tile IDs representing the object's texture in the tilesheet.
         */
        DynamicObject(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale,
                      float friction, const std::vector<int> &tileIDs, bool isBullet);
    };