C# 클래스 HoloToolkit.Sharing.Utilities.MathUtils

파일 보기 프로젝트 열기: OpenHID/InteractivePaint

공개 메소드들

메소드 설명
Add ( Matrix4x4 a, Matrix4x4 b ) : Matrix4x4

Element-wise addition of two Matrix4x4s - extension method

ClosestPointOnLineSegmentToPoint ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : Vector3
ClosestPointOnLineToPoint ( Vector3 point, Vector3 linePointA, Vector3 linePointB ) : Vector3
DistanceOfPointToLine ( Ray ray, Vector3 point ) : float

find unsigned distance of 3D point to an infinite line

DistanceOfPointToLine ( Vector3 point, Vector3 linePointA, Vector3 linePointB ) : float

Returns the distance between a point and an infinite line defined by two points; linePointA and linePointB

DistanceOfPointToLineSegment ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : float
GetHorizontalFieldOfViewRadians ( ) : float

Get the horizontal FOV from the stereo camera

InRange ( Vector2 vec, Vector2 lower, Vector2 upper ) : bool

Tests component-wise if a Vector2 is in a given range

InRange ( Vector3 vec, Vector3 lower, Vector3 upper ) : bool

Tests component-wise if a Vector3 is in a given range

IsInFOV ( Vector3 position ) : bool

Returns if a point will be rendered on the screen in either eye

NearestPointToLines ( Ray p, Ray q ) : Vector3

Find 3D point that minimizes distance to 2 lines, midpoint of the shortest perpendicular line segment between them

NearestPointToLinesLeastSquares ( IEnumerable rays ) : Vector3

Find 3D point that minimizes distance to a set of 2 or more lines

NearestPointToLinesRANSAC ( List rays, int ransac_iterations, float ransac_threshold, int &numActualInliers ) : Vector3

Find 3D point that minimizes distance to a set of 2 or more lines, ignoring outliers

QuaternionFromMatrix ( Matrix4x4 m ) : Quaternion

Creates a quaternion containing the rotation from the input matrix.

Subtract ( Matrix4x4 a, Matrix4x4 b ) : Matrix4x4

Element-wise subtraction of two Matrix4x4s - extension method

TestPlanesAABB ( Plane planes, int planeMask, Bounds bounds, bool &entirelyInside ) : bool
ToTranslationRotation ( Matrix4x4 unityMtx, Vector3 &translation, Quaternion &rotation ) : void

Extract the translation and rotation components of a Unity matrix

TransformDirectionFromTo ( Transform from, Transform to, Vector3 dirInFrom ) : Vector3

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

TransformPointFromTo ( Transform from, Transform to, Vector3 ptInFrom ) : Vector3

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

TransformRayFromTo ( Transform from, Transform to, Ray rayToConvert ) : Ray

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

TransformVectorFromTo ( Transform from, Transform to, Vector3 vecInFrom ) : Vector3

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

XYProject ( Vector3 v ) : Vector3

Project vector onto XY plane

XZProject ( Vector3 v ) : Vector3

Project vector onto XZ plane

YZProject ( Vector3 v ) : Vector3

Project vector onto YZ plane

메소드 상세

Add() 공개 정적인 메소드

Element-wise addition of two Matrix4x4s - extension method
public static Add ( Matrix4x4 a, Matrix4x4 b ) : Matrix4x4
a UnityEngine.Matrix4x4 matrix
b UnityEngine.Matrix4x4 matrix
리턴 UnityEngine.Matrix4x4

ClosestPointOnLineSegmentToPoint() 공개 정적인 메소드

public static ClosestPointOnLineSegmentToPoint ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : Vector3
point UnityEngine.Vector3
lineStart UnityEngine.Vector3
lineEnd UnityEngine.Vector3
리턴 UnityEngine.Vector3

ClosestPointOnLineToPoint() 공개 정적인 메소드

public static ClosestPointOnLineToPoint ( Vector3 point, Vector3 linePointA, Vector3 linePointB ) : Vector3
point UnityEngine.Vector3
linePointA UnityEngine.Vector3
linePointB UnityEngine.Vector3
리턴 UnityEngine.Vector3

DistanceOfPointToLine() 공개 정적인 메소드

find unsigned distance of 3D point to an infinite line
public static DistanceOfPointToLine ( Ray ray, Vector3 point ) : float
ray UnityEngine.Ray ray that specifies an infinite line
point UnityEngine.Vector3 3D point
리턴 float

DistanceOfPointToLine() 공개 정적인 메소드

Returns the distance between a point and an infinite line defined by two points; linePointA and linePointB
public static DistanceOfPointToLine ( Vector3 point, Vector3 linePointA, Vector3 linePointB ) : float
point UnityEngine.Vector3
linePointA UnityEngine.Vector3
linePointB UnityEngine.Vector3
리턴 float

DistanceOfPointToLineSegment() 공개 정적인 메소드

public static DistanceOfPointToLineSegment ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : float
point UnityEngine.Vector3
lineStart UnityEngine.Vector3
lineEnd UnityEngine.Vector3
리턴 float

GetHorizontalFieldOfViewRadians() 공개 정적인 메소드

Get the horizontal FOV from the stereo camera
public static GetHorizontalFieldOfViewRadians ( ) : float
리턴 float

InRange() 공개 정적인 메소드

Tests component-wise if a Vector2 is in a given range
public static InRange ( Vector2 vec, Vector2 lower, Vector2 upper ) : bool
vec UnityEngine.Vector2 The vector to test
lower UnityEngine.Vector2 The lower bounds
upper UnityEngine.Vector2 The upper bounds
리턴 bool

InRange() 공개 정적인 메소드

Tests component-wise if a Vector3 is in a given range
public static InRange ( Vector3 vec, Vector3 lower, Vector3 upper ) : bool
vec UnityEngine.Vector3 The vector to test
lower UnityEngine.Vector3 The lower bounds
upper UnityEngine.Vector3 The upper bounds
리턴 bool

IsInFOV() 공개 정적인 메소드

Returns if a point will be rendered on the screen in either eye
public static IsInFOV ( Vector3 position ) : bool
position UnityEngine.Vector3
리턴 bool

NearestPointToLines() 공개 정적인 메소드

Find 3D point that minimizes distance to 2 lines, midpoint of the shortest perpendicular line segment between them
public static NearestPointToLines ( Ray p, Ray q ) : Vector3
p UnityEngine.Ray ray that specifies a line
q UnityEngine.Ray ray that specifies a line
리턴 UnityEngine.Vector3

NearestPointToLinesLeastSquares() 공개 정적인 메소드

Find 3D point that minimizes distance to a set of 2 or more lines
public static NearestPointToLinesLeastSquares ( IEnumerable rays ) : Vector3
rays IEnumerable each ray specifies an infinite line
리턴 UnityEngine.Vector3

NearestPointToLinesRANSAC() 공개 정적인 메소드

Find 3D point that minimizes distance to a set of 2 or more lines, ignoring outliers
public static NearestPointToLinesRANSAC ( List rays, int ransac_iterations, float ransac_threshold, int &numActualInliers ) : Vector3
rays List list of rays, each specifying a line, must have at least 1
ransac_iterations int 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 float minimum distance from point to line for a line to be considered an inlier
numActualInliers int return number of inliers: lines that are within ransac_threshold of nearest point
리턴 UnityEngine.Vector3

QuaternionFromMatrix() 공개 정적인 메소드

Creates a quaternion containing the rotation from the input matrix.
public static QuaternionFromMatrix ( Matrix4x4 m ) : Quaternion
m UnityEngine.Matrix4x4 Input matrix to convert to quaternion
리턴 UnityEngine.Quaternion

Subtract() 공개 정적인 메소드

Element-wise subtraction of two Matrix4x4s - extension method
public static Subtract ( Matrix4x4 a, Matrix4x4 b ) : Matrix4x4
a UnityEngine.Matrix4x4 matrix
b UnityEngine.Matrix4x4 matrix
리턴 UnityEngine.Matrix4x4

TestPlanesAABB() 공개 정적인 메소드

public static TestPlanesAABB ( Plane planes, int planeMask, Bounds bounds, bool &entirelyInside ) : bool
planes UnityEngine.Plane
planeMask int
bounds UnityEngine.Bounds
entirelyInside bool
리턴 bool

ToTranslationRotation() 공개 정적인 메소드

Extract the translation and rotation components of a Unity matrix
public static ToTranslationRotation ( Matrix4x4 unityMtx, Vector3 &translation, Quaternion &rotation ) : void
unityMtx UnityEngine.Matrix4x4
translation UnityEngine.Vector3
rotation UnityEngine.Quaternion
리턴 void

TransformDirectionFromTo() 공개 정적인 메소드

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
public static TransformDirectionFromTo ( Transform from, Transform to, Vector3 dirInFrom ) : Vector3
from UnityEngine.Transform
to UnityEngine.Transform
dirInFrom UnityEngine.Vector3
리턴 UnityEngine.Vector3

TransformPointFromTo() 공개 정적인 메소드

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
public static TransformPointFromTo ( Transform from, Transform to, Vector3 ptInFrom ) : Vector3
from UnityEngine.Transform
to UnityEngine.Transform
ptInFrom UnityEngine.Vector3
리턴 UnityEngine.Vector3

TransformRayFromTo() 공개 정적인 메소드

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
public static TransformRayFromTo ( Transform from, Transform to, Ray rayToConvert ) : Ray
from UnityEngine.Transform
to UnityEngine.Transform
rayToConvert UnityEngine.Ray
리턴 UnityEngine.Ray

TransformVectorFromTo() 공개 정적인 메소드

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
public static TransformVectorFromTo ( Transform from, Transform to, Vector3 vecInFrom ) : Vector3
from UnityEngine.Transform
to UnityEngine.Transform
vecInFrom UnityEngine.Vector3
리턴 UnityEngine.Vector3

XYProject() 공개 정적인 메소드

Project vector onto XY plane
public static XYProject ( Vector3 v ) : Vector3
v UnityEngine.Vector3
리턴 UnityEngine.Vector3

XZProject() 공개 정적인 메소드

Project vector onto XZ plane
public static XZProject ( Vector3 v ) : Vector3
v UnityEngine.Vector3
리턴 UnityEngine.Vector3

YZProject() 공개 정적인 메소드

Project vector onto YZ plane
public static YZProject ( Vector3 v ) : Vector3
v UnityEngine.Vector3
리턴 UnityEngine.Vector3