diff options
author | click <none@none> | 2010-06-05 00:59:25 +0200 |
---|---|---|
committer | click <none@none> | 2010-06-05 00:59:25 +0200 |
commit | e77716188861d4aa83b227a90e04a66b63baeb1f (patch) | |
tree | ce72764181a760314ec851f7535052dcf75649db /dep/src/g3dlite/PhysicsFrame.cpp | |
parent | 1426c2970f42a2d065198806f750bf5dd28d580b (diff) |
HIGHLY EXPERIMENTAL - USE AT YOUR OWN RISK
Implement the use of the new vmap3-format by Lynx3d (mad props to you for this, and thanks for the talks earlier)
+ reduced Vmap size to less than one third, and improve precision
+ indoor/outdoor check which allows automatic unmounting of players
+ additional area information from WMOAreaTable.dbc, removed existing "hacks"
+ WMO liquid information for swimming and fishing correctly in buildings/cities/caves/instances (lava and slime WILL hurt from now on!)
- buildfiles for windows are not properly done, and will need to be sorted out
NOTE: Do NOT annoy Lynx3d about this, any issues with this "port" is entirely our fault !
THIS REVISION IS CONSIDERED UNSTABLE AND CONTAINS WORK IN PROGRESS - USE AT YOUR OWN RISK!
--HG--
branch : trunk
Diffstat (limited to 'dep/src/g3dlite/PhysicsFrame.cpp')
-rw-r--r-- | dep/src/g3dlite/PhysicsFrame.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/dep/src/g3dlite/PhysicsFrame.cpp b/dep/src/g3dlite/PhysicsFrame.cpp new file mode 100644 index 00000000000..28ba8f8d477 --- /dev/null +++ b/dep/src/g3dlite/PhysicsFrame.cpp @@ -0,0 +1,77 @@ +/** + @file PhysicsFrame.cpp + + @maintainer Morgan McGuire, http://graphics.cs.williams.edu + + @created 2002-07-09 + @edited 2006-01-25 +*/ + +#include "G3D/platform.h" +#include "G3D/PhysicsFrame.h" +#include "G3D/BinaryInput.h" +#include "G3D/BinaryOutput.h" + +namespace G3D { + +PhysicsFrame::PhysicsFrame() { + translation = Vector3::zero(); + rotation = Quat(); +} + + +PhysicsFrame::PhysicsFrame( + const CoordinateFrame& coordinateFrame) { + + translation = coordinateFrame.translation; + rotation = Quat(coordinateFrame.rotation); +} + + +PhysicsFrame PhysicsFrame::operator*(const PhysicsFrame& other) const { + PhysicsFrame result; + + result.rotation = rotation * other.rotation; + result.translation = translation + rotation.toRotationMatrix() * other.translation; + + return result; +} + + +CoordinateFrame PhysicsFrame::toCoordinateFrame() const { + CoordinateFrame f; + + f.translation = translation; + f.rotation = rotation.toRotationMatrix(); + + return f; +} + + +PhysicsFrame PhysicsFrame::lerp( + const PhysicsFrame& other, + float alpha) const { + + PhysicsFrame result; + + result.translation = translation.lerp(other.translation, alpha); + result.rotation = rotation.slerp(other.rotation, alpha); + + return result; +} + + +void PhysicsFrame::deserialize(class BinaryInput& b) { + translation.deserialize(b); + rotation.deserialize(b); +} + + +void PhysicsFrame::serialize(class BinaryOutput& b) const { + translation.serialize(b); + rotation.serialize(b); +} + + +}; // namespace + |