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