12 lines
270 B
C++
12 lines
270 B
C++
|
#include "math.hpp"
|
||
|
|
||
|
glm::vec2 sb::velocity_to_delta(float angle, float magnitude)
|
||
|
{
|
||
|
return {glm::sin(angle) * magnitude, -glm::cos(angle) * magnitude};
|
||
|
}
|
||
|
|
||
|
glm::vec2 sb::velocity_to_delta(glm::vec2 velocity)
|
||
|
{
|
||
|
return velocity_to_delta(velocity.x, velocity.y);
|
||
|
}
|