static class V

This is a collection of vector initialization shorthands. Since math can often get a little long to write, saving a few characters here and there can make a difference in readability. This also comes with some swizzles to make things even shorter! I also don’t love the ‘new’ keyword on Vectors, and this eliminates that.

For example: instead of new Vec3(2.0f, 2.0f, 2.0f) or even Vec3.One * 2.0f, you could write V.XXX(2.0f)

Static Methods

   
X0Z Creates a Vec3, this is a straight alternative to new Vec3(x, 0, z)
XX Creates a Vec2 where both components are the same value. This is the same as new Vec2(x, x)
XXX Creates a Vec3 where all components are the same value. This is the same as new Vec3(x, x, x)
XXXX Creates a Vec4 where all components are the same value. This is the same as new Vec4(x, x, x, x)
XY Creates a Vec2, this is a straight alternative to new Vec2(x, y)
XY0 Creates a Vec3, this is a straight alternative to new Vec3(x, y, 0)
XYZ Creates a Vec3, this is a straight alternative to new Vec3(x, y, z)
XYZW Creates a Vec4, this is a straight alternative to new Vec4(x, y, z, w)




Found an issue with these docs, or have some additional questions? Create an Issue on Github!