18 inline Vec2 (
void ) {
set( 0, 0 ); }
19 inline Vec2 ( vec x, vec y ) {
set( x, y); }
21 inline void set ( vec x, vec y ) { v[0] = x; v[1] = y; }
22 inline void set (
const vec *vP ) { v[0] = vP[0]; v[1] = vP[1]; }
24 inline vec& operator[] (
int i ) {
return v[i]; }
25 inline vec* raw (
void ) {
return v; }
27 inline operator const vec* ( void )
const {
return v; }
29 inline Vec2& operator+= (
const Vec2& v2 ) { v[0] += v2.v[0]; v[1] += v2.v[1];
return *
this; }
30 inline Vec2& operator-= (
const Vec2& v2 ) { v[0] -= v2.v[0]; v[1] -= v2.v[1];
return *
this; }
31 inline Vec2 operator+ (
const Vec2& v2 )
const {
return Vec2( v[0] + v2.v[0], v[1] + v2.v[1] ); }
32 inline Vec2 operator- (
const Vec2& v2 )
const {
return Vec2( v[0] - v2.v[0], v[1] - v2.v[1] ); }
33 inline Vec2 operator* ( vec s )
const {
return Vec2( v[0] * s, v[1] * s ); }
34 inline void normalize (
void ) { vec l = length(); v[0] /= l; v[1] /= l; }
36 inline float length (
void)
38 return (
float)sqrt(v[0]*v[0]+v[1]*v[1]);
51 Vec3 (
void ) {
set( 0, 0, 0); }
52 Vec3 ( vec x, vec y, vec z ) {
set( x, y, z ); }
53 inline void set ( vec x, vec y, vec z ) { v[0] = x; v[1] = y; v[2] = z; }
54 inline void set (
const vec *vP ) { v[0] = vP[0]; v[1] = vP[1]; v[2] = vP[2]; }
56 inline vec& operator[] (
int i ) {
return v[i]; }
57 inline vec* raw (
void ) {
return v; }
59 inline operator const vec* ( void )
const {
return v; }
61 inline Vec3& operator+= (
const Vec3& v3 ) { v[0] += v3.v[0]; v[1] += v3.v[1]; v[2] += v3.v[2];
return *
this; }
62 inline Vec3& operator-= (
const Vec3& v3 ) { v[0] -= v3.v[0]; v[1] -= v3.v[1]; v[2] -= v3.v[2];
return *
this; }
63 inline Vec3 operator+ (
const Vec3& v3 )
const {
return Vec3( v[0] + v3.v[0] , v[1] + v3.v[1] , v[2] + v3.v[2] ); }
64 inline Vec3 operator- (
const Vec3& v3 )
const {
return Vec3( v[0] - v3.v[0] , v[1] - v3.v[1] , v[2] - v3.v[2] ); }
65 inline Vec3 operator* ( vec s )
const {
return Vec3( v[0] * s , v[1] * s , v[2] * s ); }
66 inline float operator* (
const Vec3& v3 )
const {
return ( v[0] * v3[0] + v[1] * v3[1] + v[2] * v3[2] ); }
67 inline Vec3 operator~ (
void )
const {
return Vec3( -v[0] , -v[1], -v[2] ); }
68 inline Vec3 operator^ (
const Vec3& v3 )
const {
return Vec3( v[1]*v3.v[2] - v3.v[1]*v[2], -v[0]*v3.v[2] + v3.v[0]*v[2], v[0]*v3.v[1] - v3.v[0]*v[1] ); }
70 inline vec length (
void )
const {
return (vec)sqrt( v[0] * v[0] + v[1] * v[1] + v[2] * v[2] ); }
71 inline void normalize (
void ) { vec l = length(); v[0] /= l; v[1] /= l; v[2] /= l; }
different physics engine has different winding order.
Definition: EventBinding.h:32