Struct RaySegment
- Namespace
- Stride.CommunityToolkit.Scripts
- Assembly
- Stride.CommunityToolkit.dll
Represents a three dimensional line based on a 2 points in space.
[DataContract]
public struct RaySegment : IEquatable<RaySegment>, IFormattable
- Implements
Constructors
RaySegment(Vector3, Vector3)
Initializes a new instance of the RaySegment struct.
public RaySegment(Vector3 start, Vector3 end)
Parameters
startVector3The position in three dimensional space where the ray starts.
endVector3The position in three dimensional space where the ray ends.
Properties
End
The position in three dimensional space where the ray ends.
public Vector3 End { readonly get; init; }
Property Value
Length
Length of RaySegment
public float Length { get; }
Property Value
Start
The position in three dimensional space where the ray starts.
public Vector3 Start { readonly get; init; }
Property Value
Methods
Equals(RaySegment)
Determines whether the specified Vector4 is equal to this instance.
public bool Equals(RaySegment value)
Parameters
valueRaySegmentThe Vector4 to compare with this instance.
Returns
Equals(object?)
Determines whether the specified Object is equal to this instance.
public override bool Equals(object? value)
Parameters
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
ToString(IFormatProvider)
Returns a string that represents this instance.
public string ToString(IFormatProvider formatProvider)
Parameters
formatProviderIFormatProviderThe format provider.
Returns
ToString(string)
Returns a string that represents this instance.
public string ToString(string format)
Parameters
formatstringThe format.
Returns
ToString(string?, IFormatProvider?)
Returns a string that represents this instance.
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringThe format.
formatProviderIFormatProviderThe format provider.
Returns
Operators
operator ==(RaySegment, RaySegment)
Tests for equality between two objects.
public static bool operator ==(RaySegment left, RaySegment right)
Parameters
leftRaySegmentThe first value to compare.
rightRaySegmentThe second value to compare.
Returns
- bool
trueiflefthas the same value asright; otherwise,false.
explicit operator Ray(RaySegment)
Performs an explicit conversion from RaySegment to Ray.
public static explicit operator Ray(RaySegment raySegment)
Parameters
raySegmentRaySegmentThe RaySegment to convert
Returns
- Ray
The result of the conversion.
operator !=(RaySegment, RaySegment)
Tests for inequality between two objects.
public static bool operator !=(RaySegment left, RaySegment right)
Parameters
leftRaySegmentThe first value to compare.
rightRaySegmentThe second value to compare.
Returns
- bool
trueiflefthas a different value thanright; otherwise,false.