Add Rect "model"

This commit is contained in:
Eryn Wells 2018-10-13 22:28:47 -07:00
parent f77eef76eb
commit 4cc2b315a1
2 changed files with 33 additions and 0 deletions

25
MetaballsKit/Rect.swift Normal file
View file

@ -0,0 +1,25 @@
//
// Square.swift
// Metaballs
//
// Created by Eryn Wells on 10/13/18.
// Copyright © 2018 Eryn Wells. All rights reserved.
//
import Foundation
/// A simple rectangle made of two triangles
struct Rect {
static var geometry: [Vertex] {
return [
Vertex(position: Float2(x: 1, y: 1), textureCoordinate: Float2(x: 1, y: 1)),
Vertex(position: Float2(x: 0, y: 1), textureCoordinate: Float2(x: 0, y: 1)),
Vertex(position: Float2(x: 0, y: 0), textureCoordinate: Float2(x: 0, y: 0)),
Vertex(position: Float2(x: 1, y: 1), textureCoordinate: Float2(x: 1, y: 1)),
Vertex(position: Float2(x: 0, y: 0), textureCoordinate: Float2(x: 0, y: 0)),
Vertex(position: Float2(x: 1, y: 0), textureCoordinate: Float2(x: 1, y: 0)),
]
}
var transform: Matrix3x3
}