diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-04-28 22:56:07 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-04-28 22:56:07 +0200 |
commit | b5b9fdb6803f5c5c70a39bd1abe65c6b651886a9 (patch) | |
tree | c8eb61f6cdcddd6aa08e2c63c505d5ca9e1798e1 /src/math/vector.h | |
parent | 1c275dbd78c0c36905b921e889951762ef445e35 (diff) | |
download | colobot-b5b9fdb6803f5c5c70a39bd1abe65c6b651886a9.tar.gz colobot-b5b9fdb6803f5c5c70a39bd1abe65c6b651886a9.tar.bz2 colobot-b5b9fdb6803f5c5c70a39bd1abe65c6b651886a9.zip |
Structs continued
Diffstat (limited to 'src/math/vector.h')
-rw-r--r-- | src/math/vector.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/vector.h b/src/math/vector.h index e8feca6..d8c5511 100644 --- a/src/math/vector.h +++ b/src/math/vector.h @@ -59,6 +59,8 @@ namespace Math All methods are made inline to maximize optimization. + TODO test + */ struct Vector { @@ -150,4 +152,18 @@ struct Vector } }; +//! Convenience function for calculating dot product +float DotProduct(const Vector &left, const Vector &right) +{ + return left.DotProduct(right); +} + +//! Convenience function for calculating cross product +Vector CrossProduct(const Vector &left, const Vector &right) +{ + Vector result = left; + result.CrossProduct(right); + return result; +} + }; // namespace Math |