Table of Contents

Struct Vector3

Namespace
Lime
Assembly
Lime.dll

Representation of 3D vectors and points.

public struct Vector3 : IEquatable<Vector3>
Implements
Inherited Members

Constructors

Vector3(Vector2, float)

public Vector3(Vector2 xy, float z)

Parameters

xy Vector2
z float

Vector3(float)

public Vector3(float xyz)

Parameters

xyz float

Vector3(float, float, float)

public Vector3(float x, float y, float z)

Parameters

x float
y float
z float

Fields

Half

Returns a vector with components 0.5, 0.5, 0.5.

public static readonly Vector3 Half

Field Value

Vector3

NaN

Returns a vector with components NaN, NaN, NaN.

public static readonly Vector3 NaN

Field Value

Vector3

One

Returns a vector with components 1, 1, 1.

public static readonly Vector3 One

Field Value

Vector3

UnitX

public static readonly Vector3 UnitX

Field Value

Vector3

UnitY

public static readonly Vector3 UnitY

Field Value

Vector3

UnitZ

public static readonly Vector3 UnitZ

Field Value

Vector3

X

[YuzuMember("0")]
public float X

Field Value

float

Y

[YuzuMember("1")]
public float Y

Field Value

float

Z

[YuzuMember("2")]
public float Z

Field Value

float

Zero

Returns a vector with components 0, 0, 0.

public static readonly Vector3 Zero

Field Value

Vector3

Properties

this[int]

Gets or sets the vector component by its index.

public float this[int component] { get; set; }

Parameters

component int

Property Value

float

Length

public float Length { get; }

Property Value

float

Normalized

Returns this Vector3 as a unit vector with the same direction.

public Vector3 Normalized { get; }

Property Value

Vector3

SqrLength

public float SqrLength { get; }

Property Value

float

Methods

CrossProduct(Vector3, Vector3)

public static Vector3 CrossProduct(Vector3 value1, Vector3 value2)

Parameters

value1 Vector3
value2 Vector3

Returns

Vector3

DotProduct(Vector3, Vector3)

public static float DotProduct(Vector3 value1, Vector3 value2)

Parameters

value1 Vector3
value2 Vector3

Returns

float

Equals(Vector3)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Vector3 other)

Parameters

other Vector3

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The 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.

Lerp(float, Vector3, Vector3)

Creates a new Vector3 that contains linear interpolation of the specified vectors.

public static Vector3 Lerp(float amount, Vector3 value1, Vector3 value2)

Parameters

amount float

Weighting value(between 0.0 and 1.0).

value1 Vector3

The first vector.

value2 Vector3

The second vector.

Returns

Vector3

The result of linear interpolation of the specified vectors.

Max(Vector3, Vector3)

public static Vector3 Max(Vector3 value1, Vector3 value2)

Parameters

value1 Vector3
value2 Vector3

Returns

Vector3

Min(Vector3, Vector3)

public static Vector3 Min(Vector3 value1, Vector3 value2)

Parameters

value1 Vector3
value2 Vector3

Returns

Vector3

Parse(string)

Converts the string representation of the number to its Vector3 equivalent.

public static Vector3 Parse(string s)

Parameters

s string

The string containing the vector to convert.

Returns

Vector3

Examples

"12, 34, 56".

ToString()

Returns the string representation of this Vector3 in the format: "X, Y, Z".

public override string ToString()

Returns

string

ToString(IFormatProvider)

Returns the string representation of this Vector3 in the format: "X, Y, Z".

public string ToString(IFormatProvider format)

Parameters

format IFormatProvider

Returns

string

TryParse(string, out Vector3)

Converts the string representation of the vector to its Vector3 equivalent. The return value indicates whether the conversion succeeded.

public static bool TryParse(string s, out Vector3 vector)

Parameters

s string

The string containing the vector to convert.

vector Vector3

The result of conversion if it succeeds, Zero otherwise.

Returns

bool

Examples

"12, 34, 56".

Operators

operator +(Vector3, Vector3)

public static Vector3 operator +(Vector3 lhs, Vector3 rhs)

Parameters

lhs Vector3
rhs Vector3

Returns

Vector3

operator /(Vector3, Vector3)

public static Vector3 operator /(Vector3 lhs, Vector3 rhs)

Parameters

lhs Vector3
rhs Vector3

Returns

Vector3

operator /(Vector3, float)

public static Vector3 operator /(Vector3 lhs, float rhs)

Parameters

lhs Vector3
rhs float

Returns

Vector3

operator ==(Vector3, Vector3)

public static bool operator ==(Vector3 lhs, Vector3 rhs)

Parameters

lhs Vector3
rhs Vector3

Returns

bool

explicit operator Vector2(Vector3)

public static explicit operator Vector2(Vector3 value)

Parameters

value Vector3

Returns

Vector2

operator !=(Vector3, Vector3)

public static bool operator !=(Vector3 lhs, Vector3 rhs)

Parameters

lhs Vector3
rhs Vector3

Returns

bool

operator *(Vector3, Vector3)

public static Vector3 operator *(Vector3 lhs, Vector3 rhs)

Parameters

lhs Vector3
rhs Vector3

Returns

Vector3

operator *(Vector3, float)

public static Vector3 operator *(Vector3 lhs, float rhs)

Parameters

lhs Vector3
rhs float

Returns

Vector3

operator *(float, Vector3)

public static Vector3 operator *(float lhs, Vector3 rhs)

Parameters

lhs float
rhs Vector3

Returns

Vector3

operator -(Vector3, Vector3)

public static Vector3 operator -(Vector3 lhs, Vector3 rhs)

Parameters

lhs Vector3
rhs Vector3

Returns

Vector3

operator -(Vector3)

public static Vector3 operator -(Vector3 value)

Parameters

value Vector3

Returns

Vector3