|
OpenSpace3D libs
OpenSpace 3D libraries for plugITs and OS3D developer
|
Functions | |
| isCoordInRect (x, y, rect) | |
| Test if the coordinates are in the rectangle. | |
| minf (a, b) | |
| Get the smallest float value. | |
| ftori (val) | |
| Convert a float value to a rounded int value (float to rounded integer) | |
| zeroVector (vec) | |
| Test if a vector is set to 0. | |
| zeroVectorF (vec) | |
| Test if a float vector is set to 0. | |
| vectorIsZero (vec) | |
| Test if a vector is set to 0. | |
| vector2dIsZero (vec) | |
| Test if a 2d vector is set to 0. | |
| vectorIsZeroF (vec) | |
| Test if a float vector is set to 0. | |
| vector2dIsZeroF (vec) | |
| Test if a 2d float vector is set to 0. | |
| vectorEqual (vec1, vec2) | |
| Test if two vectors are equal. | |
| vectorEqualF (vec1, vec2) | |
| Test if two float vectors are equal. | |
| normalizeVectorF (vec) | |
| Normalize a float vector. | |
| vectorAverageF (vec) | |
| Get the average of a vector. | |
| vectorCubeF (vec) | |
| Get the cube of a vector. | |
| getVectorLength (vec1) | |
| Get a vector length. | |
| getVectorLengthF (vec1) | |
| Get a vector length. | |
| getVector4LengthF (vec1) | |
| Get a vector 4 length. | |
| getVectorDistance (vec1, vec2) | |
| Get the distance between 2 vectors. | |
| getVector2dDistance (vec1, vec2) | |
| Get the distance between 2 2D vectors. | |
| getVectorDistanceF (vec1, vec2) | |
| Get the distance between 2 vectors. | |
| crossVector (vec1, vec2) | |
| Cross product of two vectors. | |
| crossVectorF (vec1, vec2) | |
| Cross product of two vectors. | |
| dotVector (vec1, vec2) | |
| Dot product of two vectors. | |
| dotVectorF (vec1, vec2) | |
| Dot product of two vectors. | |
| getVectorAngle (vec1, vec2) | |
| Get the angle between 2 vectors in radian. | |
| getVector2dAngle (vec1, vec2) | |
| Get the angle between 2 2D vectors in degree. | |
| getVectorAngleF (vec1, vec2) | |
| Get the angle between 2 vectors in radian. | |
| getVectorOrientedAngleF (vec1, vec2, planenormal) | |
| Get the oriented angle between 2 vectors in radian, between pi and -pi. | |
| minVector (vec1, vec2) | |
| Min of two vectors. | |
| minVectorF (vec1, vec2) | |
| Min of two vectors. | |
| minVector2F (vec1, vec2) | |
| Min of two vectors 2. | |
| maxVector (vec1, vec2) | |
| Max of two vectors. | |
| maxVectorF (vec1, vec2) | |
| Max of two vectors. | |
| maxVector2F (vec1, vec2) | |
| Max of two vectors. | |
| subVector (vec1, vec2) | |
| Substract two vectors. | |
| subVectorF (vec1, vec2) | |
| Substract two float vectors. | |
| subVector2 (vec1, vec2) | |
| Substract two vectors 2. | |
| subVector2F (vec1, vec2) | |
| Substract two float vectors 2. | |
| addVector (vec1, vec2) | |
| Add two vectors. | |
| addVectorF (vec1, vec2) | |
| Add two float vectors. | |
| addVector2 (vec1, vec2) | |
| Add two vectors. | |
| addVector2F (vec1, vec2) | |
| Add two float vectors 2. | |
| divideVector (vec1, vec2) | |
| Divide two vectors. | |
| divideVectorF (vec1, vec2) | |
| Divide two float vectors. | |
| divideVector2 (vec1, vec2) | |
| Divide two vectors 2. | |
| divideVector2F (vec1, vec2) | |
| Divide two float vectors 2. | |
| multiplyVector (vec1, vec2) | |
| Multiply two vectors. | |
| multiplyVector2 (vec1, vec2) | |
| Multiply two vectors 2. | |
| multiplyVectorF (vec1, vec2) | |
| Multiply two float vectors. | |
| multiplyVector2F (vec1, vec2) | |
| Multiply two float vectors 2. | |
| projectVector (vec1, vec2) | |
| Project an int vector onto another int vector. | |
| projectVectorF (vec1, vec2) | |
| Project a float vector onto another float vector. | |
| projectVectorOnPlane (vec, planenormal) | |
| Project an int vector onto a plane defined by its int normal vector. | |
| projectVectorOnPlaneF (vec, planenormal) | |
| Project a float vector onto a plane defined by its float normal vector. | |
| vectorPlaneIntersectionF (vec, vecpoint, planenormal, planepoint) | |
| Intersection point between a plane and a vector. | |
| getPlaneNormalF (point1, point2, point3) | |
| Get a plane normal from 3 points belonging to the plane. | |
| getVectorXF (vec) | |
| Get vector X value. | |
| getVectorYF (vec) | |
| Get vector Y value. | |
| getVectorZF (vec) | |
| Get vector Z value. | |
| getShortestAngle (p, q) | |
| Get the shortest angle. | |
| quatInverse (quat) | |
| Get quaternion inverse. | |
| lookAtPYR (src, target, flipz) | |
| LookAt function that return pitch yaw roll in radian. | |
Vector tools
| isCoordInRect | ( | x | , |
| y | , | ||
| rect | |||
| ) |
Test if the coordinates are in the rectangle.
Prototype: fun [I I [I I I I]] I
| I | : x coord |
| I | : y coord |
| [I | I I I] : rectangle x y width height |
| minf | ( | a | , |
| b | |||
| ) |
Get the smallest float value.
Prototype: fun [F F] F
| F | : first value |
| F | : second value |
| ftori | ( | val | ) |
Convert a float value to a rounded int value (float to rounded integer)
Prototype: fun [F] I
| F | : float value |
| zeroVector | ( | vec | ) |
Test if a vector is set to 0.
Prototype: fun [[I I I]] I
| [I | I I] : int vector |
| zeroVectorF | ( | vec | ) |
Test if a float vector is set to 0.
Prototype: fun [[F F F]] I
| [F | F F] : float vector |
| vectorIsZero | ( | vec | ) |
Test if a vector is set to 0.
Prototype: fun [[I I I]] I
| [I | I I] : int vector |
| vector2dIsZero | ( | vec | ) |
Test if a 2d vector is set to 0.
Prototype: fun [[I I]] I
| [I | I] : int vector |
| vectorIsZeroF | ( | vec | ) |
Test if a float vector is set to 0.
Prototype: fun [[F F F]] I
| [F | F F] : float vector |
| vector2dIsZeroF | ( | vec | ) |
Test if a 2d float vector is set to 0.
Prototype: fun [[F F]] I
| [F | F] : float vector |
| vectorEqual | ( | vec1 | , |
| vec2 | |||
| ) |
Test if two vectors are equal.
Prototype: fun [[I I I] [I I I]] I
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| vectorEqualF | ( | vec1 | , |
| vec2 | |||
| ) |
Test if two float vectors are equal.
Prototype: fun [[F F F] [F F F]] I
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| normalizeVectorF | ( | vec | ) |
Normalize a float vector.
Prototype: fun [[F F F]] [F F F]
| [F | F F] : float vector |
| vectorAverageF | ( | vec | ) |
Get the average of a vector.
Prototype: fun [[F F F]] F
| [F | F F] : float vector |
| vectorCubeF | ( | vec | ) |
Get the cube of a vector.
Prototype: fun [[F F F]] F
| [F | F F] : float vector |
| getVectorLength | ( | vec1 | ) |
Get a vector length.
Prototype: fun [[I I I]] F
| [I | I I] : int vector |
| getVectorLengthF | ( | vec1 | ) |
Get a vector length.
Prototype: fun [[F F F]] F
| [F | F F] : float vector |
| getVector4LengthF | ( | vec1 | ) |
Get a vector 4 length.
Prototype: fun [[F F F F]] F
| [F | F F F] : float vector |
| getVectorDistance | ( | vec1 | , |
| vec2 | |||
| ) |
Get the distance between 2 vectors.
Prototype: fun [[I I I] [I I I]] F
| [I | I I] : int vector |
| [I | I I] : int vector |
| getVector2dDistance | ( | vec1 | , |
| vec2 | |||
| ) |
Get the distance between 2 2D vectors.
Prototype: fun [[I I] [I I]] F
| [I | I] : int vector |
| [I | I] : int vector |
| getVectorDistanceF | ( | vec1 | , |
| vec2 | |||
| ) |
Get the distance between 2 vectors.
Prototype: fun [[F F F] [F F F]] F
| [F | F F] : float vector |
| [F | F F] : float vector |
| crossVector | ( | vec1 | , |
| vec2 | |||
| ) |
Cross product of two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| crossVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Cross product of two vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| dotVector | ( | vec1 | , |
| vec2 | |||
| ) |
Dot product of two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| dotVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Dot product of two vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| getVectorAngle | ( | vec1 | , |
| vec2 | |||
| ) |
Get the angle between 2 vectors in radian.
Prototype: fun [[I I I] [I I I]] F
| [I | I I] : int vector |
| [I | I I] : int vector |
| getVector2dAngle | ( | vec1 | , |
| vec2 | |||
| ) |
Get the angle between 2 2D vectors in degree.
Prototype: fun [[I I] [I I]] F
| [I | I] : int vector |
| [I | I] : int vector |
| getVectorAngleF | ( | vec1 | , |
| vec2 | |||
| ) |
Get the angle between 2 vectors in radian.
Prototype: fun [[F F F] [F F F]] F
| [F | F F] : float vector |
| [F | F F] : float vector |
| getVectorOrientedAngleF | ( | vec1 | , |
| vec2 | , | ||
| planenormal | |||
| ) |
Get the oriented angle between 2 vectors in radian, between pi and -pi.
Prototype: fun [[F F F] [F F F] [F F F]] F
| [F | F F] : float vector |
| [F | F F] : float vector |
| [F | F F] : normal of the plane containing both vector. Used for the angle orientation |
| minVector | ( | vec1 | , |
| vec2 | |||
| ) |
Min of two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| minVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Min of two vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first int vector |
| [F | F F] : second int vector |
| minVector2F | ( | vec1 | , |
| vec2 | |||
| ) |
Min of two vectors 2.
Prototype: fun [[F F] [F F]] [F F]
| [F | F] : first int vector |
| [F | F] : second int vector |
| maxVector | ( | vec1 | , |
| vec2 | |||
| ) |
Max of two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| maxVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Max of two vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first int vector |
| [F | F F] : second int vector |
| maxVector2F | ( | vec1 | , |
| vec2 | |||
| ) |
Max of two vectors.
Prototype: fun [[F F] [F F]] [F F]
| [F | F] : first int vector |
| [F | F] : second int vector |
| subVector | ( | vec1 | , |
| vec2 | |||
| ) |
Substract two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| subVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Substract two float vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| subVector2 | ( | vec1 | , |
| vec2 | |||
| ) |
Substract two vectors 2.
Prototype: fun [[I I] [I I]] [I I]
| [I | I] : first int vector |
| [I | I] : second int vector |
| subVector2F | ( | vec1 | , |
| vec2 | |||
| ) |
Substract two float vectors 2.
Prototype: fun [[F F] [F F]] [F F]
| [F | F] : first float vector |
| [F | F] : second float vector |
| addVector | ( | vec1 | , |
| vec2 | |||
| ) |
Add two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| addVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Add two float vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| addVector2 | ( | vec1 | , |
| vec2 | |||
| ) |
Add two vectors.
Prototype: fun [[I I] [I I]] [I I]
| [I | I] : first int vector |
| [I | I] : second int vector |
| addVector2F | ( | vec1 | , |
| vec2 | |||
| ) |
Add two float vectors 2.
Prototype: fun [[F F] [F F]] [F F]
| [F | F] : first float vector |
| [F | F] : second float vector |
| divideVector | ( | vec1 | , |
| vec2 | |||
| ) |
Divide two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| divideVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Divide two float vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| divideVector2 | ( | vec1 | , |
| vec2 | |||
| ) |
Divide two vectors 2.
Prototype: fun [[I I] [I I]] [I I]
| [I | I] : first int vector |
| [I | I] : second int vector |
| divideVector2F | ( | vec1 | , |
| vec2 | |||
| ) |
Divide two float vectors 2.
Prototype: fun [[F F] [F F]] [F F]
| [F | F] : first float vector |
| [F | F] : second float vector |
| multiplyVector | ( | vec1 | , |
| vec2 | |||
| ) |
Multiply two vectors.
Prototype: fun [[I I I] [I I I]] [I I I]
| [I | I I] : first int vector |
| [I | I I] : second int vector |
| multiplyVector2 | ( | vec1 | , |
| vec2 | |||
| ) |
Multiply two vectors 2.
Prototype: fun [[I I] [I I]] [I I]
| [I | I] : first int vector |
| [I | I] : second int vector |
| multiplyVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Multiply two float vectors.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : first float vector |
| [F | F F] : second float vector |
| multiplyVector2F | ( | vec1 | , |
| vec2 | |||
| ) |
Multiply two float vectors 2.
Prototype: fun [[F F] [F F]] [F F]
| [F | F] : first float vector |
| [F | F] : second float vector |
| projectVector | ( | vec1 | , |
| vec2 | |||
| ) |
Project an int vector onto another int vector.
Prototype: fun [[I I I] [I I I]] [F F F]
| [I | I I] : int vector to project |
| [I | I I] : int vector on which the vector is projected |
| projectVectorF | ( | vec1 | , |
| vec2 | |||
| ) |
Project a float vector onto another float vector.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : float vector to project |
| [F | F F] : float vector on which the vector is projected |
| projectVectorOnPlane | ( | vec | , |
| planenormal | |||
| ) |
Project an int vector onto a plane defined by its int normal vector.
Prototype: fun [[I I I] [I I I]] [F F F]
| [I | I I] : int vector to project |
| [I | I I] : normal vector of the plane |
| projectVectorOnPlaneF | ( | vec | , |
| planenormal | |||
| ) |
Project a float vector onto a plane defined by its float normal vector.
Prototype: fun [[F F F] [F F F]] [F F F]
| [F | F F] : float vector to project |
| [F | F F] : normal vector of the plane |
| vectorPlaneIntersectionF | ( | vec | , |
| vecpoint | , | ||
| planenormal | , | ||
| planepoint | |||
| ) |
Intersection point between a plane and a vector.
Prototype: fun [[F F F] [F F F] [F F F] [F F F]] [F F F]
| [F | F F] : float vector |
| [F | F F] : float point lying on the vector |
| [F | F F] : plane normal float vector |
| [F | F F] : float point lying on the plane |
| getPlaneNormalF | ( | point1 | , |
| point2 | , | ||
| point3 | |||
| ) |
Get a plane normal from 3 points belonging to the plane.
Prototype: fun [[F F F][F F F][F F F]] [F F F]
| [F | F F] : first point coordinates |
| [F | F F] : second point coordinates |
| [F | F F] : third point coordinates |
| getVectorXF | ( | vec | ) |
Get vector X value.
Prototype: fun [[F F F]] F
| [F | F F] : float vector |
| getVectorYF | ( | vec | ) |
Get vector Y value.
Prototype: fun [[F F F]] F
| [F | F F] : float vector |
| getVectorZF | ( | vec | ) |
Get vector Z value.
Prototype: fun [[F F F]] F
| [F | F F] : float vector |
| getShortestAngle | ( | p | , |
| q | |||
| ) |
Get the shortest angle.
Prototype: fun [F] F
| F | : angle in degree |
| quatInverse | ( | quat | ) |
Get quaternion inverse.
Prototype: fun [[F F F F]] [F F F F]
| [F | F F F] : quaternion |
| lookAtPYR | ( | src | , |
| target | , | ||
| flipz | |||
| ) |
LookAt function that return pitch yaw roll in radian.
Prototype: fun [[F F F] [F F F] [F F F]] [F F F]
| [F | F F] : source vector |
| [F | F F] : target vector |