Procedural Building Integer Vector
Procedural Building — Integer Vector (vector3i)
A clean, self-contained struct<computes><concrete> for integer-grid math: an X/Y/Z vector3i with overloaded +, -, scalar *, equality, and conversion helpers. The foundation the Procedural Building template builds its voxel grid on. Teaches <computes> (pure) functions, operator overloading, and concrete structs.
From the Procedural Building Template Epic starter project (SampleVerse/ProceduralBuilding/vector3i.verse). Epic Games reference Verse, shown for study.
-
using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/SpatialMath } # 3-dimensional vector with `int` components vector3i<public> := struct<computes><concrete>: @editable X<public>:int = 0 @editable Y<public>:int = 0 @editable Z<public>:int = 0 ZeroVector3i:vector3i := vector3i{X:=0, Y:=0, Z:=0} MakeVector3i<public>(InX:int, InY:int, InZ:int)<computes>:vector3i= vector3i{X:=InX, Y:=InY, Z:=InZ} operator'+'<public>(A:vector3i, B:vector3i)<computes>:vector3i= vector3i{X:=A.X + B.X, Y:=A.Y + B.Y, Z:=A.Z + B.Z} operator'-'<public>(A:vector3i, B:vector3i)<computes>:vector3i= vector3i{X:=A.X - B.X, Y:=A.Y - B.Y, Z:=A.Z - B.Z}
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.