@@ -6,6 +6,7 @@ namespace Silk.NET.Maths
66 using System . Collections ;
77 using System . Diagnostics . CodeAnalysis ;
88 using System . Numerics ;
9+ using System . Runtime . CompilerServices ;
910 using System . Runtime . InteropServices ;
1011 using System . Text ;
1112
@@ -22,22 +23,46 @@ public partial struct Vector4D<T> :
2223 where T : INumberBase < T >
2324 {
2425 /// <summary>Gets a vector whose 4 elements are equal to one.</summary>
25- public static Vector4D < T > One => new ( T . One ) ;
26+ public static Vector4D < T > One
27+ {
28+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
29+ get => new ( T . One ) ;
30+ }
2631
2732 /// <summary>Returns a vector whose 4 elements are equal to zero.</summary>
28- public static Vector4D < T > Zero => default ;
33+ public static Vector4D < T > Zero
34+ {
35+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
36+ get => new ( T . Zero ) ;
37+ }
2938
3039 /// <summary>Gets the vector (1, 0, 0, 0).</summary>
31- public static Vector4D < T > UnitX => new ( T . One , T . Zero , T . Zero , T . Zero ) ;
40+ public static Vector4D < T > UnitX
41+ {
42+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
43+ get => new ( T . One , T . Zero , T . Zero , T . Zero ) ;
44+ }
3245
3346 /// <summary>Gets the vector (0, 1, 0, 0).</summary>
34- public static Vector4D < T > UnitY => new ( T . Zero , T . One , T . Zero , T . Zero ) ;
47+ public static Vector4D < T > UnitY
48+ {
49+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
50+ get => new ( T . Zero , T . One , T . Zero , T . Zero ) ;
51+ }
3552
3653 /// <summary>Gets the vector (0, 0, 1, 0).</summary>
37- public static Vector4D < T > UnitZ => new ( T . Zero , T . Zero , T . One , T . Zero ) ;
54+ public static Vector4D < T > UnitZ
55+ {
56+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
57+ get => new ( T . Zero , T . Zero , T . One , T . Zero ) ;
58+ }
3859
3960 /// <summary>Gets the vector (0, 0, 0, 1).</summary>
40- public static Vector4D < T > UnitW => new ( T . Zero , T . Zero , T . Zero , T . One ) ;
61+ public static Vector4D < T > UnitW
62+ {
63+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
64+ get => new ( T . Zero , T . Zero , T . Zero , T . One ) ;
65+ }
4166
4267 /// <summary>The X component of the vector.</summary>
4368 public T X ;
0 commit comments