Add floating and double precision.
Posted: Fri Nov 01, 2013 11:50 am
Hi everyone,
I've made lots of changes to the motor to support the single/double precision. Total redesign of the classes (line/vector/matrix/quaternion/ ...). Someone should reread what I've done because the matrixOps returns strange results and vector2d/vector3d have errors (that I presume due to the precisions of the tests).
The topic is available here: https://sourceforge.net/p/irrlicht/patches/272/
Here is the list of changes:
--- aabbox3d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for getInterpolated().
-Specialisation for intersectsWithLine().
-Add of typedef aabbox3d aabbox3dl and typedef aabbox3d aabbox3dd.
--- dimension2d ---
-Specialisation for getInterpolated().
-Add of typedef dimension2d dimension2dl.
--- irrMath.h ---
-New const u32 ROUNDING_ERROR_U32 = 0 and const f64 HALF_PI64 = PI64 / 2.0.
/// ! \\ Now ROUNDING_ERROR_f32 and f64 are called ROUNDING_ERROR_F32 and F64.
-New min_ for 2/3 types (The output will be the first type).
-New max_ for 2/3 types (The output will be the first type).
-In clamp(), min_ and max_ direct inlining of code.
-Add equals() functions.
-Add iszero() funcitons.
-Add isnotzero() functions.
-Suppression of s32_min/s32_max and s32_clamp.
-New reciprocal_squareroot() with new algorithm for fast math.
-New floor_/ceil_/round_/fract_ and suppression of the floor32/ceil32/round32.
--- line2d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for intersectWith().
-Specialisation for getAngleWith().
-Specialisation for getClosestPoint().
-Add of typedef line2d line2dl and typedef line2d line2dd.
--- line3d ---
-Add equals() functions.
-Operator equality now use equals().
-Add of typedef line3d line3dl and typedef line3d line3dd.
--- CMatrix4 ---
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for setRotationRadians().
-Specialisation for setInverseRotationRadians().
-Specialisation for setRotationDegrees().
-Specialisation for setInverseRotationDegrees().
-Specialisation for getRotationDegrees().
-Specialisation for setRotationAxisRadians().
/// ! \\ I messed up isIdentity_integer_base().
-Specialisation for buildProjectionMatrixPerspectiveFovRH().
-Specialisation for buildProjectionMatrixPerspectiveFovLH().
-Specialisation for buildProjectionMatrixPerspectiveFovInfinityLH().
-Specialisation for buildProjectionMatrixOrthoRH().
-Specialisation for buildProjectionMatrixOrthoLH().
-Specialisation for buildProjectionMatrixPerspectiveRH().
-Specialisation for buildProjectionMatrixPerspectiveLH().
-Specialisation for buildShadowMatrix().
-Specialisation for buildNDCToDCMatrix().
-Specialisation for buildTextureTransform().
-Specialisation for setTextureRotationCenter().
-Add of typedef CMatrix4 matrix4i, CMatrix4 matrix4l and typedef CMatrix4 matrix4d.
--- plane3d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for getIntersectionWithPlane().
-Add of typedef plane3d plane3dl and typedef plane3d plane3dd.
--- CQuaternion ---
/// ! \\ The class "quaternion" is recalled "CQuaternion" to be more logical with CMatrix4
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for getMatrix().
-Specialisation for getMatrixCenter().
-Specialisation for getMatrix_transposed().
-Specialisation for set().
-Specialisation for slerp().
-Specialisation for fromAngleAxis().
-Specialisation for toAngleAxis().
-Specialisation for toEuler().
-Specialisation for rotationFromTo().
-Add of typedef CQuaternion quaternioni, typedef CQuaternion quaternionl,
typedef CQuaternion quaternion and typedef CQuaternion quaterniond.
--- rect ---
-Add equals() functions.
-Operator equality now use equals().
-Add operator <= and >=.
-Add of typedef rect rectu, typedef rect rectl and typedef rect rectd.
--- triangle3d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for isPointInsideFast().
-Specialisation for getIntersectionOfPlaneWithLine().
-Add of typedef triangle3d triangle3dl and typedef triangle3d triangle3dd.
--- vector2d ---
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Changes in the operatos > and <.
-Specialisation for rotateBy().
-Specialisation for getAngleTrig().
-Specialisation for getAngle().
-Specialisation for getAngleWith().
-Specialisation for getInterpolated().
-Specialisation for getInterpolated_quadratic().
-Specialisation for interpolate().
-Add of typedef vector2d vector2dl and typedef vector2d vector2dd.
--- vector3d ---
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Changes in the operatos > and <.
-Specialisation for rotateXZBy().
-Specialisation for rotateXYBy().
-Specialisation for rotateYZBy().
-Specialisation for getInterpolated().
-Specialisation for getInterpolated_quadratic().
-Specialisation for interpolate().
-Specialisation for getHorizontalAngle().
-Specialisation for getSphericalCoordinateAngles().
-Specialisation for rotationToDirection().
-Add of typedef vector3d vector3dl and typedef vector3d vector3dd.
Yes I know that some typedef <s32> or <s64> are pretty useless.
I've made lots of changes to the motor to support the single/double precision. Total redesign of the classes (line/vector/matrix/quaternion/ ...). Someone should reread what I've done because the matrixOps returns strange results and vector2d/vector3d have errors (that I presume due to the precisions of the tests).
The topic is available here: https://sourceforge.net/p/irrlicht/patches/272/
Here is the list of changes:
--- aabbox3d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for getInterpolated().
-Specialisation for intersectsWithLine().
-Add of typedef aabbox3d aabbox3dl and typedef aabbox3d aabbox3dd.
--- dimension2d ---
-Specialisation for getInterpolated().
-Add of typedef dimension2d dimension2dl.
--- irrMath.h ---
-New const u32 ROUNDING_ERROR_U32 = 0 and const f64 HALF_PI64 = PI64 / 2.0.
/// ! \\ Now ROUNDING_ERROR_f32 and f64 are called ROUNDING_ERROR_F32 and F64.
-New min_ for 2/3 types (The output will be the first type).
-New max_ for 2/3 types (The output will be the first type).
-In clamp(), min_ and max_ direct inlining of code.
-Add equals() functions.
-Add iszero() funcitons.
-Add isnotzero() functions.
-Suppression of s32_min/s32_max and s32_clamp.
-New reciprocal_squareroot() with new algorithm for fast math.
-New floor_/ceil_/round_/fract_ and suppression of the floor32/ceil32/round32.
--- line2d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for intersectWith().
-Specialisation for getAngleWith().
-Specialisation for getClosestPoint().
-Add of typedef line2d line2dl and typedef line2d line2dd.
--- line3d ---
-Add equals() functions.
-Operator equality now use equals().
-Add of typedef line3d line3dl and typedef line3d line3dd.
--- CMatrix4 ---
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for setRotationRadians().
-Specialisation for setInverseRotationRadians().
-Specialisation for setRotationDegrees().
-Specialisation for setInverseRotationDegrees().
-Specialisation for getRotationDegrees().
-Specialisation for setRotationAxisRadians().
/// ! \\ I messed up isIdentity_integer_base().
-Specialisation for buildProjectionMatrixPerspectiveFovRH().
-Specialisation for buildProjectionMatrixPerspectiveFovLH().
-Specialisation for buildProjectionMatrixPerspectiveFovInfinityLH().
-Specialisation for buildProjectionMatrixOrthoRH().
-Specialisation for buildProjectionMatrixOrthoLH().
-Specialisation for buildProjectionMatrixPerspectiveRH().
-Specialisation for buildProjectionMatrixPerspectiveLH().
-Specialisation for buildShadowMatrix().
-Specialisation for buildNDCToDCMatrix().
-Specialisation for buildTextureTransform().
-Specialisation for setTextureRotationCenter().
-Add of typedef CMatrix4 matrix4i, CMatrix4 matrix4l and typedef CMatrix4 matrix4d.
--- plane3d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for getIntersectionWithPlane().
-Add of typedef plane3d plane3dl and typedef plane3d plane3dd.
--- CQuaternion ---
/// ! \\ The class "quaternion" is recalled "CQuaternion" to be more logical with CMatrix4
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for getMatrix().
-Specialisation for getMatrixCenter().
-Specialisation for getMatrix_transposed().
-Specialisation for set().
-Specialisation for slerp().
-Specialisation for fromAngleAxis().
-Specialisation for toAngleAxis().
-Specialisation for toEuler().
-Specialisation for rotationFromTo().
-Add of typedef CQuaternion quaternioni, typedef CQuaternion quaternionl,
typedef CQuaternion quaternion and typedef CQuaternion quaterniond.
--- rect ---
-Add equals() functions.
-Operator equality now use equals().
-Add operator <= and >=.
-Add of typedef rect rectu, typedef rect rectl and typedef rect rectd.
--- triangle3d ---
-Add equals() functions.
-Operator equality now use equals().
-Specialisation for isPointInsideFast().
-Specialisation for getIntersectionOfPlaneWithLine().
-Add of typedef triangle3d triangle3dl and typedef triangle3d triangle3dd.
--- vector2d ---
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Changes in the operatos > and <.
-Specialisation for rotateBy().
-Specialisation for getAngleTrig().
-Specialisation for getAngle().
-Specialisation for getAngleWith().
-Specialisation for getInterpolated().
-Specialisation for getInterpolated_quadratic().
-Specialisation for interpolate().
-Add of typedef vector2d vector2dl and typedef vector2d vector2dd.
--- vector3d ---
/ This should be rewritten with template default /
-Add equals() functions.
-Operator equality now use equals().
-Changes in the operatos > and <.
-Specialisation for rotateXZBy().
-Specialisation for rotateXYBy().
-Specialisation for rotateYZBy().
-Specialisation for getInterpolated().
-Specialisation for getInterpolated_quadratic().
-Specialisation for interpolate().
-Specialisation for getHorizontalAngle().
-Specialisation for getSphericalCoordinateAngles().
-Specialisation for rotationToDirection().
-Add of typedef vector3d vector3dl and typedef vector3d vector3dd.
Yes I know that some typedef <s32> or <s64> are pretty useless.