Vector4

struct in UnityEngine

Switch to Manual

Description

Представление четырехмерных векторов

This structure is used in some places to represent four component vectors (e.g. mesh tangents, parameters for shaders). In the majority of other cases a Vector3 is used.

Static Variables

negativeInfinityShorthand for writing Vector4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity).
oneСокращенное написание Vector4(1,1,1,1)
positiveInfinityShorthand for writing Vector4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity).
zeroСокращенное написание Vector4(0,0,0,0)

Variables

magnitudeвозвращает длину этого vector'a (Read Only)
normalizedReturns this vector with a magnitude of 1 (Read Only).
sqrMagnitudeВозвращает квадрат длины этого vector'a (Read Only)
this[int]Доступ к x,y,z,w компонентам, используется [0],[1],[2],[3] соответственно
wW компонент vector'a
xX компонент vector'a
yY компонент vector'a
zZ компонент vector'a

Constructors

Vector4Создает новый vector с компонентами x,y,z,w

Public Functions

EqualsReturns true if the given vector is exactly equal to this vector.
SetSet x, y, z and w components of an existing Vector4.
ToStringReturn the Vector4 formatted as a string.

Static Functions

DistanceВозвращает расстояние между / а / и / B /.
DotDot Product of two vectors.
LerpЛинейная интерполяция между двумя vector'aми .
LerpUnclampedЛинейная интерполяция между двумя vector'aми .
MaxВозвращает vector, который сделан из компонентов двух vector'oв
MinВозвращает vector, который сделан из мелких компонентов двух vector'oв
MoveTowardsПеремещает из точки curren в /target /
NormalizeMakes this vector have a magnitude of 1.
ProjectProjects a vector onto another vector.
ScaleПокомпонентное умножение двух vector'oв

Operators

operator -Вычитает один vector из другого
operator *Умножает vector на число
operator /Делит vector на число
operator +Добавляет два вектора.
operator ==Returns true if two vectors are approximately equal.
Vector2Converts a Vector4 to a Vector2.
Vector3Converts a Vector4 to a Vector3.
Vector4Converts a Vector3 to a Vector4.
Vector4Converts a Vector2 to a Vector4.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961