Table of Contents

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

start Vector3

The position in three dimensional space where the ray starts.

end Vector3

The 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

Vector3

Length

Length of RaySegment

public float Length { get; }

Property Value

float

Start

The position in three dimensional space where the ray starts.

public Vector3 Start { readonly get; init; }

Property Value

Vector3

Methods

Equals(RaySegment)

Determines whether the specified Vector4 is equal to this instance.

public bool Equals(RaySegment value)

Parameters

value RaySegment

The Vector4 to compare with this instance.

Returns

bool

true if the specified Vector4 is equal to this instance; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to this instance.

public override bool Equals(object? value)

Parameters

value object

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

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

string

A string that represents this instance.

ToString(IFormatProvider)

Returns a string that represents this instance.

public string ToString(IFormatProvider formatProvider)

Parameters

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string)

Returns a string that represents this instance.

public string ToString(string format)

Parameters

format string

The format.

Returns

string

A string that represents this instance.

ToString(string?, IFormatProvider?)

Returns a string that represents this instance.

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string

The format.

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

Operators

operator ==(RaySegment, RaySegment)

Tests for equality between two objects.

public static bool operator ==(RaySegment left, RaySegment right)

Parameters

left RaySegment

The first value to compare.

right RaySegment

The second value to compare.

Returns

bool

true if left has the same value as right; otherwise, false.

explicit operator Ray(RaySegment)

Performs an explicit conversion from RaySegment to Ray.

public static explicit operator Ray(RaySegment raySegment)

Parameters

raySegment RaySegment

The 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

left RaySegment

The first value to compare.

right RaySegment

The second value to compare.

Returns

bool

true if left has a different value than right; otherwise, false.