Commit Graph

138 Commits

Author SHA1 Message Date
Christian Krause
cc9734643b MATH: Add/fix matrix operators
- fix == operator
- add != operator
2014-12-31 17:07:19 +01:00
Joni Vähämäki
2c1ae44b5c GRIM: Fix matrix to quaternion conversion. Fixes #1132 2014-12-25 23:12:26 +02:00
Christian Krause
0fe9168944 MATH: Don't normalize a (0, 0, 0, 0) quat
- this fixes the issue of the vanished boats in EMI's lava puzzle
- without the patch, the division by 0.0f causes the quat's values
  to be NAN
- the floating point NAN value is ignored by OpenGL, so the vertices
  are not drawn at all
2014-10-19 01:21:34 +02:00
Joseph Jezak
274e11a68e MATH: Add const qualifier to getEuler. 2014-09-11 13:38:30 -04:00
Joseph Jezak
cfeff853be MATH: Add factorization for non-unique answers in Rotation3D. 2014-09-11 13:38:30 -04:00
Joseph Jezak
e34d0ddba3 MATH: Replace Quaternion XYZ with Euler. 2014-09-11 13:38:30 -04:00
Joseph Jezak
99fa91053c MATH: Rename XYZ Rotation Functions to Euler to better describe the function. 2014-09-11 13:38:28 -04:00
Bastien Bouclet
14bacc9496 MATH: Fix typo in gluMathUnProject
Fixes the right click mode in Myst 3
2014-08-24 08:37:35 +02:00
Pawel Kolodziejski
e539b27af8 MATH: improve type support for viewport argument 2014-08-15 12:25:48 +02:00
Pawel Kolodziejski
9ad08415ce MATH: no need do cast anymore in Matrix4::inverse 2014-07-12 07:08:29 +02:00
Joel Teichroeb
cb6a58e01e MATH: Make Matrix4::inverse not const as it changes data 2014-07-10 20:23:06 -07:00
Pawel Kolodziejski
46a91377d8 MATH: added few GLU helpers 2014-07-10 07:27:18 +02:00
Pawel Kolodziejski
5fed6150a0 JANITORIAL: formatting headers 2014-07-08 23:10:17 +02:00
Joni Vähämäki
23a99a9f2b EMI: Implement head limits. 2014-07-02 22:43:58 +03:00
Joseph Jezak
d2d23738a5 MATH: Replace Euler Angle Implementation in Quaternions with Rotation3D based method. 2014-07-01 16:18:12 -04:00
Joseph Jezak
c1b5adf348 MATH: Add new quaternion capability. 2014-07-01 16:18:08 -04:00
Joseph Jezak
f57768ea28 MATH: Add comments and rename getQuaternion. 2014-07-01 11:27:08 -04:00
Joseph Jezak
78772c999b MATH: Rename getVector3d and add comments for the Vector3d class. 2014-07-01 11:27:02 -04:00
Joel Teichroeb
abfd775d51 MATH: Cast M_PI to a float to fix an MSVC warning 2014-06-25 13:45:11 -07:00
Joseph Jezak
b4e730beaa MATH: Keep position when building rotation. 2014-06-24 11:36:35 -04:00
Joseph Jezak
231a98056f MATH: Fix gimbal lock for ZXY. 2014-06-24 11:36:12 -04:00
Joseph Jezak
76d36f676b MATH: Add a selectable Euler Order to Rotation3D. 2014-06-23 09:04:25 -04:00
Joseph Jezak
35462205aa MATH: Fix indentation for matrix4. 2014-06-23 09:04:07 -04:00
Joni Vähämäki
350d916670 MATH: Make inverseTranslate and inverseRotate methods of Matrix4 const. 2014-06-17 03:47:50 +03:00
Joel Teichroeb
6ad4b70d84 Merge pull request #926 from Akz-/pathfind-fix
GRIM/EMI: Pathfinding fixes
2014-06-16 10:54:01 -07:00
Joni Vähämäki
b5cdd1240f EMI: Only draw models for actors inside the view frustum.
This adds math classes for doing frustum culling in software. These could be used for optimizing performance in many other places as well. For example, if an actor is outside the view frustum, it may not be necessary to do expensive keyframe animation and vertex skinning calculations for that actor.
2014-06-16 15:42:18 +03:00
Joni Vähämäki
db5a91bcb1 MATH: Return false in intersectLine2d if lines do not intersect. 2014-06-15 13:32:15 +03:00
Joni Vähämäki
b6b7b51528 MATH: More efficient matrix multiplication implementation for 3x3 and 4x4 matrix specializations. 2014-06-15 03:13:40 +03:00
Joni Vähämäki
47aa1ace87 EMI: Added support for animation priorities and implemented blending. 2014-05-31 02:50:06 +03:00
Dries Harnie
dbf3b2e5f8 JANITORIAL: Fix missing reference in Math::{Line2d,Angle} 2014-04-21 14:22:01 +02:00
Pawel Kolodziejski
8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
Einar Johan Trøan Sømåen
adc0067bf7 MATH: Remove duplicated deg/rad-conversions, replacing them by common/math.h-functionality 2014-02-20 12:22:43 +01:00
Einar Johan Trøan Sømåen
207d7c54d7 MATH: Return Line3d& from it's operator= 2014-01-07 18:29:34 +01:00
Giulio Camuffo
1d543e5e1d MATH: Document Matrix{3,4}::buildFromTargetDir. 2013-01-13 12:09:21 +01:00
Giulio Camuffo
d2f4bf83db MATH: Add a stream debug operator for Line2d. 2013-01-09 18:42:23 +01:00
Giulio Camuffo
2936a82fbf MATH: Move the debug '<<' operators to the Math namespace. 2013-01-09 18:41:50 +01:00
Giulio Camuffo
00a42f3d85 MATH: Fix Line2d intersection functions. Fix #682 2013-01-09 18:27:07 +01:00
Paweł Kołodziejski
175620b62a ALL: change license headers from LGPL to GPL, and few updates 2012-12-19 23:15:43 +01:00
Dries Harnie
8bb8163e29 MATH: Add operator * for Math::Quaternion 2012-11-13 21:51:36 +01:00
Dries Harnie
6334cc0290 EMI: Gfx::startActorDraw() accepts a quaternion 2012-11-13 21:51:11 +01:00
Dries Harnie
17207bc879 EMI: Code style fix 2012-07-03 20:06:29 +02:00
Dries Harnie
9541c89859 MATH: Add fromEuler() to Math::Quaternion 2012-07-03 00:20:38 +02:00
Dries Harnie
0b5a4b0cd1 MATH: Add transpose() to Math::Matrix4 2012-07-03 00:20:36 +02:00
Thomas Allen
981189fedf GRIM: moved lookAtMatrix() to be a member function of Matrix3 (and Matrix4) 2012-03-21 11:32:23 +01:00
Thomas Allen
a045e2177b GRIM: add check for null pointers in getPitchYawRoll 2012-03-21 11:32:23 +01:00
Thomas Allen
8484d7870e GRIM: checked, cleaned, and moved Euler calculations to rotation3d.h 2012-03-21 11:32:23 +01:00
Thomas Allen
67e7a05119 GRIM: relocating and cleaning invertAffineOrthonormal 2012-03-21 11:32:22 +01:00
Thomas Allen
3eb771e206 MATH: Moved angle clamp function to angle.cpp 2012-03-21 11:32:20 +01:00
Giulio Camuffo
8d57a8b6d4 GRIM: Fix wrong ')' placement. Fix #557 2012-03-08 14:52:14 +01:00
Dries Harnie
c3237e129e EMI: use X-Z in Vector3d::intersectLine2d 2012-02-18 22:41:02 +01:00
Giulio Camuffo
3344b3c756 GRIM: Setup the lights from the closest to the farthest to the actor position.
This way if OpenGL can't handle all the set lights it will use the most
important ones. Fix #481
2012-02-10 14:57:58 +01:00
Einar Johan T. Sømåen
f0db69c8ff MATH: Correct a critical typo in the slerp-function. 2012-02-01 12:46:05 +01:00
Einar Johan T. Sømåen
d4413d7f58 MATH: Add in the inverse functions from Portalib3d 2012-01-31 17:00:50 +01:00
Einar Johan T. Sømåen
ee310dd00b MATH: Fix toMatrix for quaternions. 2012-01-30 23:48:14 +01:00
Einar Johan T. Sømåen
1833ac33a1 MATH: Fix the slerp-function 2012-01-30 23:33:03 +01:00
Giulio Camuffo
2148c729f1 MATH: Unify VectorNd::readFromStream. 2012-01-30 21:57:06 +01:00
Giulio Camuffo
87107bc022 MATH: Remove Vector4d::scalarProduct, since that's just Vector::dotProduct. 2012-01-30 21:45:22 +01:00
Einar Johan T. Sømåen
74047546a0 MATH: Add stream-reading to the vector-classes 2012-01-30 21:04:08 +01:00
Pawel Kolodziejski
626e91f23a rename -> ResidualVM 2012-01-06 23:15:48 +01:00
Einar Johan T. Sømåen
45a12eb683 MATH: Fix Vector4d on msvc, thanks to klusark 2011-12-30 19:19:45 +01:00
jj
ab58dd267b MATH: Documented rotation3d.h rotation conventions. 2011-12-30 16:54:27 +01:00
Einar Johan T. Sømåen
b863569294 MATH: Add some quaternion-math from plib. 2011-12-30 14:49:01 +01:00
Einar Johan T. Sømåen
6da0bcb681 MATH: Add Vector4D 2011-12-30 12:18:30 +01:00
Giulio Camuffo
062cf9292f MATH: Use a one-dimensional array for the matrix data. Should fix #414 2011-11-20 15:17:41 +01:00
Einar Johan T. Sømåen
f56a340193 MATH: Fix Matrix-compile on clang 2011-11-11 00:18:25 +01:00
Giulio Camuffo
e982124e05 MATH: Fix build on certain compilers. 2011-11-04 21:07:07 +01:00
Giulio Camuffo
1e86d51b1e MATH: Minor Matrix optimisations. 2011-11-04 15:25:22 +01:00
Giulio Camuffo
46a8d461e0 GRIM: Fix bounding box calculation. Fix #391 2011-10-18 17:43:35 +02:00
Giulio Camuffo
f0967439af MATH: Don't normalize zero vectors. Fix #387 2011-10-09 19:14:38 +02:00
Giulio Camuffo
3534129850 MATH: New function to calculate the distance of a point to a rect. 2011-10-04 21:37:39 +02:00
Giulio Camuffo
ba10e07422 MATH: Normalize the angle only if/when requested. 2011-09-30 17:42:26 +02:00
Giulio Camuffo
846afc03a8 MATH: Adapt the angle to the new range. 2011-09-29 22:14:41 +02:00
Giulio Camuffo
b7010c4c1d MATH: Fix wrong angle management when below the lower range boundary. 2011-09-29 22:12:32 +02:00
Giulio Camuffo
7745dcb8a1 MATH: Fix conversion from MatrixBase to Matrix. 2011-09-29 15:31:27 +02:00
Giulio Camuffo
cd6832aad7 MATH: Fix crash with mac osx. Fix #363 2011-09-22 21:39:29 +02:00
Giulio Camuffo
1ae91bd8a9 MATH: Make some global functions static function members. 2011-09-18 19:14:25 +02:00
Giulio Camuffo
59d219c955 MATH: Fix two warnings. 2011-09-18 18:52:44 +02:00
Giulio Camuffo
ee547b8da1 MATH: Speedup. 2011-09-18 18:28:36 +02:00
Giulio Camuffo
f480f8ecc8 MATH: Minor fixes. 2011-09-18 17:10:36 +02:00
Giulio Camuffo
96aaf1ad81 MATH: Use the new Angle class. 2011-09-18 16:23:55 +02:00
Giulio Camuffo
32a669e80b MATH: Add an Angle class. 2011-09-18 16:19:06 +02:00
Giulio Camuffo
243081610a MATH: Call the base constructor with the template arguments. Fix #362 2011-09-17 21:40:37 +02:00
Giulio Camuffo
3fecc996c8 MATH: Renamed the static operators functions. 2011-09-17 18:57:12 +02:00
Giulio Camuffo
d983ec1d8d MATH: Remove redundant license header. 2011-09-15 19:02:47 +02:00
Giulio Camuffo
a900a5ab10 MATH: Further work on the Matrix class.
The vectors are now matrices.
2011-09-14 23:06:14 +02:00
Giulio Camuffo
34a7398293 MATH: Moved Rotation3D to its own file. 2011-09-14 23:06:06 +02:00
Giulio Camuffo
fb359369d8 MATH: New utils.h file with common functions. 2011-09-14 23:06:00 +02:00
Giulio Camuffo
0083c8619c MATH: Move the math classes to their own math/ dir and Math namespace. 2011-09-14 23:05:52 +02:00