This shows you the differences between two versions of the page.
— |
2d_vector [2022/04/30 20:12] (current) max created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Vector2 ====== | ||
+ | Vector2 consists two floats, '' | ||
+ | Similar to Matrices, Vectors also have two methods of accessing their variables. | ||
+ | |||
+ | Namely, you can access them directly, or using the '' | ||
+ | |||
+ | The following example uses both methods: | ||
+ | <code c> | ||
+ | float Vector2:: | ||
+ | return asArray[0] * other.x + asArray[1] * other.y; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Vector2 also features the following utility functions: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | The following utility functions return *new* Vector2 objects: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' |