aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control/fvector.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-16 17:05:51 -0400
committerPaul Gilbert2016-07-17 13:09:51 -0400
commite674116edbd61054dae994033c0b0c10259b8aed (patch)
treed85e92193f595a6df9e52d59b89683bdf8849bf9 /engines/titanic/star_control/fvector.cpp
parent9b1efa3bf5696ea606b9374d216d4a1ecf52610b (diff)
downloadscummvm-rg350-e674116edbd61054dae994033c0b0c10259b8aed.tar.gz
scummvm-rg350-e674116edbd61054dae994033c0b0c10259b8aed.tar.bz2
scummvm-rg350-e674116edbd61054dae994033c0b0c10259b8aed.zip
TITANIC: More FVector methods
Diffstat (limited to 'engines/titanic/star_control/fvector.cpp')
-rw-r--r--engines/titanic/star_control/fvector.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
index a7520bf508..ce7b62bc16 100644
--- a/engines/titanic/star_control/fvector.cpp
+++ b/engines/titanic/star_control/fvector.cpp
@@ -22,6 +22,7 @@
#include "titanic/star_control/fvector.h"
#include "common/algorithm.h"
+#include "common/textconsole.h"
namespace Titanic {
@@ -47,4 +48,23 @@ void FVector::fn3() {
_z *= 1.0 / hyp;
}
+double FVector::getDistance(const FVector *src) const {
+ double xd = src->_x - _x;
+ double yd = src->_y - _y;
+ double zd = src->_z - _z;
+
+ return sqrt(xd * xd + yd * yd + zd * zd);
+}
+
+void FVector::fn4(FVector *dest, const FVector *v1, const FVector *v2) {
+ FVector tempVector(v1->_x + v2->_x, v1->_y + v2->_y, v1->_z + v2->_z);
+ tempVector.fn3();
+
+ *dest = tempVector;
+}
+
+void FVector::fn5(FVector *dest, const void *v) const {
+ error("TODO: FVector::fn5");
+}
+
} // End of namespace Titanic