Skip to content

Commit 65fb5ce

Browse files
committed
Add Vec.w
1 parent f80f7b0 commit 65fb5ce

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Aardvark.Base.FSharp/Interop/Vectors.fs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ module Vec =
108108
let inline z< ^a, ^b when ^a : (member P_Z : ^b)> (v : ^a) =
109109
(^a : (member P_Z : ^b) v)
110110

111+
/// Returns the w-component of the vector v.
112+
let inline w< ^a, ^b when ^a : (member P_W : ^b)> (v : ^a) =
113+
(^a : (member P_W : ^b) v)
114+
111115
/// Returns the xy-components of the vector v.
112116
let inline xy< ^a, ^b when ^a : (member XY : ^b)> (v : ^a) =
113117
(^a : (member XY : ^b) v)
@@ -182,7 +186,7 @@ module Vec =
182186
let a : float = dot V3d.One V3d.Zero
183187
let a : int = dot V3i.One V3i.Zero
184188
()
185-
189+
186190
let crossWorking () =
187191
let a : V3d = cross V3d.One V3d.Zero
188192
let a : V3i = cross V3i.One V3i.Zero
@@ -222,16 +226,17 @@ module Vec =
222226
let a : V3f = reflect V3f.One V3f.Zero
223227
let a : V3d = reflect V3d.One V3d.Zero
224228
()
225-
229+
226230
let refractWorking () =
227-
let a : V3f = refract 0.0f V3f.One V3f.Zero
228-
let a : V3d = refract 0.0 V3d.One V3d.Zero
231+
let a : V3f = refract 0.0f V3f.One V3f.Zero
232+
let a : V3d = refract 0.0 V3d.One V3d.Zero
229233
()
230234

231235
let swizzlesWorking () =
232236
let a : float = x V3d.One
233237
let a : float = y V3d.One
234238
let a : float = z V3d.One
239+
let a : float = w V4d.One
235240
let a : V2d = xy V3d.One
236241
let a : V2d = yz V3d.One
237242
let a : V2d = zw V4d.One

0 commit comments

Comments
 (0)