#pragma once

#define PHYSICSOBJECT typeid(PhysicsObject).name()

#include "box2d/box2d.h"
#include "enums/PhysicsEnums.hpp"
#include "elements/BehaviourScript.hpp"
#include "Vector3.hpp"

namespace TSE
{
    class PhysicsObject: public BehaviourScript
    {
    private:
        BodyType type;
        ColliderShape shape;
        float density;
        float friction;

        //in case of box: x = x, y = y, z = unused
        //in case of circle: x = radius, y = unused, z = unused
        //in case of capsule: x = radius, y = height, z = unused
        //in case of RoundedBox: x = x, y = y, z = radius
        Vector3 collidersize;

        b2BodyId bodyId;
        Vector3 lastPos;
        float lastRot;
    public:
        PhysicsObject(BodyType type, ColliderShape shape, float density, float friction, Vector3 colliderSize);
        ~PhysicsObject();

        void UpdatePosition();
        void OnUpdate() override;
        void Start() override;
        inline const char* GetName() override
        {
            return "Physics Object";
        }
    };
} // namespace TSE
