Commit Graph
110 Commits
Author SHA1 Message Date
Christian Krause 27a7952679 MATH: make Angle class more robust
- clamp some intermediate values to the defined range
  which could be slightly violated due to floating point rounding
2020-12-08 19:30:04 +01:00
Christian Krause 082e792460 MATH: Refactor Line2d
- use standard linear equation Ax + Bx = C
- simplify most calculations
- remove default constructor
- remove unused function
2020-12-08 19:26:25 +01:00
Christian Krause f2195d8dbf MATH: Make implementation of Segment2d more robust
- prevent division by zero
2020-12-08 19:09:08 +01:00
Torbjörn Andersson ba37c52047 JANITORIAL: Remove some unnecessary semicolons 2020-11-17 07:22:49 +01:00
Paweł Kołodziejski e2cd2e6ed7 COMMON: Rename Common::Debug to Common::StreamDebug 2020-10-16 21:47:16 +02:00
Paweł Kołodziejski 35b9cccbde ALL: Merge ResidualVM 2020-10-09 19:44:13 +02:00
Bastien Bouclet b51b484b49 MATH: Silence a noisy warning when building with GCC 9 in C++11 mode 2019-11-27 06:41:05 +01:00
Bastien Bouclet 40720abde2 COMMON: Remove now unused ResidualVM specific float handling 2018-04-14 13:57:05 +02:00
Vincent Pelletier 84f83fe6ea ALL: Rename get_float to READ_LE_FLOAT
For consistency with other functions/macros from common/endian.h .
2017-05-12 13:57:16 +00:00
Bastien Bouclet 16938a6aff MATH: Fix a member shadowing warning in the Ray class 2016-09-15 08:19:15 +02:00
Pawel Kolodziejski 82bc17b63a ALL: Fixed compiler warnings 2016-07-23 19:08:22 +02:00
Bastien Bouclet f6775fab96 MATH: Make slerpQuat const 2016-04-09 08:41:21 +02:00
Bastien Bouclet 5c73d0083d ALL: Merge branch 'tlj' 2016-01-01 07:33:20 +01:00
Bastien Bouclet 992dc2e964 MATH: Fix Line3d::intersectLine2d to perform a segment intersection test
It was previously doing a line vs line segment intersection test
2016-01-01 07:29:57 +01:00
Bastien Bouclet 0389b0ea43 MATH: Add a Ray class
Models a 3d half-line, used for ray tracing
2016-01-01 07:29:55 +01:00
Bastien Bouclet 1cc12b6981 MATH: Make Quaternion::inverse const 2016-01-01 07:29:55 +01:00
Bastien Bouclet 3f3459e4b9 MATH: Add a vector rotation method to the Quaternion class 2016-01-01 07:29:39 +01:00
Bastien Bouclet f4a585b4a3 MATH: Make it clear what Line3d::intersectLine2d does 2015-08-10 21:34:47 +02:00
Bastien Bouclet f3f4275ad1 MATH: Fix Line3d::intersectLine2d to perform a segment intersection test
It was previously doing a line vs line segment intersection test
2015-08-09 19:19:32 +02:00
Bastien Bouclet 6f47c5fbf3 MATH: Simplify gluMathUnProject 2015-03-22 15:57:15 +01:00
Pawel Kolodziejski f7407f35f2 MATH: Add a vector rotation method to the Quaternion class 2015-02-21 12:35:55 +01:00
Pawel Kolodziejski cdd837f379 MATH: convert LGPL code to GPL 2015-01-17 21:08:27 +01:00
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