| | | 1 | | // <copyright file="ObjVertex.cs" company="Jérémy Ansel"> |
| | | 2 | | // Copyright (c) 2017, 2019 Jérémy Ansel |
| | | 3 | | // </copyright> |
| | | 4 | | // <license> |
| | | 5 | | // Licensed under the MIT license. See LICENSE.txt |
| | | 6 | | // </license> |
| | | 7 | | |
| | | 8 | | using Equatable.Attributes; |
| | | 9 | | |
| | | 10 | | namespace JeremyAnsel.Media.WavefrontObj; |
| | | 11 | | |
| | | 12 | | [System.Diagnostics.DebuggerDisplay("Vertex Position:{Position} Color:{Color}")] |
| | | 13 | | [Equatable] |
| | | 14 | | public partial struct ObjVertex |
| | | 15 | | { |
| | | 16 | | public ObjVertex(float x, float y, float z) |
| | | 17 | | { |
| | 4 | 18 | | Position = new ObjVector4(x, y, z, 1.0f); |
| | 4 | 19 | | Color = null; |
| | 4 | 20 | | } |
| | | 21 | | |
| | | 22 | | public ObjVertex(float x, float y, float z, float w) |
| | | 23 | | { |
| | 4 | 24 | | Position = new ObjVector4(x, y, z, w); |
| | 4 | 25 | | Color = null; |
| | 4 | 26 | | } |
| | | 27 | | |
| | | 28 | | public ObjVertex(float x, float y, float z, float r, float g, float b) |
| | | 29 | | { |
| | 4 | 30 | | Position = new ObjVector4(x, y, z, 1.0f); |
| | 4 | 31 | | Color = new ObjVector4(r, g, b, 1.0f); |
| | 4 | 32 | | } |
| | | 33 | | |
| | | 34 | | public ObjVertex(float x, float y, float z, float r, float g, float b, float a) |
| | | 35 | | { |
| | 4 | 36 | | Position = new ObjVector4(x, y, z, 1.0f); |
| | 4 | 37 | | Color = new ObjVector4(r, g, b, a); |
| | 4 | 38 | | } |
| | | 39 | | |
| | 4 | 40 | | public ObjVector4 Position { get; set; } |
| | | 41 | | |
| | 4 | 42 | | public ObjVector4? Color { get; set; } |
| | | 43 | | } |