@@ -3,7 +3,7 @@ use super::IsEqualApprox;
33use glam:: Vec3A ;
44use std:: ops:: { Add , AddAssign , Div , DivAssign , Mul , MulAssign , Neg , Sub , SubAssign } ;
55
6- #[ derive( Copy , Clone , Debug , PartialEq ) ]
6+ #[ derive( Copy , Clone , Debug , PartialEq , Default ) ]
77#[ repr( C ) ]
88pub struct Vector3 {
99 pub x : f32 ,
@@ -23,14 +23,31 @@ pub enum Axis {
2323///
2424/// See the official [`Godot documentation`](https://docs.godotengine.org/en/3.1/classes/class_vector3.html).
2525impl Vector3 {
26+ /// The zero vector.
2627 pub const ZERO : Self = Self :: new ( 0.0 , 0.0 , 0.0 ) ;
28+
29+ /// A vector with all components set to 1. Typically used for scaling.
2730 pub const ONE : Self = Self :: new ( 1.0 , 1.0 , 1.0 ) ;
31+
32+ /// A vector with all components set to +infinity.
2833 pub const INF : Self = Self :: new ( f32:: INFINITY , f32:: INFINITY , f32:: INFINITY ) ;
34+
35+ /// Unit vector in -X direction.
2936 pub const LEFT : Self = Self :: new ( -1.0 , 0.0 , 0.0 ) ;
37+
38+ /// Unit vector in +X direction.
3039 pub const RIGHT : Self = Self :: new ( 1.0 , 0.0 , 0.0 ) ;
40+
41+ /// Unit vector in +Y direction.
3142 pub const UP : Self = Self :: new ( 0.0 , 1.0 , 0.0 ) ;
43+
44+ /// Unit vector in -Y direction.
3245 pub const DOWN : Self = Self :: new ( 0.0 , -1.0 , 0.0 ) ;
46+
47+ /// Unit vector in -Z direction.
3348 pub const FORWARD : Self = Self :: new ( 0.0 , 0.0 , -1.0 ) ;
49+
50+ /// Unit vector in +Z direction.
3451 pub const BACK : Self = Self :: new ( 0.0 , 0.0 , 1.0 ) ;
3552
3653 /// Returns a Vector3 with the given components.
0 commit comments