aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control/fvector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/star_control/fvector.cpp')
-rw-r--r--engines/titanic/star_control/fvector.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
index de33bcf2a0..b0667c532b 100644
--- a/engines/titanic/star_control/fvector.cpp
+++ b/engines/titanic/star_control/fvector.cpp
@@ -34,13 +34,13 @@ void FVector::fn1(FVector *v) {
v->_z = _z;
}
-void FVector::multiply(FVector *dest, const FVector *src) {
+void FVector::crossProduct(FVector *dest, const FVector *src) {
dest->_x = (src->_z * _y) - (_z * src->_y);
dest->_y = (src->_x * _z) - (_x * src->_z);
dest->_z = (src->_y * _x) - (_y * src->_x);
}
-double FVector::fn3() {
+double FVector::normalize() {
double hyp = sqrt(_x * _x + _y * _y + _z * _z);
assert(hyp);
@@ -50,6 +50,13 @@ double FVector::fn3() {
return hyp;
}
+void FVector::addAndNormalize(FVector *dest, const FVector *v1, const FVector *v2) {
+ FVector tempVector(v1->_x + v2->_x, v1->_y + v2->_y, v1->_z + v2->_z);
+ tempVector.normalize();
+
+ *dest = tempVector;
+}
+
double FVector::getDistance(const FVector *src) const {
double xd = src->_x - _x;
double yd = src->_y - _y;
@@ -58,13 +65,6 @@ double FVector::getDistance(const FVector *src) const {
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 CStarControlSub6 *sub6) const {
error("TODO: FVector::fn5");
}