#include "pch.h"
#include "OrbitingObject.h"

#include <iostream>
OrbitingObject::OrbitingObject(const Vector2f& orbit, float distance, float speed, Texture* texture, float offset): m_Texture(texture), m_Orbit(orbit), m_Speed(speed), m_Distance(distance), m_currentCycle(offset) {
}
void OrbitingObject::Update(float elapsedSecs) {
	m_Position = Vector2f(m_Orbit.x + cosf(m_currentCycle) * m_Distance, m_Orbit.y + sinf(m_currentCycle) * m_Distance);
	m_currentCycle += m_Speed * elapsedSecs;
}
void OrbitingObject::Draw() const {
	m_Texture->Draw(m_Position);

}
