@@ -678,3 +678,8 @@ func (v *Vector3) AlmostEquals(other *Vector3, tolerance float32) bool {
}
return false
+
+// Vector4 returns a new Vector4 based on this vector and the provided w value.
+func (v *Vector3) Vector4(w float32) *Vector4 {
+ return &Vector4{X: v.X, Y: v.Y, Z: v.Z, W: w}
+}
@@ -642,3 +642,8 @@ func (v *Vector4) AlmostEquals(other *Vector4, tolerance float32) bool {
+// Vector3 returns a new Vector3 based on this vector, without the w value.
+func (v *Vector4) Vector3() *Vector3 {
+ return &Vector3{X: v.X, Y: v.Y, Z: v.Z}