Struct Ray
Parametric line that is specified by center and direction.
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: ProjectDawn.Geometry3D
Assembly: ProjectDawn.Geometry.dll
Syntax
[Serializable]
public struct Ray
Constructors
| Improve this Doc View SourceRay(float3, float3)
Declaration
public Ray(float3 origin, float3 direction)
Parameters
| Type | Name | Description |
|---|---|---|
| Unity.Mathematics.float3 | origin | |
| Unity.Mathematics.float3 | direction |
Fields
| Improve this Doc View SourceDirection
Line direction vector.
Declaration
public float3 Direction
Field Value
| Type | Description |
|---|---|
| Unity.Mathematics.float3 |
Origin
Line center point.
Declaration
public float3 Origin
Field Value
| Type | Description |
|---|---|
| Unity.Mathematics.float3 |
Methods
| Improve this Doc View SourceGetPoint(Single)
Returns point along the ray at given time.
Declaration
public float3 GetPoint(float t)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | t |
Returns
| Type | Description |
|---|---|
| Unity.Mathematics.float3 |
Intersection(Triangle, out Single)
Returns true if ray intersects triangle. Based on https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm.
Declaration
public bool Intersection(Triangle triangle, out float t)
Parameters
| Type | Name | Description |
|---|---|---|
| Triangle | triangle | Triangle. |
| System.Single | t | Intersection time. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if ray intersects triangle. |
Intersection<T>(TriangularSurface<T>, out SurfacePointIntersection)
Returns true if ray intersects surface.
Declaration
public bool Intersection<T>(TriangularSurface<T> surface, out SurfacePointIntersection intersection)
where T : struct, ITransformFloat3
Parameters
| Type | Name | Description |
|---|---|---|
| TriangularSurface<T> | surface | Surface. |
| SurfacePointIntersection | intersection | Intersection data. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if ray intersects surface. |
Type Parameters
| Name | Description |
|---|---|
| T |