Class Vertex
Holds information about a single vertex, and provides methods for averaging between multiple Vertex objects.
Implements
Inherited Members
Namespace: UnityEngine.ProBuilder
Assembly: Unity.ProBuilder.dll
Syntax
[Serializable]
public sealed class Vertex : IEquatable<Vertex>
Remarks
All values are optional; however, ProBuilder can use default values if necessary.
Constructors
Name | Description |
---|---|
Vertex() | Initializes a Vertex with no values. |
Vertex(Vertex) | Creates a new Vertex object as a copy of another Vertex object. |
Properties
Name | Description |
---|---|
color | Gets or sets the vertex color. |
normal | Gets or sets the unit vector normal. |
position | Gets or sets the position in local space. |
tangent | Gets or sets the vertex tangent (sometimes called binormal). |
uv0 | Gets or sets the UV0 channel. Also called texture UVs. |
uv2 | Gets or sets the UV2 channel. |
uv3 | Gets or sets the UV3 channel. |
uv4 | Gets or sets the UV4 channel. |
Methods
Name | Description |
---|---|
Add(Vertex) | Adds another Vertex object to this one using component-wise addition on each attribute. |
Add(Vertex, Vertex) | Adds two Vertex objects together and returns the result in a new Vertex object. Addition is performed component-wise for every attribute on the Vertex. |
Average(IList<Vertex>, IList<int>) | Averages all vertices to a single vertex and returns the result as a new Vertex object. |
Divide(float) | Divides this Vertex object by the specified |
Divide(Vertex, float) | Divides a Vertex object by the specified |
Equals(object) | Determines whether the specified generic object is equal to this Vertex. |
Equals(Vertex) | Determines whether the specified Vertex object is equal to this Vertex by checking whether all components are within a certain distance of the other. |
Equals(Vertex, MeshArrays) | Determines whether the specified Vertex object is equal to this Vertex by checking whether each
component for a specific set of attributes is within a certain distance of the other. The MeshArrays
|
GetArrays(IList<Vertex>, out Vector3[], out Color[], out Vector2[], out Vector3[], out Vector4[], out Vector2[], out List<Vector4>, out List<Vector4>) | Allocates and fills all attribute arrays. This method fills all arrays, regardless of whether or not
real data populates the values. You can check which attributes a Vertex contains with |
GetArrays(IList<Vertex>, out Vector3[], out Color[], out Vector2[], out Vector3[], out Vector4[], out Vector2[], out List<Vector4>, out List<Vector4>, MeshArrays) | Allocates and fills the specified attribute arrays. |
GetHashCode() | Creates a new hashcode from this Vertex's position, UV0, and normal. |
HasArrays(MeshArrays) | Tests whether the specified vertex attribute has been set. |
Mix(Vertex, Vertex, float) | Linearly interpolates between two vertices using the specified weight. |
Multiply(float) | Multiples this Vertex object by the specified |
Multiply(Vertex, float) | Multiples a Vertex object by the specified |
Normalize() | Normalizes all vector values in place. |
SetMesh(Mesh, IList<Vertex>) | Replaces mesh values with the specified vertex array. The mesh is cleared during this function, so you need to set the triangles after calling this method. |
Subtract(Vertex) | Subtracts another Vertex object from this one using component-wise subtraction on each attribute. |
Subtract(Vertex, Vertex) | Subtracts two Vertex objects and returns the result in a new Vertex object. Subtraction is performed component-wise for every attribute on the Vertex. |
ToString(string) | Returns a multi-line string listing every populated attribute. |
Operators
Name | Description |
---|---|
operator +(Vertex, Vertex) | Adds two Vertex objects together and returns the result in a new Vertex object. Addition is performed component-wise for every attribute on the Vertex. |
operator /(Vertex, float) | Divides a Vertex object by the specified |
operator ==(Vertex, Vertex) | Determines whether the specified Vertex is equal to this one. |
operator !=(Vertex, Vertex) | Determines whether the specified Vertex is not equal to this one. |
operator *(Vertex, float) | Multiples a Vertex object by the specified |
operator -(Vertex, Vertex) | Subtracts two Vertex objects and returns the result in a new Vertex object. Subtraction is performed component-wise for every attribute. |