26 if (reach <= 1e-6f)
return {velocity.x, velocity.y};
28 const glm::vec3 refUp = std::abs(fwd.y) > 0.999f ? glm::vec3(0.0f, 0.0f, 1.0f) : glm::vec3(0.0f, 1.0f, 0.0f);
29 const glm::vec3 right = glm::normalize(glm::cross(refUp, fwd));
30 const glm::vec3 up = glm::cross(fwd, right);
31 return {glm::dot(velocity, right), glm::dot(velocity, up)};
StretchedQuad stretchedQuad(glm::vec2 velocity, f32 rotation, f32 size, f32 lengthScale, f32 velocityScale)
glm::vec2 velocityOnScreen(const glm::vec3 &velocity, const glm::vec3 &towardViewer)
How a stretched particle's quad is laid along its velocity.
f32 rotation
Radians, counter-clockwise, turning the quad's +Y onto the velocity.
f32 length
The quad's extent along its Y.