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)
Defines a ray in two dimensions, specified by a starting position and a direction.
public Vector2Ray(Vector2 position, Vector2 direction)
Parameters
positionVector2A point along the ray.
directionVector2A unit vector specifying the direction in which the ray is pointing (automatically normalized).
Properties
Direction
A unit vector specifying the direction in which the ray is pointing (automatically normalized).
public Vector2 Direction { get; set; }
Property Value
- Vector2
Position
A point along the ray.
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
otherVector2RayAn 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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
leftVector2RayrightVector2Ray
Returns
operator !=(Vector2Ray, Vector2Ray)
public static bool operator !=(Vector2Ray left, Vector2Ray right)
Parameters
leftVector2RayrightVector2Ray