Esempio n. 1
0
        public void AddTo(IMeshBuilder <TMaterial> meshBuilder, Matrix4x4 xform)
        {
            var x = Vector3.UnitX * _Size.X * 0.5f;
            var y = Vector3.UnitY * _Size.Y * 0.5f;
            var z = Vector3.UnitZ * _Size.Z * 0.5f;

            _AddCubeFace(meshBuilder.UsePrimitive(_Right), x, y, z, xform);
            _AddCubeFace(meshBuilder.UsePrimitive(_Left), -x, z, y, xform);

            _AddCubeFace(meshBuilder.UsePrimitive(_Top), y, z, x, xform);
            _AddCubeFace(meshBuilder.UsePrimitive(_Bottom), -y, x, z, xform);

            _AddCubeFace(meshBuilder.UsePrimitive(_Front), z, x, y, xform);
            _AddCubeFace(meshBuilder.UsePrimitive(_Back), -z, y, x, xform);
        }