다음을 통해 공유


Vector.WithElement 메서드

정의

오버로드

WithElement(Vector3, Int32, Single)
WithElement(Vector2, Int32, Single)
WithElement(Vector4, Int32, Single)
WithElement<T>(Vector<T>, Int32, T)

지정된 인덱스의 요소는 지정된 값으로 설정하고 나머지 요소는 지정된 벡터의 요소와 같은 값으로 설정하여 새로운 Vector<T>을 만듭니다.

WithElement(Vector3, Int32, Single)

public:
[System::Runtime::CompilerServices::Extension]
 static System::Numerics::Vector3 WithElement(System::Numerics::Vector3 vector, int index, float value);
public static System.Numerics.Vector3 WithElement(this System.Numerics.Vector3 vector, int index, float value);
static member WithElement : System.Numerics.Vector3 * int * single -> System.Numerics.Vector3
<Extension()>
Public Function WithElement (vector As Vector3, index As Integer, value As Single) As Vector3

매개 변수

vector
Vector3
index
Int32
value
Single

반환

적용 대상

WithElement(Vector2, Int32, Single)

public:
[System::Runtime::CompilerServices::Extension]
 static System::Numerics::Vector2 WithElement(System::Numerics::Vector2 vector, int index, float value);
public static System.Numerics.Vector2 WithElement(this System.Numerics.Vector2 vector, int index, float value);
static member WithElement : System.Numerics.Vector2 * int * single -> System.Numerics.Vector2
<Extension()>
Public Function WithElement (vector As Vector2, index As Integer, value As Single) As Vector2

매개 변수

vector
Vector2
index
Int32
value
Single

반환

적용 대상

WithElement(Vector4, Int32, Single)

public:
[System::Runtime::CompilerServices::Extension]
 static System::Numerics::Vector4 WithElement(System::Numerics::Vector4 vector, int index, float value);
public static System.Numerics.Vector4 WithElement(this System.Numerics.Vector4 vector, int index, float value);
static member WithElement : System.Numerics.Vector4 * int * single -> System.Numerics.Vector4
<Extension()>
Public Function WithElement (vector As Vector4, index As Integer, value As Single) As Vector4

매개 변수

vector
Vector4
index
Int32
value
Single

반환

적용 대상

WithElement<T>(Vector<T>, Int32, T)

Source:
Vector.cs
Source:
Vector.cs

지정된 인덱스의 요소는 지정된 값으로 설정하고 나머지 요소는 지정된 벡터의 요소와 같은 값으로 설정하여 새로운 Vector<T>을 만듭니다.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Numerics::Vector<T> WithElement(System::Numerics::Vector<T> vector, int index, T value);
public static System.Numerics.Vector<T> WithElement<T>(this System.Numerics.Vector<T> vector, int index, T value);
static member WithElement : System.Numerics.Vector<'T> * int * 'T -> System.Numerics.Vector<'T>
<Extension()>
Public Function WithElement(Of T) (vector As Vector(Of T), index As Integer, value As T) As Vector(Of T)

형식 매개 변수

T

벡터에 있는 요소의 형식입니다.

매개 변수

vector
Vector<T>

나머지 요소를 가져올 벡터입니다.

index
Int32

설정할 요소의 인덱스입니다.

value
T

요소를 설정할 값입니다.

반환

index의 요소 값이 value로 설정되고 나머지 요소는 vector에 있는 요소와 같은 값으로 설정된 Vector<T>입니다.

예외

index가 0 미만이거나 요소 수보다 큽니다.

vector(T)의 형식은 지원되지 않습니다.

적용 대상