![]() |
AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
|
Math Utilities class. More...
Static Public Member Functions | |
| static float | GetHorizontalFieldOfViewRadians () |
| Get the horizontal FOV from the stereo camera More... | |
| static bool | IsInFOV (Vector3 position) |
| Returns if a point will be rendered on the screen in either eye More... | |
| static Vector3 | TransformPointFromTo (Transform from, Transform to, Vector3 ptInFrom) |
| Takes a point in the coordinate space specified by the "from" transform and transforms it to be the correct point in the coordinate space specified by the "to" transform applies rotation, scale and translation More... | |
| static Vector3 | TransformDirectionFromTo (Transform from, Transform to, Vector3 dirInFrom) |
| Takes a direction in the coordinate space specified by the "from" transform and transforms it to be the correct direction in the coordinate space specified by the "to" transform applies rotation only, no translation or scale More... | |
| static Vector3 | TransformVectorFromTo (Transform from, Transform to, Vector3 vecInFrom) |
| Takes a vectpr in the coordinate space specified by the "from" transform and transforms it to be the correct direction in the coordinate space specified by the "to" transform applies rotation and scale, no translation More... | |
| static Ray | TransformRayFromTo (Transform from, Transform to, Ray rayToConvert) |
| Takes a ray in the coordinate space specified by the "from" transform and transforms it to be the correct ray in the coordinate space specified by the "to" transform More... | |
| static Quaternion | QuaternionFromMatrix (Matrix4x4 m) |
| Creates a quaternion containing the rotation from the input matrix. More... | |
| static void | ToTranslationRotation (Matrix4x4 unityMtx, out Vector3 translation, out Quaternion rotation) |
| Extract the translation and rotation components of a Unity matrix More... | |
| static Vector3 | XZProject (Vector3 v) |
| Project vector onto XZ plane More... | |
| static Vector3 | YZProject (Vector3 v) |
| Project vector onto YZ plane More... | |
| static Vector3 | XYProject (Vector3 v) |
| Project vector onto XY plane More... | |
| static float | DistanceOfPointToLine (Vector3 point, Vector3 linePointA, Vector3 linePointB) |
| Returns the distance between a point and an infinite line defined by two points; linePointA and linePointB More... | |
| static Vector3 | ClosestPointOnLineToPoint (Vector3 point, Vector3 linePointA, Vector3 linePointB) |
| static float | DistanceOfPointToLineSegment (Vector3 point, Vector3 lineStart, Vector3 lineEnd) |
| static Vector3 | ClosestPointOnLineSegmentToPoint (Vector3 point, Vector3 lineStart, Vector3 lineEnd) |
| static bool | TestPlanesAABB (Plane[] planes, int planeMask, Bounds bounds, out bool entirelyInside) |
| static bool | InRange (Vector2 vec, Vector2 lower, Vector2 upper) |
| Tests component-wise if a Vector2 is in a given range More... | |
| static bool | InRange (Vector3 vec, Vector3 lower, Vector3 upper) |
| Tests component-wise if a Vector3 is in a given range More... | |
| static Matrix4x4 | Add (Matrix4x4 a, Matrix4x4 b) |
| Element-wise addition of two Matrix4x4s - extension method More... | |
| static Matrix4x4 | Subtract (Matrix4x4 a, Matrix4x4 b) |
| Element-wise subtraction of two Matrix4x4s - extension method More... | |
| static float | DistanceOfPointToLine (Ray ray, Vector3 point) |
| find unsigned distance of 3D point to an infinite line More... | |
| static Vector3 | NearestPointToLines (Ray p, Ray q) |
| Find 3D point that minimizes distance to 2 lines, midpoint of the shortest perpendicular line segment between them More... | |
| static Vector3 | NearestPointToLinesRANSAC (List< Ray > rays, int ransac_iterations, float ransac_threshold, out int numActualInliers) |
| Find 3D point that minimizes distance to a set of 2 or more lines, ignoring outliers More... | |
| static Vector3 | NearestPointToLinesLeastSquares (IEnumerable< Ray > rays) |
| Find 3D point that minimizes distance to a set of 2 or more lines More... | |
Math Utilities class.
Definition at line 13 of file MathUtils.cs.
|
static |
Element-wise addition of two Matrix4x4s - extension method
| a | matrix |
| b | matrix |
Definition at line 289 of file MathUtils.cs.
|
static |
Definition at line 190 of file MathUtils.cs.
|
static |
Definition at line 170 of file MathUtils.cs.
|
static |
Returns the distance between a point and an infinite line defined by two points; linePointA and linePointB
| point | |
| linePointA | |
| linePointB |
Definition at line 164 of file MathUtils.cs.
|
static |
find unsigned distance of 3D point to an infinite line
| ray | ray that specifies an infinite line |
| point | 3D point |
Definition at line 321 of file MathUtils.cs.
|
static |
Definition at line 184 of file MathUtils.cs.
|
static |
|
static |
Tests component-wise if a Vector2 is in a given range
| vec | The vector to test |
| lower | The lower bounds |
| upper | The upper bounds |
Definition at line 266 of file MathUtils.cs.
|
static |
Tests component-wise if a Vector3 is in a given range
| vec | The vector to test |
| lower | The lower bounds |
| upper | The upper bounds |
Definition at line 278 of file MathUtils.cs.
|
static |
Returns if a point will be rendered on the screen in either eye
| position |
Definition at line 31 of file MathUtils.cs.
|
static |
Find 3D point that minimizes distance to 2 lines, midpoint of the shortest perpendicular line segment between them
| p | ray that specifies a line |
| q | ray that specifies a line |
Definition at line 332 of file MathUtils.cs.
|
static |
Find 3D point that minimizes distance to a set of 2 or more lines
| rays | each ray specifies an infinite line |
Definition at line 408 of file MathUtils.cs.
|
static |
Find 3D point that minimizes distance to a set of 2 or more lines, ignoring outliers
| rays | list of rays, each specifying a line, must have at least 1 |
| ransac_iterations | number of iterations: log(1-p)/log(1-(1-E)^s) where p is probability of at least one sample containing s points is all inliers E is proportion of outliers (1-ransac_ratio) e.g. p=0.999, ransac_ratio=0.54, s=2 ==> log(0.001)/(log(1-0.54^2) = 20 |
| ransac_threshold | minimum distance from point to line for a line to be considered an inlier |
| numActualInliers | return number of inliers: lines that are within ransac_threshold of nearest point |
Definition at line 365 of file MathUtils.cs.
|
static |
Creates a quaternion containing the rotation from the input matrix.
| m | Input matrix to convert to quaternion |
Definition at line 100 of file MathUtils.cs.
|
static |
Element-wise subtraction of two Matrix4x4s - extension method
| a | matrix |
| b | matrix |
Definition at line 305 of file MathUtils.cs.
|
static |
Definition at line 214 of file MathUtils.cs.
|
static |
Extract the translation and rotation components of a Unity matrix
Definition at line 119 of file MathUtils.cs.
|
static |
Takes a direction in the coordinate space specified by the "from" transform and transforms it to be the correct direction in the coordinate space specified by the "to" transform applies rotation only, no translation or scale
| from | |
| to | |
| dirInFrom |
Definition at line 59 of file MathUtils.cs.
|
static |
Takes a point in the coordinate space specified by the "from" transform and transforms it to be the correct point in the coordinate space specified by the "to" transform applies rotation, scale and translation
| from | |
| to | |
| ptInFrom |
Definition at line 44 of file MathUtils.cs.
|
static |
Takes a ray in the coordinate space specified by the "from" transform and transforms it to be the correct ray in the coordinate space specified by the "to" transform
Definition at line 84 of file MathUtils.cs.
|
static |
Takes a vectpr in the coordinate space specified by the "from" transform and transforms it to be the correct direction in the coordinate space specified by the "to" transform applies rotation and scale, no translation
| from | |
| to | |
| vecInFrom |
Definition at line 74 of file MathUtils.cs.
|
static |
Project vector onto XY plane
| v |
Definition at line 152 of file MathUtils.cs.
|
static |
Project vector onto XZ plane
| v |
Definition at line 132 of file MathUtils.cs.
|
static |
Project vector onto YZ plane
| v |
Definition at line 142 of file MathUtils.cs.