Прочетете на английски Редактиране

Споделяне чрез


Vector4.Create Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Create(Single, Single, Single, Single)

Creates a vector whose elements have the specified values.

Create(ReadOnlySpan<Single>)

Constructs a vector from the given ReadOnlySpan<T>. The span must contain at least 4 elements.

Create(Single)

Creates a new Vector4 object whose four elements have the same value.

Create(Vector3, Single)

Constructs a new Vector4 object from the specified Vector3 object and a W component.

Create(Vector2, Single, Single)

Creates a new Vector4 object from the specified Vector2 object and a Z and a W component.

Create(Single, Single, Single, Single)

Creates a vector whose elements have the specified values.

C#
public static System.Numerics.Vector4 Create(float x, float y, float z, float w);

Parameters

x
Single

The value to assign to the X field.

y
Single

The value to assign to the Y field.

z
Single

The value to assign to the Z field.

w
Single

The value to assign to the W field.

Returns

A new Vector4 whose elements have the specified values.

Applies to

.NET 10 и .NET 9
Продукт Версии
.NET 9, 10

Create(ReadOnlySpan<Single>)

Constructs a vector from the given ReadOnlySpan<T>. The span must contain at least 4 elements.

C#
public static System.Numerics.Vector4 Create(ReadOnlySpan<float> values);

Parameters

values
ReadOnlySpan<Single>

The span of elements to assign to the vector.

Returns

A new Vector4 whose elements have the specified values.

Applies to

.NET 10 и .NET 9
Продукт Версии
.NET 9, 10

Create(Single)

Creates a new Vector4 object whose four elements have the same value.

C#
public static System.Numerics.Vector4 Create(float value);

Parameters

value
Single

The value to assign to all four elements.

Returns

A new Vector4 whose four elements have the same value.

Applies to

.NET 10 и .NET 9
Продукт Версии
.NET 9, 10

Create(Vector3, Single)

Constructs a new Vector4 object from the specified Vector3 object and a W component.

C#
public static System.Numerics.Vector4 Create(System.Numerics.Vector3 vector, float w);

Parameters

vector
Vector3

The vector to use for the X, Y, and Z components.

w
Single

The W component.

Returns

A new Vector4 from the specified Vector3 object and a W component.

Applies to

.NET 10 и .NET 9
Продукт Версии
.NET 9, 10

Create(Vector2, Single, Single)

Creates a new Vector4 object from the specified Vector2 object and a Z and a W component.

C#
public static System.Numerics.Vector4 Create(System.Numerics.Vector2 vector, float z, float w);

Parameters

vector
Vector2

The vector to use for the X and Y components.

z
Single

The Z component.

w
Single

The W component.

Returns

A new Vector4 from the specified Vector2 object and a Z and a W component.

Applies to

.NET 10 и .NET 9
Продукт Версии
.NET 9, 10