2016-02-25 08:39:15 -05:00
|
|
|
/* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-04-05 21:29:32 -04:00
|
|
|
#ifndef TITANIC_FPOSE_H
|
|
|
|
#define TITANIC_FPOSE_H
|
2016-02-25 08:39:15 -05:00
|
|
|
|
2016-07-16 12:36:02 -04:00
|
|
|
#include "titanic/star_control/fmatrix.h"
|
|
|
|
|
2016-02-25 08:39:15 -05:00
|
|
|
namespace Titanic {
|
|
|
|
|
2017-04-06 07:20:10 -04:00
|
|
|
/*
|
|
|
|
* This class combines a position and orientation in 3D space
|
2017-08-16 19:44:11 -07:00
|
|
|
* TODO: Merge with DAffine
|
2017-04-06 07:20:10 -04:00
|
|
|
*/
|
2017-04-05 21:29:32 -04:00
|
|
|
class FPose : public FMatrix {
|
2016-07-17 23:18:06 -04:00
|
|
|
public:
|
2017-03-08 22:05:43 -05:00
|
|
|
FVector _vector;
|
2016-03-05 15:44:39 -05:00
|
|
|
public:
|
2017-04-05 21:29:32 -04:00
|
|
|
FPose();
|
|
|
|
FPose(Axis axis, float amount);
|
|
|
|
FPose(const FPose &src);
|
|
|
|
FPose(const FPose &s1, const FPose &s2);
|
2016-06-30 13:40:55 -04:00
|
|
|
|
2016-07-16 18:23:25 -04:00
|
|
|
/**
|
2017-03-12 19:55:56 -04:00
|
|
|
* Sets an identity matrix
|
2016-07-16 18:23:25 -04:00
|
|
|
*/
|
2017-03-12 19:55:56 -04:00
|
|
|
void identity();
|
2016-07-16 18:23:25 -04:00
|
|
|
|
|
|
|
/**
|
2017-03-12 20:18:53 -04:00
|
|
|
* Sets a rotation matrix for the given axis for the given amount
|
2016-07-16 18:23:25 -04:00
|
|
|
*/
|
2017-04-05 21:08:51 -04:00
|
|
|
void setRotationMatrix(Axis axis, float val);
|
2016-07-17 16:43:53 -04:00
|
|
|
|
2017-04-05 21:29:32 -04:00
|
|
|
/**
|
|
|
|
* Copy from the specified source pose
|
|
|
|
*/
|
|
|
|
void copyFrom(const FPose &src);
|
2017-03-08 23:27:26 -05:00
|
|
|
|
2017-03-11 14:30:31 -05:00
|
|
|
/**
|
2017-04-05 21:29:32 -04:00
|
|
|
* Copy from the specified source matrix
|
2017-03-11 14:30:31 -05:00
|
|
|
*/
|
|
|
|
void copyFrom(const FMatrix &src);
|
|
|
|
|
2017-08-15 19:31:17 -07:00
|
|
|
/**
|
2017-08-16 19:44:11 -07:00
|
|
|
* The inverse of rotation and the position vector
|
2017-08-15 19:31:17 -07:00
|
|
|
*/
|
2017-08-16 19:44:11 -07:00
|
|
|
FPose inverseTransform() const;
|
2016-03-05 15:44:39 -05:00
|
|
|
};
|
2016-02-25 08:39:15 -05:00
|
|
|
|
|
|
|
} // End of namespace Titanic
|
2016-03-05 15:44:39 -05:00
|
|
|
|
2017-04-05 21:29:32 -04:00
|
|
|
#endif /* TITANIC_FPOSE_H */
|