Description
The ComponentMax
method of the Vector2
struct returns a new Vector2
instance where each component is the maximum of the corresponding components of the current vector and the specified other
vector. This method is useful for comparing two vectors and creating a new vector that represents the maximum bounds of both.
Usage
To use the ComponentMax
method, call it on an instance of Vector2
and pass another Vector2
as the parameter. The method will return a new Vector2
where each component is the maximum of the two vectors' components.
Example
Vector2 vector1 = new Vector2(3.0f, 5.0f);
Vector2 vector2 = new Vector2(4.0f, 2.0f);
Vector2 result = vector1.ComponentMax(vector2);
// result is now (4.0f, 5.0f)