Initial commit
This commit is contained in:
56
application/source/engine/vector4.c
Normal file
56
application/source/engine/vector4.c
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
|
||||
|
||||
|
||||
class vector4{
|
||||
|
||||
float x;
|
||||
|
||||
float y;
|
||||
|
||||
float z;
|
||||
|
||||
float w;
|
||||
|
||||
|
||||
constructor( float x, float y, float z, float w ) {
|
||||
|
||||
this->x = x;
|
||||
|
||||
this->y = y;
|
||||
|
||||
this->z = z;
|
||||
|
||||
this->w = w;
|
||||
|
||||
}
|
||||
|
||||
vector4 * operator+( vector4 * b ) {
|
||||
|
||||
this->add( b );
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
vector4 * operator+=( vector4 * b ) {
|
||||
|
||||
this->add( b );
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
void add( vector4 * b ) {
|
||||
|
||||
this->x += b->x;
|
||||
|
||||
this->y += b->y;
|
||||
|
||||
this->z += b->z;
|
||||
|
||||
this->w += b->w;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user