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)
- Исходный код:
- Vector.cs
- Исходный код:
- 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
Значение, которое необходимо присвоить элементу.
Возвращаемое значение
Объект Vector<T> со значением элемента по индексу index
, равному value
, а остальные элементы получают то же значение, что и в vector
.
Исключения
index
меньше нуля или больше числа элементов.
Тип vector
(T
) не поддерживается.