aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control
diff options
context:
space:
mode:
authorDavid Fioramonti2017-08-29 18:40:43 -0700
committerDavid Fioramonti2017-08-30 19:53:13 -0700
commitf411da49020b903c9acfcc43067a77402d128963 (patch)
treefc8e091d7aabe30d166323532565cebe7df20c21 /engines/titanic/star_control
parentf1e673c133b977050cce320e1fbebc13172279cf (diff)
downloadscummvm-rg350-f411da49020b903c9acfcc43067a77402d128963.tar.gz
scummvm-rg350-f411da49020b903c9acfcc43067a77402d128963.tar.bz2
scummvm-rg350-f411da49020b903c9acfcc43067a77402d128963.zip
TITANIC: Renamed a dvector func
More correct function naming then before.
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r--engines/titanic/star_control/dvector.cpp2
-rw-r--r--engines/titanic/star_control/dvector.h4
-rw-r--r--engines/titanic/star_control/star_camera.cpp14
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp
index 88390ebc3f..73ffd5be54 100644
--- a/engines/titanic/star_control/dvector.cpp
+++ b/engines/titanic/star_control/dvector.cpp
@@ -102,7 +102,7 @@ DAffine DVector::getFrameTransform(const DVector &v) {
return matrix4.compose(matrix3);
}
-DAffine DVector::rotXY() const {
+DAffine DVector::formRotXY() const {
DVector v1 = getAnglesAsVect();
DAffine m1, m2;
m1.setRotationMatrix(X_AXIS, v1._y * Rad2Deg);
diff --git a/engines/titanic/star_control/dvector.h b/engines/titanic/star_control/dvector.h
index e9ca257498..a1c67d7382 100644
--- a/engines/titanic/star_control/dvector.h
+++ b/engines/titanic/star_control/dvector.h
@@ -83,10 +83,10 @@ public:
DAffine getFrameTransform(const DVector &v);
/**
- * Returns a affine matrix that does a x then a y axis frame rotation
+ * Constructs an affine matrix that does a x then a y axis frame rotation
* based on the orientation of this vector
*/
- DAffine rotXY() const;
+ DAffine formRotXY() const;
/**
* Returns true if the passed vector equals this one
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp
index b4517b9aa4..161727752d 100644
--- a/engines/titanic/star_control/star_camera.cpp
+++ b/engines/titanic/star_control/star_camera.cpp
@@ -325,7 +325,7 @@ void CStarCamera::setViewportAngle(const FPoint &angles) {
tempV1 = _lockedStarsPos._row2 - _lockedStarsPos._row1;
diffV = tempV1;
- m1 = diffV.rotXY();
+ m1 = diffV.formRotXY();
m1 = m1.compose(subX);
subX = m1.inverseTransform();
subX = subX.compose(subY);
@@ -513,12 +513,12 @@ bool CStarCamera::lockMarker2(CViewport *viewport, const FVector &secondStarPosi
return true;
FVector firstStarPosition = _lockedStarsPos._row1;
DAffine m2(0, firstStarPosition); // Identity matrix and col4 as the 1st stars position
- DVector tempV1 = secondStarPosition - firstStarPosition;
- DAffine m1 = tempV1.rotXY();
+ DVector starDelta = secondStarPosition - firstStarPosition;
+ DAffine m1 = starDelta.formRotXY();
m1 = m1.compose(m2);
m2 = m1.inverseTransform();
- DVector tempV2 = _viewport._position;
+ DVector viewPosition = _viewport._position;
DAffine m4;
m4._col1 = viewport->_position;
m4._col2 = DVector(0.0, 0.0, 0.0);
@@ -552,15 +552,15 @@ bool CStarCamera::lockMarker2(CViewport *viewport, const FVector &secondStarPosi
tempV3._z = m5._row3._z * rowScale2 + m4._col1._z;
m4._col4 = tempV3;
- tempV2 = tempV2.dAffMatrixProdVec(m2);
+ viewPosition = viewPosition.dAffMatrixProdVec(m2);
m4._col1 = m4._col1.dAffMatrixProdVec(m2);
m4._col3 = m4._col3.dAffMatrixProdVec(m2);
m4._col2 = m4._col2.dAffMatrixProdVec(m2);
m4._col4 = m4._col4.dAffMatrixProdVec(m2);
double minDistance;
- // Find the angle of rotation for m4._col1 that gives the minimum distance to tempV2
- double minDegree = calcAngleForMinDist(tempV2,m4._col1,minDistance);
+ // Find the angle of rotation for m4._col1 that gives the minimum distance to viewPosition
+ double minDegree = calcAngleForMinDist(viewPosition,m4._col1,minDistance);
m4._col1.rotVectAxisY((double)minDegree);
m4._col2.rotVectAxisY((double)minDegree);