C# 클래스 Microsoft.Xna.Framework.Vector2

파일 보기 프로젝트 열기: DeathCradle/Open-Terraria-API 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Array Vector2[]
X float
Y float

공개 메소드들

메소드 설명
Add ( Vector2 value1, Vector2 value2 ) : Vector2

Adds two vectors.

Add ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void

Adds two vectors.

Barycentric ( Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2 ) : Vector2

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Barycentric ( Vector2 &value1, Vector2 &value2, Vector2 &value3, float amount1, float amount2, Vector2 &result ) : void

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

CatmullRom ( Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount ) : Vector2

Performs a Catmull-Rom interpolation using the specified positions.

CatmullRom ( Vector2 &value1, Vector2 &value2, Vector2 &value3, Vector2 &value4, float amount, Vector2 &result ) : void

Performs a Catmull-Rom interpolation using the specified positions.

Clamp ( Vector2 value1, Vector2 min, Vector2 max ) : Vector2

Restricts a value to be within a specified range.

Clamp ( Vector2 &value1, Vector2 &min, Vector2 &max, Vector2 &result ) : void

Restricts a value to be within a specified range.

Distance ( Vector2 value1, Vector2 value2 ) : float

Calculates the distance between two vectors.

Distance ( Vector2 &value1, Vector2 &value2, float &result ) : void

Calculates the distance between two vectors.

DistanceSquared ( Vector2 value1, Vector2 value2 ) : float

Calculates the distance between two vectors squared.

DistanceSquared ( Vector2 &value1, Vector2 &value2, float &result ) : void

Calculates the distance between two vectors squared.

Divide ( Vector2 value1, Vector2 value2 ) : Vector2

Divides the components of a vector by the components of another vector.

Divide ( Vector2 value1, float divider ) : Vector2

Divides a vector by a scalar value.

Divide ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void

Divides the components of a vector by the components of another vector.

Divide ( Vector2 &value1, float divider, Vector2 &result ) : void

Divides a vector by a scalar value.

Dot ( Vector2 value1, Vector2 value2 ) : float

Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Dot ( Vector2 &value1, Vector2 &value2, float &result ) : void

Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Equals ( Vector2 other ) : bool

Determines whether the specified Object is equal to the Vector2.

Equals ( object obj ) : bool

Returns a value that indicates whether the current instance is equal to a specified object.

GetHashCode ( ) : int

Gets the hash code of the vector object.

Hermite ( Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount ) : Vector2

Performs a Hermite spline interpolation.

Hermite ( Vector2 &value1, Vector2 &tangent1, Vector2 &value2, Vector2 &tangent2, float amount, Vector2 &result ) : void

Performs a Hermite spline interpolation.

Length ( ) : float

Calculates the length of the vector.

LengthSquared ( ) : float

Calculates the length of the vector squared.

Lerp ( Vector2 value1, Vector2 value2, float amount ) : Vector2

Performs a linear interpolation between two vectors.

Lerp ( Vector2 &value1, Vector2 &value2, float amount, Vector2 &result ) : void

Performs a linear interpolation between two vectors.

Max ( Vector2 value1, Vector2 value2 ) : Vector2

Returns a vector that contains the highest value from each matching pair of components.

Max ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void

Returns a vector that contains the highest value from each matching pair of components.

Min ( Vector2 value1, Vector2 value2 ) : Vector2

Returns a vector that contains the lowest value from each matching pair of components.

Min ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void

Returns a vector that contains the lowest value from each matching pair of components.

Multiply ( Vector2 value1, Vector2 value2 ) : Vector2

Multiplies the components of two vectors by each other.

Multiply ( Vector2 value1, float scaleFactor ) : Vector2

Multiplies a vector by a scalar value.

Multiply ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void

Multiplies the components of two vectors by each other.

Multiply ( Vector2 &value1, float scaleFactor, Vector2 &result ) : void

Multiplies a vector by a scalar value.

Negate ( Vector2 value ) : Vector2

Returns a vector pointing in the opposite direction.

Negate ( Vector2 &value, Vector2 &result ) : void

Returns a vector pointing in the opposite direction.

Normalize ( Vector2 value ) : Vector2

Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Normalize ( ) : void

Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Normalize ( Vector2 &value, Vector2 &result ) : void

Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.

Reflect ( Vector2 vector, Vector2 normal ) : Vector2

Determines the reflect vector of the given vector and normal.

Reflect ( Vector2 &vector, Vector2 &normal, Vector2 &result ) : void

Determines the reflect vector of the given vector and normal.

SmoothStep ( Vector2 value1, Vector2 value2, float amount ) : Vector2

Interpolates between two values using a cubic equation.

SmoothStep ( Vector2 &value1, Vector2 &value2, float amount, Vector2 &result ) : void

Interpolates between two values using a cubic equation.

Subtract ( Vector2 value1, Vector2 value2 ) : Vector2

Subtracts a vector from a vector.

Subtract ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void

Subtracts a vector from a vector.

ToString ( ) : string

Retrieves a string representation of the current object.

Transform ( Vector2 position, Matrix matrix ) : Vector2

Transforms the vector (x, y, 0, 1) by the specified matrix.

Transforms a Vector2 by the given Matrix.

Transforms a 2D vector normal by a matrix.

Transforms a vector normal by a matrix.

Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Transforms an array of Vector2s by a specified Matrix.

Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array.

Transforms an array of Vector2 vector normals by a specified Matrix.

Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array.

Transforms an array of Vector2s by a specified Quaternion.

Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.

Vector2 ( float value ) : System

Creates a new instance of Vector2.

Vector2 ( float x, float y ) : System

Initializes a new instance of Vector2.

operator ( ) : Vector2

Returns a vector pointing in the opposite direction.

operator ( ) : bool

Tests vectors for equality.

메소드 상세

Add() 공개 정적인 메소드

Adds two vectors.
public static Add ( Vector2 value1, Vector2 value2 ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 Vector2

Add() 공개 정적인 메소드

Adds two vectors.
public static Add ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result Vector2 [OutAttribute] Sum of the source vectors.
리턴 void

Barycentric() 공개 정적인 메소드

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
public static Barycentric ( Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2 ) : Vector2
value1 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1 float Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2 float Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
리턴 Vector2

Barycentric() 공개 정적인 메소드

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
public static Barycentric ( Vector2 &value1, Vector2 &value2, Vector2 &value3, float amount1, float amount2, Vector2 &result ) : void
value1 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1 float Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2 float Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result Vector2 [OutAttribute] The 2D Cartesian coordinates of the specified point are placed in this Vector2 on exit.
리턴 void

CatmullRom() 공개 정적인 메소드

Performs a Catmull-Rom interpolation using the specified positions.
public static CatmullRom ( Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount ) : Vector2
value1 Vector2 The first position in the interpolation.
value2 Vector2 The second position in the interpolation.
value3 Vector2 The third position in the interpolation.
value4 Vector2 The fourth position in the interpolation.
amount float Weighting factor.
리턴 Vector2

CatmullRom() 공개 정적인 메소드

Performs a Catmull-Rom interpolation using the specified positions.
public static CatmullRom ( Vector2 &value1, Vector2 &value2, Vector2 &value3, Vector2 &value4, float amount, Vector2 &result ) : void
value1 Vector2 The first position in the interpolation.
value2 Vector2 The second position in the interpolation.
value3 Vector2 The third position in the interpolation.
value4 Vector2 The fourth position in the interpolation.
amount float Weighting factor.
result Vector2 [OutAttribute] A vector that is the result of the Catmull-Rom interpolation.
리턴 void

Clamp() 공개 정적인 메소드

Restricts a value to be within a specified range.
public static Clamp ( Vector2 value1, Vector2 min, Vector2 max ) : Vector2
value1 Vector2 The value to clamp.
min Vector2 The minimum value.
max Vector2 The maximum value.
리턴 Vector2

Clamp() 공개 정적인 메소드

Restricts a value to be within a specified range.
public static Clamp ( Vector2 &value1, Vector2 &min, Vector2 &max, Vector2 &result ) : void
value1 Vector2 The value to clamp.
min Vector2 The minimum value.
max Vector2 The maximum value.
result Vector2 [OutAttribute] The clamped value.
리턴 void

Distance() 공개 정적인 메소드

Calculates the distance between two vectors.
public static Distance ( Vector2 value1, Vector2 value2 ) : float
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 float

Distance() 공개 정적인 메소드

Calculates the distance between two vectors.
public static Distance ( Vector2 &value1, Vector2 &value2, float &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result float [OutAttribute] The distance between the vectors.
리턴 void

DistanceSquared() 공개 정적인 메소드

Calculates the distance between two vectors squared.
public static DistanceSquared ( Vector2 value1, Vector2 value2 ) : float
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 float

DistanceSquared() 공개 정적인 메소드

Calculates the distance between two vectors squared.
public static DistanceSquared ( Vector2 &value1, Vector2 &value2, float &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result float [OutAttribute] The distance between the vectors squared.
리턴 void

Divide() 공개 정적인 메소드

Divides the components of a vector by the components of another vector.
public static Divide ( Vector2 value1, Vector2 value2 ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Divisor vector.
리턴 Vector2

Divide() 공개 정적인 메소드

Divides a vector by a scalar value.
public static Divide ( Vector2 value1, float divider ) : Vector2
value1 Vector2 Source vector.
divider float The divisor.
리턴 Vector2

Divide() 공개 정적인 메소드

Divides the components of a vector by the components of another vector.
public static Divide ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 The divisor.
result Vector2 [OutAttribute] The result of the division.
리턴 void

Divide() 공개 정적인 메소드

Divides a vector by a scalar value.
public static Divide ( Vector2 &value1, float divider, Vector2 &result ) : void
value1 Vector2 Source vector.
divider float The divisor.
result Vector2 [OutAttribute] The result of the division.
리턴 void

Dot() 공개 정적인 메소드

Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
public static Dot ( Vector2 value1, Vector2 value2 ) : float
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 float

Dot() 공개 정적인 메소드

Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
public static Dot ( Vector2 &value1, Vector2 &value2, float &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result float [OutAttribute] The dot product of the two vectors.
리턴 void

Equals() 공개 메소드

Determines whether the specified Object is equal to the Vector2.
public Equals ( Vector2 other ) : bool
other Vector2 The Object to compare with the current Vector2.
리턴 bool

Equals() 공개 메소드

Returns a value that indicates whether the current instance is equal to a specified object.
public Equals ( object obj ) : bool
obj object Object to make the comparison with.
리턴 bool

GetHashCode() 공개 메소드

Gets the hash code of the vector object.
public GetHashCode ( ) : int
리턴 int

Hermite() 공개 정적인 메소드

Performs a Hermite spline interpolation.
public static Hermite ( Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount ) : Vector2
value1 Vector2 Source position vector.
tangent1 Vector2 Source tangent vector.
value2 Vector2 Source position vector.
tangent2 Vector2 Source tangent vector.
amount float Weighting factor.
리턴 Vector2

Hermite() 공개 정적인 메소드

Performs a Hermite spline interpolation.
public static Hermite ( Vector2 &value1, Vector2 &tangent1, Vector2 &value2, Vector2 &tangent2, float amount, Vector2 &result ) : void
value1 Vector2 Source position vector.
tangent1 Vector2 Source tangent vector.
value2 Vector2 Source position vector.
tangent2 Vector2 Source tangent vector.
amount float Weighting factor.
result Vector2 [OutAttribute] The result of the Hermite spline interpolation.
리턴 void

Length() 공개 메소드

Calculates the length of the vector.
public Length ( ) : float
리턴 float

LengthSquared() 공개 메소드

Calculates the length of the vector squared.
public LengthSquared ( ) : float
리턴 float

Lerp() 공개 정적인 메소드

Performs a linear interpolation between two vectors.
public static Lerp ( Vector2 value1, Vector2 value2, float amount ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Source vector.
amount float Value between 0 and 1 indicating the weight of value2.
리턴 Vector2

Lerp() 공개 정적인 메소드

Performs a linear interpolation between two vectors.
public static Lerp ( Vector2 &value1, Vector2 &value2, float amount, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
amount float Value between 0 and 1 indicating the weight of value2.
result Vector2 [OutAttribute] The result of the interpolation.
리턴 void

Max() 공개 정적인 메소드

Returns a vector that contains the highest value from each matching pair of components.
public static Max ( Vector2 value1, Vector2 value2 ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 Vector2

Max() 공개 정적인 메소드

Returns a vector that contains the highest value from each matching pair of components.
public static Max ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result Vector2 [OutAttribute] The maximized vector.
리턴 void

Min() 공개 정적인 메소드

Returns a vector that contains the lowest value from each matching pair of components.
public static Min ( Vector2 value1, Vector2 value2 ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 Vector2

Min() 공개 정적인 메소드

Returns a vector that contains the lowest value from each matching pair of components.
public static Min ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result Vector2 [OutAttribute] The minimized vector.
리턴 void

Multiply() 공개 정적인 메소드

Multiplies the components of two vectors by each other.
public static Multiply ( Vector2 value1, Vector2 value2 ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 Vector2

Multiply() 공개 정적인 메소드

Multiplies a vector by a scalar value.
public static Multiply ( Vector2 value1, float scaleFactor ) : Vector2
value1 Vector2 Source vector.
scaleFactor float Scalar value.
리턴 Vector2

Multiply() 공개 정적인 메소드

Multiplies the components of two vectors by each other.
public static Multiply ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result Vector2 [OutAttribute] The result of the multiplication.
리턴 void

Multiply() 공개 정적인 메소드

Multiplies a vector by a scalar value.
public static Multiply ( Vector2 &value1, float scaleFactor, Vector2 &result ) : void
value1 Vector2 Source vector.
scaleFactor float Scalar value.
result Vector2 [OutAttribute] The result of the multiplication.
리턴 void

Negate() 공개 정적인 메소드

Returns a vector pointing in the opposite direction.
public static Negate ( Vector2 value ) : Vector2
value Vector2 Source vector.
리턴 Vector2

Negate() 공개 정적인 메소드

Returns a vector pointing in the opposite direction.
public static Negate ( Vector2 &value, Vector2 &result ) : void
value Vector2 Source vector.
result Vector2 [OutAttribute] Vector pointing in the opposite direction.
리턴 void

Normalize() 공개 정적인 메소드

Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
public static Normalize ( Vector2 value ) : Vector2
value Vector2 Source Vector2.
리턴 Vector2

Normalize() 공개 메소드

Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.
public Normalize ( ) : void
리턴 void

Normalize() 공개 정적인 메소드

Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.
public static Normalize ( Vector2 &value, Vector2 &result ) : void
value Vector2 Source vector.
result Vector2 [OutAttribute] Normalized vector.
리턴 void

Reflect() 공개 정적인 메소드

Determines the reflect vector of the given vector and normal.
public static Reflect ( Vector2 vector, Vector2 normal ) : Vector2
vector Vector2 Source vector.
normal Vector2 Normal of vector.
리턴 Vector2

Reflect() 공개 정적인 메소드

Determines the reflect vector of the given vector and normal.
public static Reflect ( Vector2 &vector, Vector2 &normal, Vector2 &result ) : void
vector Vector2 Source vector.
normal Vector2 Normal of vector.
result Vector2 [OutAttribute] The created reflect vector.
리턴 void

SmoothStep() 공개 정적인 메소드

Interpolates between two values using a cubic equation.
public static SmoothStep ( Vector2 value1, Vector2 value2, float amount ) : Vector2
value1 Vector2 Source value.
value2 Vector2 Source value.
amount float Weighting value.
리턴 Vector2

SmoothStep() 공개 정적인 메소드

Interpolates between two values using a cubic equation.
public static SmoothStep ( Vector2 &value1, Vector2 &value2, float amount, Vector2 &result ) : void
value1 Vector2 Source value.
value2 Vector2 Source value.
amount float Weighting value.
result Vector2 [OutAttribute] The interpolated value.
리턴 void

Subtract() 공개 정적인 메소드

Subtracts a vector from a vector.
public static Subtract ( Vector2 value1, Vector2 value2 ) : Vector2
value1 Vector2 Source vector.
value2 Vector2 Source vector.
리턴 Vector2

Subtract() 공개 정적인 메소드

Subtracts a vector from a vector.
public static Subtract ( Vector2 &value1, Vector2 &value2, Vector2 &result ) : void
value1 Vector2 Source vector.
value2 Vector2 Source vector.
result Vector2 [OutAttribute] The result of the subtraction.
리턴 void

ToString() 공개 메소드

Retrieves a string representation of the current object.
public ToString ( ) : string
리턴 string

Transform() 공개 정적인 메소드

Transforms the vector (x, y, 0, 1) by the specified matrix. Transforms a Vector2 by the given Matrix. Transforms a 2D vector normal by a matrix. Transforms a vector normal by a matrix. Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation. Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation. Transforms an array of Vector2s by a specified Matrix. Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array. Transforms an array of Vector2 vector normals by a specified Matrix. Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array. Transforms an array of Vector2s by a specified Quaternion. Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.
public static Transform ( Vector2 position, Matrix matrix ) : Vector2
position Vector2 The source vector.
matrix Matrix The transformation matrix.
리턴 Vector2

Vector2() 공개 메소드

Creates a new instance of Vector2.
public Vector2 ( float value ) : System
value float Value to initialize both components to.
리턴 System

Vector2() 공개 메소드

Initializes a new instance of Vector2.
public Vector2 ( float x, float y ) : System
x float Initial value for the x-component of the vector.
y float Initial value for the y-component of the vector.
리턴 System

operator() 공개 정적인 메소드

Returns a vector pointing in the opposite direction.
public static operator ( ) : Vector2
리턴 Vector2

operator() 공개 정적인 메소드

Tests vectors for equality.
public static operator ( ) : bool
리턴 bool

프로퍼티 상세

Array 공개적으로 정적으로 프로퍼티

public static Vector2[] Array
리턴 Vector2[]

X 공개적으로 프로퍼티

Gets or sets the x-component of the vector.
public float X
리턴 float

Y 공개적으로 프로퍼티

Gets or sets the y-component of the vector.
public float Y
리턴 float