C# Class Math3d

Inheritance: MonoBehaviour
Mostrar archivo Open project: LelandLL/slicer Class Usage Examples

Public Methods

Method Description
AddRotation ( Quaternion A, Quaternion B ) : Quaternion
AddVectorLength ( Vector3 vector, float size ) : Vector3
AngleVectorPlane ( Vector3 vector, Vector3 normal ) : float
AngularAcceleration ( Vector3 &vector, Quaternion rotation, int samples ) : bool
AreLineSegmentsCrossing ( Vector3 pointA1, Vector3 pointA2, Vector3 pointB1, Vector3 pointB2 ) : bool
ClosestPointsOnTwoLines ( Vector3 &closestPointLine1, Vector3 &closestPointLine2, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2 ) : bool
DotProductAngle ( Vector3 vec1, Vector3 vec2 ) : float
GetForwardVector ( Quaternion q ) : Vector3
GetRightVector ( Quaternion q ) : Vector3
GetUpVector ( Quaternion q ) : Vector3
Init ( ) : void
InverseTransformDirectionMath ( Quaternion rotation, Vector3 vector ) : Vector3
IsLineInRectangle ( Vector3 linePoint1, Vector3 linePoint2, Vector3 rectA, Vector3 rectB, Vector3 rectC, Vector3 rectD ) : bool
IsPointInRectangle ( Vector3 point, Vector3 rectA, Vector3 rectC, Vector3 rectB, Vector3 rectD ) : bool
LineLineIntersection ( Vector3 &intersection, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2 ) : bool
LinePlaneIntersection ( Vector3 &intersection, Vector3 linePoint, Vector3 lineVec, Vector3 planeNormal, Vector3 planePoint ) : bool
LinearAcceleration ( Vector3 &vector, Vector3 position, int samples ) : bool
LinearFunction2DBasic ( float x, float Qx, float Qy ) : float
LinearFunction2DFull ( float x, float Px, float Py, float Qx, float Qy ) : float
LookRotationExtended ( GameObject &gameObjectInOut, Vector3 alignWithVector, Vector3 alignWithNormal, Vector3 customForward, Vector3 customUp ) : void
MouseDistanceToCircle ( Vector3 point, float radius ) : float
MouseDistanceToLine ( Vector3 linePoint1, Vector3 linePoint2 ) : float
PlaneFrom3Points ( Vector3 &planeNormal, Vector3 &planePoint, Vector3 pointA, Vector3 pointB, Vector3 pointC ) : void
PlanePlaneIntersection ( Vector3 &linePoint, Vector3 &lineVec, Vector3 plane1Normal, Vector3 plane1Position, Vector3 plane2Normal, Vector3 plane2Position ) : bool
PointOnWhichSideOfLineSegment ( Vector3 linePoint1, Vector3 linePoint2, Vector3 point ) : int
PositionFromMatrix ( Matrix4x4 m ) : Vector3
PreciseAlign ( GameObject &gameObjectInOut, Vector3 alignWithVector, Vector3 alignWithNormal, Vector3 alignWithPosition, Vector3 triangleForward, Vector3 triangleNormal, Vector3 trianglePosition ) : void
ProjectPointOnLine ( Vector3 linePoint, Vector3 lineVec, Vector3 point ) : Vector3
ProjectPointOnLineSegment ( Vector3 linePoint1, Vector3 linePoint2, Vector3 point ) : Vector3
ProjectPointOnPlane ( Vector3 planeNormal, Vector3 planePoint, Vector3 point ) : Vector3
ProjectVectorOnPlane ( Vector3 planeNormal, Vector3 vector ) : Vector3
QuaternionFromMatrix ( Matrix4x4 m ) : Quaternion
RotateVectorFromTo ( Quaternion from, Quaternion to, Vector3 vector ) : Vector3
SetVectorLength ( Vector3 vector, float size ) : Vector3
SignedDistancePlanePoint ( Vector3 planeNormal, Vector3 planePoint, Vector3 point ) : float
SignedDotProduct ( Vector3 vectorA, Vector3 vectorB, Vector3 normal ) : float
SignedVectorAngle ( Vector3 referenceVector, Vector3 otherVector, Vector3 normal ) : float
SubtractRotation ( Quaternion B, Quaternion A ) : Quaternion
TransformDirectionMath ( Quaternion rotation, Vector3 vector ) : Vector3
TransformWithParent ( Quaternion &childRotation, Vector3 &childPosition, Quaternion parentRotation, Vector3 parentPosition, Quaternion startParentRotation, Vector3 startParentPosition, Quaternion startChildRotation, Vector3 startChildPosition ) : void
VectorsToTransform ( GameObject &gameObjectInOut, Vector3 positionVector, Vector3 directionVector, Vector3 normalVector ) : void

Private Methods

Method Description
RotDiffToSpeedVec ( Quaternion rotation, float deltaTime ) : Vector3

Method Details

AddRotation() public static method

public static AddRotation ( Quaternion A, Quaternion B ) : Quaternion
A Quaternion
B Quaternion
return Quaternion

AddVectorLength() public static method

public static AddVectorLength ( Vector3 vector, float size ) : Vector3
vector Vector3
size float
return Vector3

AngleVectorPlane() public static method

public static AngleVectorPlane ( Vector3 vector, Vector3 normal ) : float
vector Vector3
normal Vector3
return float

AngularAcceleration() public static method

public static AngularAcceleration ( Vector3 &vector, Quaternion rotation, int samples ) : bool
vector Vector3
rotation Quaternion
samples int
return bool

AreLineSegmentsCrossing() public static method

public static AreLineSegmentsCrossing ( Vector3 pointA1, Vector3 pointA2, Vector3 pointB1, Vector3 pointB2 ) : bool
pointA1 Vector3
pointA2 Vector3
pointB1 Vector3
pointB2 Vector3
return bool

ClosestPointsOnTwoLines() public static method

public static ClosestPointsOnTwoLines ( Vector3 &closestPointLine1, Vector3 &closestPointLine2, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2 ) : bool
closestPointLine1 Vector3
closestPointLine2 Vector3
linePoint1 Vector3
lineVec1 Vector3
linePoint2 Vector3
lineVec2 Vector3
return bool

DotProductAngle() public static method

public static DotProductAngle ( Vector3 vec1, Vector3 vec2 ) : float
vec1 Vector3
vec2 Vector3
return float

GetForwardVector() public static method

public static GetForwardVector ( Quaternion q ) : Vector3
q Quaternion
return Vector3

GetRightVector() public static method

public static GetRightVector ( Quaternion q ) : Vector3
q Quaternion
return Vector3

GetUpVector() public static method

public static GetUpVector ( Quaternion q ) : Vector3
q Quaternion
return Vector3

Init() public static method

public static Init ( ) : void
return void

InverseTransformDirectionMath() public static method

public static InverseTransformDirectionMath ( Quaternion rotation, Vector3 vector ) : Vector3
rotation Quaternion
vector Vector3
return Vector3

IsLineInRectangle() public static method

public static IsLineInRectangle ( Vector3 linePoint1, Vector3 linePoint2, Vector3 rectA, Vector3 rectB, Vector3 rectC, Vector3 rectD ) : bool
linePoint1 Vector3
linePoint2 Vector3
rectA Vector3
rectB Vector3
rectC Vector3
rectD Vector3
return bool

IsPointInRectangle() public static method

public static IsPointInRectangle ( Vector3 point, Vector3 rectA, Vector3 rectC, Vector3 rectB, Vector3 rectD ) : bool
point Vector3
rectA Vector3
rectC Vector3
rectB Vector3
rectD Vector3
return bool

LineLineIntersection() public static method

public static LineLineIntersection ( Vector3 &intersection, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2 ) : bool
intersection Vector3
linePoint1 Vector3
lineVec1 Vector3
linePoint2 Vector3
lineVec2 Vector3
return bool

LinePlaneIntersection() public static method

public static LinePlaneIntersection ( Vector3 &intersection, Vector3 linePoint, Vector3 lineVec, Vector3 planeNormal, Vector3 planePoint ) : bool
intersection Vector3
linePoint Vector3
lineVec Vector3
planeNormal Vector3
planePoint Vector3
return bool

LinearAcceleration() public static method

public static LinearAcceleration ( Vector3 &vector, Vector3 position, int samples ) : bool
vector Vector3
position Vector3
samples int
return bool

LinearFunction2DBasic() public static method

public static LinearFunction2DBasic ( float x, float Qx, float Qy ) : float
x float
Qx float
Qy float
return float

LinearFunction2DFull() public static method

public static LinearFunction2DFull ( float x, float Px, float Py, float Qx, float Qy ) : float
x float
Px float
Py float
Qx float
Qy float
return float

LookRotationExtended() public static method

public static LookRotationExtended ( GameObject &gameObjectInOut, Vector3 alignWithVector, Vector3 alignWithNormal, Vector3 customForward, Vector3 customUp ) : void
gameObjectInOut GameObject
alignWithVector Vector3
alignWithNormal Vector3
customForward Vector3
customUp Vector3
return void

MouseDistanceToCircle() public static method

public static MouseDistanceToCircle ( Vector3 point, float radius ) : float
point Vector3
radius float
return float

MouseDistanceToLine() public static method

public static MouseDistanceToLine ( Vector3 linePoint1, Vector3 linePoint2 ) : float
linePoint1 Vector3
linePoint2 Vector3
return float

PlaneFrom3Points() public static method

public static PlaneFrom3Points ( Vector3 &planeNormal, Vector3 &planePoint, Vector3 pointA, Vector3 pointB, Vector3 pointC ) : void
planeNormal Vector3
planePoint Vector3
pointA Vector3
pointB Vector3
pointC Vector3
return void

PlanePlaneIntersection() public static method

public static PlanePlaneIntersection ( Vector3 &linePoint, Vector3 &lineVec, Vector3 plane1Normal, Vector3 plane1Position, Vector3 plane2Normal, Vector3 plane2Position ) : bool
linePoint Vector3
lineVec Vector3
plane1Normal Vector3
plane1Position Vector3
plane2Normal Vector3
plane2Position Vector3
return bool

PointOnWhichSideOfLineSegment() public static method

public static PointOnWhichSideOfLineSegment ( Vector3 linePoint1, Vector3 linePoint2, Vector3 point ) : int
linePoint1 Vector3
linePoint2 Vector3
point Vector3
return int

PositionFromMatrix() public static method

public static PositionFromMatrix ( Matrix4x4 m ) : Vector3
m Matrix4x4
return Vector3

PreciseAlign() public static method

public static PreciseAlign ( GameObject &gameObjectInOut, Vector3 alignWithVector, Vector3 alignWithNormal, Vector3 alignWithPosition, Vector3 triangleForward, Vector3 triangleNormal, Vector3 trianglePosition ) : void
gameObjectInOut GameObject
alignWithVector Vector3
alignWithNormal Vector3
alignWithPosition Vector3
triangleForward Vector3
triangleNormal Vector3
trianglePosition Vector3
return void

ProjectPointOnLine() public static method

public static ProjectPointOnLine ( Vector3 linePoint, Vector3 lineVec, Vector3 point ) : Vector3
linePoint Vector3
lineVec Vector3
point Vector3
return Vector3

ProjectPointOnLineSegment() public static method

public static ProjectPointOnLineSegment ( Vector3 linePoint1, Vector3 linePoint2, Vector3 point ) : Vector3
linePoint1 Vector3
linePoint2 Vector3
point Vector3
return Vector3

ProjectPointOnPlane() public static method

public static ProjectPointOnPlane ( Vector3 planeNormal, Vector3 planePoint, Vector3 point ) : Vector3
planeNormal Vector3
planePoint Vector3
point Vector3
return Vector3

ProjectVectorOnPlane() public static method

public static ProjectVectorOnPlane ( Vector3 planeNormal, Vector3 vector ) : Vector3
planeNormal Vector3
vector Vector3
return Vector3

QuaternionFromMatrix() public static method

public static QuaternionFromMatrix ( Matrix4x4 m ) : Quaternion
m Matrix4x4
return Quaternion

RotateVectorFromTo() public static method

public static RotateVectorFromTo ( Quaternion from, Quaternion to, Vector3 vector ) : Vector3
from Quaternion
to Quaternion
vector Vector3
return Vector3

SetVectorLength() public static method

public static SetVectorLength ( Vector3 vector, float size ) : Vector3
vector Vector3
size float
return Vector3

SignedDistancePlanePoint() public static method

public static SignedDistancePlanePoint ( Vector3 planeNormal, Vector3 planePoint, Vector3 point ) : float
planeNormal Vector3
planePoint Vector3
point Vector3
return float

SignedDotProduct() public static method

public static SignedDotProduct ( Vector3 vectorA, Vector3 vectorB, Vector3 normal ) : float
vectorA Vector3
vectorB Vector3
normal Vector3
return float

SignedVectorAngle() public static method

public static SignedVectorAngle ( Vector3 referenceVector, Vector3 otherVector, Vector3 normal ) : float
referenceVector Vector3
otherVector Vector3
normal Vector3
return float

SubtractRotation() public static method

public static SubtractRotation ( Quaternion B, Quaternion A ) : Quaternion
B Quaternion
A Quaternion
return Quaternion

TransformDirectionMath() public static method

public static TransformDirectionMath ( Quaternion rotation, Vector3 vector ) : Vector3
rotation Quaternion
vector Vector3
return Vector3

TransformWithParent() public static method

public static TransformWithParent ( Quaternion &childRotation, Vector3 &childPosition, Quaternion parentRotation, Vector3 parentPosition, Quaternion startParentRotation, Vector3 startParentPosition, Quaternion startChildRotation, Vector3 startChildPosition ) : void
childRotation Quaternion
childPosition Vector3
parentRotation Quaternion
parentPosition Vector3
startParentRotation Quaternion
startParentPosition Vector3
startChildRotation Quaternion
startChildPosition Vector3
return void

VectorsToTransform() public static method

public static VectorsToTransform ( GameObject &gameObjectInOut, Vector3 positionVector, Vector3 directionVector, Vector3 normalVector ) : void
gameObjectInOut GameObject
positionVector Vector3
directionVector Vector3
normalVector Vector3
return void