Ejemplo n.º 1
0
 void RenderQuad(MeshContext context, Vector3 position, Vector3 normal)
 {
     foreach (var point in GetQuadVertices(normal))
     {
         context.AddVertex(position + point);
     }
 }
Ejemplo n.º 2
0
    void AddPoints(Vector3 position, List <Vector3> points, Voxel voxel, MeshContext context)
    {
        var rotation = Quaternion.AngleAxis(GetRotationDegress(voxel.Rotation), Vector3.up);

        if (voxel.IsUpsideDown)
        {
            for (var i = points.Count - 1; i >= 0; i--)
            {
                var point = points[i];
                var p2    = new Vector3(point.x, -point.y, point.z);
                context.AddVertex(position + (rotation * p2));
            }
        }
        else
        {
            foreach (var point in points)
            {
                context.AddVertex(position + (rotation * point));
            }
        }
    }