Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-04 16:59:52 +0000
committerStijn Buys <ingar@osirion.org>2010-10-04 16:59:52 +0000
commit3d97c7737fdda88c5d5d9e3e7d13f4c1973c7774 (patch)
treef4ee6f9e88645f76786589f1cb929eade66ce858
parent81acfb7cd3ced1e613acaf45b44867e56b137dc9 (diff)
corrected modelview rotation to radians
-rw-r--r--doc/TODO10
-rw-r--r--src/math/axis.cc6
-rw-r--r--src/math/axis.h25
-rwxr-xr-xsrc/ui/modelview.cc4
4 files changed, 29 insertions, 16 deletions
diff --git a/doc/TODO b/doc/TODO
index 56823b8..37bee4f 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -17,7 +17,6 @@ general:
ship improvements (radars, shield, armor)
inventory:
- no-buy items (amount 0) (ok)
eject cargo
beam cargo
@@ -43,9 +42,10 @@ network:
zone/system chat
group/clan chat (requires groups)
rcon authentication, rcon command, servers must be able to disable rcon
+ rconpassword: send md5sum instead of plaintext
player authentication (player id)
- send clients only updates from the current zone/server-side distance check
+ add server-side distance check before sending entity updates
fix lag/client interpolation
cl_prediction or cl_interpolation
detect and disconnect clients behaving badly
@@ -63,10 +63,9 @@ client:
render:
star light strenght
sphere texture distortion at the poles
+ skybox
ui:
- fix modelview 'can't load' spam -> clear modelname (or tradewindow) (ok)
- modelview control axis, default orientation tilted
modelview lighting (-> it uses current zone lighting)
sound:
@@ -75,8 +74,7 @@ sound:
game:
entity health/shield/armor
- 'give ship' destroys inventory
- implement 'give cargo'
+ fix 'give ship' destroying inventory
data:
update starsystem roadmap
diff --git a/src/math/axis.cc b/src/math/axis.cc
index 402b2f6..8273469 100644
--- a/src/math/axis.cc
+++ b/src/math/axis.cc
@@ -84,10 +84,10 @@ void Axis::change_roll(const float angle)
/* notes:
http://mathworld.wolfram.com/RotationFormula.html
*/
-void Axis::rotate(Vector3f const &normal, float angle)
+void Axis::rotate(Vector3f const &normal, float rad)
{
- float cosa = cosf(angle);
- float sina = sinf(angle);
+ float cosa = cosf(rad);
+ float sina = sinf(rad);
for (size_t i = 0; i < 3; i++) {
axis_vector[i] =
diff --git a/src/math/axis.h b/src/math/axis.h
index 0ece016..c22568c 100644
--- a/src/math/axis.h
+++ b/src/math/axis.h
@@ -52,17 +52,32 @@ public:
const Axis operator*(const Axis &other) const;
- /// change direction, rotate around up vector (positive is left)
+ /**
+ * @brief change axis direction angle
+ * rotate around axis up vector (positive is left)
+ * @param angle angle in degrees
+ **/
void change_direction(const float angle);
- /// change pitch, rotate around left vector (positive is up)
+ /**
+ * @brief change axis pitch angle
+ * rotate around left vector (positive is up)
+ * @param angle angle in degrees
+ **/
void change_pitch(const float angle);
- /// change roll, rotate around forward vector (positive is left)
+ /**
+ * @brief change axis roll angle
+ * rotate around forward vector (positive is left)
+ * @param angle angle in degrees
+ **/
void change_roll(const float angle);
- /// rotation about an arbitrary axis
- void rotate(const Vector3f & normal, const float angle);
+ /**
+ * @brief rotation about an arbitrary vector
+ * @param rad angle in radians
+ **/
+ void rotate(const Vector3f & normal, const float rad);
/// return the transpose of this matrix
const Axis transpose() const;
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index 7eb1be6..b247213 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -108,12 +108,12 @@ void ModelView::on_mousemove(const math::Vector2f &cursor)
const math::Vector2f pos(cursor - modelview_cursor);
const math::Vector3f up(0.0f, 0.0f, 1.0f);
- const float zrot = 45.0f * pos.x() / width();
+ const float zrot = 2.0f * M_PI * pos.x() / width();
modelview_axis.rotate(up, -zrot);
//modelview_manipaxis.rotate(up, -zrot);
const math::Vector3f left(0.0f, 1.0f, 0.0f);
- const float yrot = 45.0f * pos.y() / height();
+ const float yrot = 2.0f * M_PI * pos.y() / height();
modelview_axis.rotate(left, yrot);
//modelview_manipaxis.rotate(left, yrot);