Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.46 kb
#include "vectors.h"
vec2 rotate_vec2(const vec2& v, float s, float c) {
return vec2( v.x * c - v.y * s, v.x * s + v.y * c );
}
vec2 normalise(const vec2& v) {
float l = glm::length(v);
if(l > 0.0) return v / l;
return v;
}
vec3 normalise(const vec3& v) {
float l = glm::length(v);
if(l > 0.0) return v / l;
return v;
}
vec4 normalise(const vec4& v) {
float l = glm::length(v);
if(l > 0.0) return v / l;
return v;
}
Jump to Line
Something went wrong with that request. Please try again.