From: <sv...@ww...> - 2004-12-05 00:23:20
|
Author: delta Date: 2004-12-04 16:23:13 -0800 (Sat, 04 Dec 2004) New Revision: 1349 Modified: trunk/CSP/SimCore/Util/MessageTypes.h Log: * static_cast Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1349 Modified: trunk/CSP/SimCore/Util/MessageTypes.h =================================================================== --- trunk/CSP/SimCore/Util/MessageTypes.h 2004-12-04 22:22:50 UTC (rev 1348) +++ trunk/CSP/SimCore/Util/MessageTypes.h 2004-12-05 00:23:13 UTC (rev 1349) @@ -71,9 +71,9 @@ inline GlobalPosition const &operator=(simdata::Vector3 const &v) { x0 = static_cast<simdata::uint8>(floor(v.x() / 32000.0) + 128); y0 = static_cast<simdata::uint8>(floor(v.y() / 32000.0) + 128); - x = v.x() - (static_cast<int>(x0)-128) * 32000.0; - y = v.y() - (static_cast<int>(y0)-128) * 32000.0; - z = v.z(); + x = static_cast<float>(v.x() - (static_cast<int>(x0)-128) * 32000.0); + y = static_cast<float>(v.y() - (static_cast<int>(y0)-128) * 32000.0); + z = static_cast<float>(v.z()); return *this; } @@ -119,8 +119,8 @@ } inline Vector2f const &operator=(simdata::Vector3 const &v) { - x = v.x(); - y = v.y(); + x = static_cast<float>(v.x()); + y = static_cast<float>(v.y()); return *this; } @@ -164,9 +164,9 @@ } inline Vector3f const &operator=(simdata::Vector3 const &v) { - x = v.x(); - y = v.y(); - z = v.z(); + x = static_cast<float>(v.x()); + y = static_cast<float>(v.y()); + z = static_cast<float>(v.z()); return *this; } @@ -212,10 +212,10 @@ } inline Vector4f const &operator=(simdata::Quat const &q) { - x = q.x(); - y = q.y(); - z = q.z(); - w = q.w(); + x = static_cast<float>(q.x()); + y = static_cast<float>(q.y()); + z = static_cast<float>(q.z()); + w = static_cast<float>(q.w()); return *this; } |