Hello,
This is where my lack of knowledge of math affects me the most. So I have a regular circle that appears where you click the mouse and begins to fall using basic velocity and acceleration.
I have a line created in the middle of the circle to represent the angle the circle is falling. I can't seem to get the last point to rotate around the circle. At the moment I'm just trying to have it follow the circle's path just in general.
circle.setPosition(m_position.x - fOffsetX, m_position.y - fOffsetY);
circle.setRadius(radius);
circle.setOutlineThickness(0.5f);
circle.setOutlineColor(sf::Color::White);
circle.setFillColor(sf::Color::Transparent);
float angle = (atan2(circle.getPosition().y , circle.getPosition().x ) * 180) / 3.141;
circle.rotate(angle);
sf::Vector2f l1{ circle.getPosition().x + circle.getRadius() , circle.getPosition().y + circle.getRadius() };
sf::Vector2f l2{ circle.getPosition().x + circle.getRadius() * 2 , circle.getPosition().y + circle.getRadius() };
drawLine(l1, l2, sf::Color Yellow)
Without telling you every single
cosf and
sinf formula I configured (aka probably made up) for 'l2' can anyone just tell me off the top of their head how I would accomplish this? Perhaps explaining quickly why would be awesome.
Thanks, everyone have a great week and be safe.