From e1695101bc464fe1a4917f7cd25db38854c923e0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 16 Jul 2016 08:50:42 -0400 Subject: TITANIC: Beginnings of matrix and vector classes --- engines/titanic/star_control/dvector.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 engines/titanic/star_control/dvector.cpp (limited to 'engines/titanic/star_control/dvector.cpp') diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp new file mode 100644 index 0000000000..8e071cf0ab --- /dev/null +++ b/engines/titanic/star_control/dvector.cpp @@ -0,0 +1,28 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/star_control/dvector.h" + +namespace Titanic { + + +} // End of namespace Titanic -- cgit v1.2.3 From 9b1efa3bf5696ea606b9374d216d4a1ecf52610b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 16 Jul 2016 12:36:02 -0400 Subject: TITANIC: Added FMatrix methods --- engines/titanic/star_control/dvector.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/titanic/star_control/dvector.cpp') diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp index 8e071cf0ab..e4c5b15cb0 100644 --- a/engines/titanic/star_control/dvector.cpp +++ b/engines/titanic/star_control/dvector.cpp @@ -21,8 +21,17 @@ */ #include "titanic/star_control/dvector.h" +#include "common/algorithm.h" namespace Titanic { +void DVector::fn3() { + double hyp = sqrt(_x * _x + _y * _y + _z * _z); + assert(hyp); + + _x *= 1.0 / hyp; + _y *= 1.0 / hyp; + _z *= 1.0 / hyp; +} } // End of namespace Titanic -- cgit v1.2.3