diff options
author | click <none@none> | 2010-08-27 01:52:05 +0200 |
---|---|---|
committer | click <none@none> | 2010-08-27 01:52:05 +0200 |
commit | 7686d6ee57038e848f75130563fc78c1adebc1a2 (patch) | |
tree | 258a7a6db03e3479a0219ace8cfc3ec3ba53a1be /dep/g3dlite/source/Vector3int16.cpp | |
parent | 1d3deae555f0ec523d77875bd5a307ab9bd19742 (diff) |
Core/Dependency: Upgrade G3d-library to v8.0-release (patched version!)
Note: Due to issues with G3D (normally requiring X11 and the ZIP-library),
the sourcetree version contains a modified version. The applied patch is
commited to the repository for future reference.
--HG--
branch : trunk
Diffstat (limited to 'dep/g3dlite/source/Vector3int16.cpp')
-rw-r--r-- | dep/g3dlite/source/Vector3int16.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dep/g3dlite/source/Vector3int16.cpp b/dep/g3dlite/source/Vector3int16.cpp new file mode 100644 index 00000000000..44069b85d8c --- /dev/null +++ b/dep/g3dlite/source/Vector3int16.cpp @@ -0,0 +1,49 @@ +/** + @file Vector3int16.cpp + + @author Morgan McGuire, http://graphics.cs.williams.edu + + @created 2003-04-07 + @edited 2006-01-17 + */ + +#include "G3D/platform.h" +#include "G3D/g3dmath.h" +#include "G3D/Vector3int16.h" +#include "G3D/Vector3.h" +#include "G3D/BinaryInput.h" +#include "G3D/BinaryOutput.h" +#include "G3D/format.h" + +namespace G3D { + +Vector3int16::Vector3int16(const class Vector3& v) { + x = (int16)iFloor(v.x + 0.5); + y = (int16)iFloor(v.y + 0.5); + z = (int16)iFloor(v.z + 0.5); +} + + +Vector3int16::Vector3int16(class BinaryInput& bi) { + deserialize(bi); +} + + +void Vector3int16::serialize(class BinaryOutput& bo) const { + bo.writeInt16(x); + bo.writeInt16(y); + bo.writeInt16(z); +} + + +void Vector3int16::deserialize(class BinaryInput& bi) { + x = bi.readInt16(); + y = bi.readInt16(); + z = bi.readInt16(); +} + +std::string Vector3int16::toString() const { + return G3D::format("(%d, %d, %d)", x, y, z); +} + +} |