Vector2 One { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Vector2.One property provides a static instance of a 2D vector where both the X and Y components are set to 1. This is useful for scenarios where you need a vector with uniform components, such as scaling operations or initializing default values.

Usage

Use Vector2.One when you need a vector with both components set to 1. This can be particularly useful in mathematical operations where a uniform vector is required.

Example

// Example of using Vector2.One
Vector2 uniformVector = Vector2.One;

// Output the components of the vector
float xComponent = uniformVector.x; // 1
float yComponent = uniformVector.y; // 1

// Use in a scaling operation
Vector2 scaledVector = someVector * Vector2.One; // Effectively the same as someVector