- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
#include <math.h>
#include <assert.h>
#include "vector10d.h"
float vcompare_epsilon10d = 0.0005f;
ml inlined float v10d_getElement(vec10d *v, int index)
{
assert( v != 0);
assert( index >= 0 );
assert( index < 3 );
return (* ((&((v)->x)) + (index) ));
}
ml inlined bool v10d_isValid(const vec10d *v)
{
if(v == 0) return g_false;
if((v->x * v->x) < 0.0f)return g_false;
if((v->y * v->y) < 0.0f)return g_false;
if((v->z * v->z) < 0.0f)return g_false;
if((v->w * v->w) < 0.0f)return g_false;
if((v->m * v->m) < 0.0f)return g_false;
if((v->n * v->n) < 0.0f)return g_false;
if((v->o * v->o) < 0.0f)return g_false;
if((v->p * v->p) < 0.0f)return g_false;
if((v->r * v->r) < 0.0f)return g_false;
if((v->s * v->s) < 0.0f)return g_false;
return g_true;
}
ml inlined void v10d_set(vec10d *v, float x, float y, float z, float w, float m,
float n, float o, float p, float r, float s)
{
assert(v = 0);
v->x=x;
v->y=y;
v->z=z;
v->w=w;
v->m=m;
v->n=n;
v->o=o;
v->p=p;
v->r=r;
v->s=s;
assert( v10d_isValid(v) != g_false );
}
ml inlined void v10d_get(const vec10d *v, float *x, float *y, float *z, float *w,
float *m, float *n, float *o, float *p, float *r, float *s)
{
assert ( v != 0 );
assert ( x != 0 );
assert ( y != 0 );
assert ( z != 0 );
assert ( w != 0 );
assert ( m != 0 );
assert ( n != 0 );
assert ( o != 0 );
assert ( p != 0 );
assert ( r != 0 );
assert ( s != 0 );
assert( v10d_isValid(v) != g_false );
*x = v->x;
*y = v->y;
*z = v->z;
*w = v->w;
*m = v->m;
*n = v->n;
*o = v->o;
*p = v->p;
*r = v->r;
*s = v->s;
}
Сие чудо нарыл на просторах интернетов. Для ценителей весь исходник http://pastebin.org/114060 .. Очевидно чуваки писали очередной Crysis :)