diff --git a/engine/include/fishbone/types.h b/engine/include/fishbone/types.h index 7daadc4..62a3039 100644 --- a/engine/include/fishbone/types.h +++ b/engine/include/fishbone/types.h @@ -27,6 +27,16 @@ namespace fishbone { float y; float z; }; + + struct Quaternion { + struct fishbone::Quaternion operator+(struct fishbone::Quaternion q) const; + struct fishbone::Quaternion operator-(struct fishbone::Quaternion q) const; + + float w; + float x; + float y; + float z; + }; }; // namespace fishbone #endif diff --git a/engine/src/client.cc b/engine/src/client.cc index 8009e67..28d9822 100644 --- a/engine/src/client.cc +++ b/engine/src/client.cc @@ -38,8 +38,8 @@ float r = 0; bool fishbone::Client::step() { this->renderer->prepare(); - m->draw((struct fishbone::Vector3){0, 0, 0}, (struct fishbone::Vector3){0, r, 0}); - r++; + m->draw((struct fishbone::Vector3){0, 0, 0}, (struct fishbone::Vector3){r, r, r}); + r += 30.0 / 60; this->window->swapBuffer(); diff --git a/engine/src/types.cc b/engine/src/types.cc index 6239fc3..b445192 100644 --- a/engine/src/types.cc +++ b/engine/src/types.cc @@ -54,3 +54,11 @@ struct fishbone::Vector3 fishbone::Vector3::normalize() { return {this->x * l, this->y * l, this->z * l}; } + +struct fishbone::Quaternion fishbone::Quaternion::operator+(struct fishbone::Quaternion q) const { + return {this->w + q.w, this->x + q.x, this->y + q.y, this->z + q.z}; +} + +struct fishbone::Quaternion fishbone::Quaternion::operator-(struct fishbone::Quaternion q) const { + return {this->w - q.w, this->x - q.x, this->y - q.y, this->z - q.z}; +}