mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-16 23:19:49 +00:00
TITANIC: More FVector methods
This commit is contained in:
parent
9b1efa3bf5
commit
e674116edb
@ -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
|
||||
|
@ -40,6 +40,14 @@ public:
|
||||
void multiply(FVector *dest, const FVector *src);
|
||||
void fn3();
|
||||
|
||||
/**
|
||||
* Returns the distance between a specified point and this one
|
||||
*/
|
||||
double getDistance(const FVector *src) const;
|
||||
|
||||
static void fn4(FVector *dest, const FVector *v1, const FVector *v2);
|
||||
void fn5(FVector *dest, const void *v) const;
|
||||
|
||||
/**
|
||||
* Returns true if the passed vector equals this one
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user