Vector3 ComponentMax( Vector3& other )

book_4_sparkGenerated
code_blocksInput

Description

The ComponentMax method of the Vector3 struct returns a new Vector3 where each component is the maximum of the corresponding components of the current vector and another specified vector. This method is useful for comparing two vectors and creating a new vector that represents the maximum values of each component.

Usage

To use the ComponentMax method, you need to have an instance of a Vector3 and another Vector3 to compare against. The method will return a new Vector3 with the maximum values for each component.

Example

Vector3 vector1 = new Vector3(1.0f, 3.0f, 5.0f);
Vector3 vector2 = new Vector3(2.0f, 2.0f, 6.0f);

Vector3 result = vector1.ComponentMax(ref vector2);
// result is now (2.0f, 3.0f, 6.0f)