-
Notifications
You must be signed in to change notification settings - Fork 9
Aardvark 5.0 changelog
Aardvark 5 comes with a lot of changes including new features. Some parts of the API were redesigned, requiring developers to manually port their applications from Aardvark 4.x. This document is mainly intended as a reference to make this process easier, but also for interested users to see what's new.
The following changes are especially critical as they only affect the implementation but not the API itself. As such, there will be no compiler errors. It is recommended that developers read this list carefully and search their projects for code that relies on the affected functionality:
- Changed the parameter order of
Vec.reflect
,Vec.refract
, andclamp
to allow for easier piping - Adapted
Vec.Reflect
to be equivalent to GLSL'sreflect
and F#Vec.reflect
- Static creators and constructors for rotations in all transformation types and matrix types (e.g.
Rot3d(from, into)
andRot3d(axis, angle)
) used to work with unnormalized vectors as input. They require normalized vectors now. - Indexer of
Rot3d
uses the quaternion layout (w, (x, y, z)) now instead of (x, y, z, w). -
GetScale()
ofM44*
uses the 4D basis now. UseGetScale3()
for 3D basis. - 2D rotations are now counter-clockwise instead of clockwise (e.g.
Rot2d(float)
,M33d.Rotation(float)
) - Multiplication of two
Rot2*
trafos is a concatenation now (addition of angles). Previously it merely multiplied the contained angles. - Equals method and (==) operator of
Rot**
types use angular distance now. E.g. r and -r for any (r :Rot3d
) are equal. - Added missing
CultureInfo.InvariantCulture
to format and parse methods in-
Plane2d
,Plane3d
Sphere3d
Circle3d
ImmutablePolygon
- Trafo types
-
- (>= 5.1) Indexers of the following types no longer throw
IndexOutOfRangeException
, but will fail silently with horrible consequences:- Vector types
- Matrix types
- Quaternion types
- Rot types
- Scale types
- Shift types
- Color types
The specialized transformation types (Trafo2d
, Rot3d
, Shift3f
, etc.) were reworked to be more consistent with each other. We also added missing variants for 2D and float32
data:
- All trafo types are available for 2D now
- Constructors are lightweight and simple
- Trafos can be "up cast", that is into more general types (e.g.
Rot3f
intoEuclidean3f
) - For "down casts" there are static creators (e.g.
Euclidean3f
intoRot3f
->Rot3f.FromEuclidean3f
). These creators do sanity checks and throw exceptions. - Split functionality of
Rot3*
into two classes: AddedQuaternion*
for general quaternions whereasRot3*
represents unit quaternions only. - Removed
Rot3*.Conjugated
-> useRot3*.Inverse
-
Rot**
comparison works based on angular distance now - Removed complex
Rot**
constructors and added static creators instead - Removed static aliases for operators like
Multiply()
. Use the operators directly! - Moved static methods of
Rot*
,Euclidean*
,Similarity*
to static classesRot
,Euclidean
,Similarity
respectively. - Added
Affine**
for affine transformations (linear map and translation). -
Trafo2f
andTrafo3f
added
The static class Fun
, containing essential math and other various methods, was extended to support vector inputs where appropriate. For example, Fun.Sqrt
may be used on a V3i
vector to compute the square root for each component resulting in a V3d
vector. Moreover, functions were renamed, added, and made more efficient:
- Moved some static methods of
Complex*
toFun
. UseFun.Csqrt
to compute the complex square roots. - Float overloads of certain
Fun
methods useSystem.MathF
instead ofSystem.Math
when available -
Fun.Smoothstep
added -
Fun.AcosC
->Fun.AcosClamped
-
Fun.AsinC
->Fun.AsinClamped
-
Fun.FloatToBits
andFun.FloatFromBits
added -
Fun.IsFinite
added -
Fun.MultiplyAdd
added -
Fun.Pown
added -
Fun.Truncate
added -
Fun.Saturate
added -
Fun.Signum
andFun.Signumi
added -
Fun.CopySign
added -
ApproxEqual
->ApproximateEquals
inFun
class as extensions - Most methods in
Fun
work elementwise for vectors now
Some of our custom types now have properties that make it possible to use them in various generic F# functions. For example, it is now possible to compute the sum of a list of vectors:
let data = [V3i(1, 2, 3); V3i(3, 4, 5)]
let sum = data |> List.sum
We've added a generic math library for F#. Like many methods in Fun
, these functions work for scalars as well as vectors. They are truly generic, making it possible to use custom-defined types (if the type satisfies the respective constraints):
zero
one
acos
acosh
asin
asinh
atan
atanh
atan2
cos
cosh
sin
sinh
tan
tanh
ceiling
floor
truncate
round
exp
log
log2
log10
sqrt
pow
pown
sqr
cbrt
abs
signum
signumi
min
max
clamp
saturate
lerp
smoothstep
copysign
degrees
radians
madd
isNaN
isInfinity
isPositiveInfinity
isNegativeInfinity
isFinite
- Renamed matrix and trafo static creators
Rotation(V3*)
->RotationEuler(V3*)
- Renamed matrix and trafo static creators
Rotation(real, real, real)
->RotationEuler(real, real, real)
- Renamed trafo static creators
RotationInDegrees(V3*)
->RotationEulerInDegrees(V3*)
- Renamed trafo static creators
RotationInDegrees(real, real, real)
->RotationEulerInDegrees(real, real, real)
- Renamed
Rot**.FromEulerAngles
->Rot**.RotationEuler
- Renamed matrix static creator
M***.Rotation(V3*, V3*)
->M***.RotateInto(V3*, V3*)
- Renamed matrix property
Det
->Determinant
- Added matrix constructor with single value
- Added
M34*
constructor fromM33*
andV3*
- Added
Diagonal
property for matrices andAntiDiagonal
for square matrices - Added
FromDiagonal
andFromAntiDiagonal
static creators for matrices and square matrices respectively - Added vector-matrix multiplication, where the vector is treated as row vector. E.g
are equivalent.
let mul (m : M33f) (v : V3f) = m * v let mul' (m : M33f) (v : V3f) = v * m.Transposed
- Removed
InvTransform*
from general matrix types
- Moved static methods of vector types to static class
Vec
. E.g.,V3d.Dot
->Vec.Dot
- Merged
VecFun
with newVec
static class - Added
AngleBetween
methods to compute the angle between two vectors (includes a fast naive and a slower more accurate variant) - Renamed
V**.OuterProduct
->Vec.Outer
orv.Outer
-
Vec.DistanceSquared
returns the field type of the vector. E.gV2i * V2i -> int
- Added missing
Normalized
,Rot*
properties for integer vectors - Added conversion function overloads for vector types in
Conversion
class - Removed
Average
over array of vectors -> useComputeCentroid
- Deleted obsolete
Vec
class, useVector
for n-dimensional vectors instead -
Abs
->Abs()
-
Floor
->Floor()
-
Ceiling
->Ceiling()
-
Round
->Round()
-
Negated
->operator (-)
- Renamed
BoxFun
->Box
/Range
-
Box**.Intersection
->Box.Intersection
-
Box**.Union
->Box.Union
- Moved static methods of color types to static class
Col
. -
Col.LinComRawC*f
->Col.LinComRawF
,Col.LinComRawC*d
->Col.LinComRawD
-
ImageTrafo.Rot0
renamed toImageTrafo.Identity
- Removed
ColFun
- Added various missing
IRandomSystem
methods for vectors and colors - Fixed and added various functions for
Complex*
- Changed
Equals
method of various types to useEquals
on their fields to be consistent withfloat.Equals
anddouble.Equals
(NaN.Equals(NaN) == true
whereasNaN != NaN
).