Struct Vector2Ray
- Namespace
- OmegaEngine.Foundation.Geometry
- Assembly
- OmegaEngine.Foundation.dll
Defines a ray in two dimensions, specified by a starting position and a direction.
[TypeConverter(typeof(Vector2RayConverter))]
public struct Vector2Ray : IEquatable<Vector2Ray>
- Implements
- Inherited Members
- Extension Methods
Constructors
Vector2Ray(Vector2, Vector2)
Creates a new ray
public Vector2Ray(Vector2 point, Vector2 direction)
Parameters
point
Vector2A point along the ray
direction
Vector2A vector pointing along the ray - automatically normalized when set
Properties
Direction
A vector pointing along the ray - automatically normalized when set
public Vector2 Direction { get; set; }
Property Value
- Vector2
Position
Specifies the location of the ray's origin.
public readonly Vector2 Position { get; }
Property Value
- Vector2
Methods
Equals(Vector2Ray)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Vector2Ray other)
Parameters
other
Vector2RayAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(Vector2Ray, Vector2Ray)
public static bool operator ==(Vector2Ray left, Vector2Ray right)
Parameters
left
Vector2Rayright
Vector2Ray
Returns
operator !=(Vector2Ray, Vector2Ray)
public static bool operator !=(Vector2Ray left, Vector2Ray right)
Parameters
left
Vector2Rayright
Vector2Ray