25 lines
662 B
C++
25 lines
662 B
C++
#pragma once
|
|
|
|
#include "KShape.h"
|
|
#include "KTexture.h"
|
|
#include "KVector2d.h"
|
|
|
|
namespace KapitanGame {
|
|
class KCircle final : public KShape
|
|
{
|
|
public:
|
|
KCircle(const KVector2D& position, const KVector2D& velocity, const float& radius, const KTexture& texture);
|
|
void CollisionDetectionWithMapStep(const SDL_Rect& map) override;
|
|
float GetRadius() const;
|
|
protected:
|
|
KVector2D GetSeparationVector(const KCircle& other) const override;
|
|
KVector2D GetSeparationVector(const KRect& other) const override;
|
|
bool IsCollision(const KCircle& other) const override;
|
|
bool IsCollision(const KRect& other) const override;
|
|
private:
|
|
float Radius{ 1.f };
|
|
};
|
|
}
|
|
|
|
|