+++ /dev/null
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-\r
-using System;\r
-using System.Globalization;\r
-using System.Runtime.InteropServices;\r
-\r
-using SharpDX;\r
-\r
-namespace FDK {\r
- /// <summary>\r
- /// Represents a vertex with a position and a texture coordinate.\r
- /// </summary>\r
- [StructLayout(LayoutKind.Sequential)]\r
- public struct TexturedVertex : IEquatable<TexturedVertex> {\r
- /// <summary>\r
- /// Gets or sets the position of the vertex.\r
- /// </summary>\r
- public Vector3 Position {\r
- get;\r
- set;\r
- }\r
-\r
- /// <summary>\r
- /// Gets or sets the texture coordinate for the vertex.\r
- /// </summary>\r
- public Vector2 TextureCoordinate {\r
- get;\r
- set;\r
- }\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="TexturedVertex"/> struct.\r
- /// </summary>\r
- /// <param name="position">The position.</param>\r
- /// <param name="color">The color.</param>\r
- public TexturedVertex(Vector3 position, Vector2 textureCoordinate)\r
- : this() {\r
- Position = position;\r
- TextureCoordinate = textureCoordinate;\r
- }\r
-\r
- /// <summary>\r
- /// Implements operator ==.\r
- /// </summary>\r
- /// <param name="left">The left.</param>\r
- /// <param name="right">The right.</param>\r
- /// <returns>The result of the operator.</returns>\r
- public static bool operator ==(TexturedVertex left, TexturedVertex right) {\r
- return left.Equals(right);\r
- }\r
-\r
- /// <summary>\r
- /// Implements operator !=.\r
- /// </summary>\r
- /// <param name="left">The left side of the operator.</param>\r
- /// <param name="right">The right side of the operator.</param>\r
- /// <returns>The result of the operator.</returns>\r
- public static bool operator !=(TexturedVertex left, TexturedVertex right) {\r
- return !(left == right);\r
- }\r
-\r
- /// <summary>\r
- /// Returns the hash code for this instance.\r
- /// </summary>\r
- /// <returns>\r
- /// A 32-bit signed integer that is the hash code for this instance.\r
- /// </returns>\r
- public override int GetHashCode() {\r
- return Position.GetHashCode() + TextureCoordinate.GetHashCode();\r
- }\r
-\r
- /// <summary>\r
- /// Indicates whether this instance and a specified object are equal.\r
- /// </summary>\r
- /// <param name="obj">Another object to compare to.</param>\r
- /// <returns>\r
- /// true if <paramref name="obj"/> and this instance are the same type and represent the same value; otherwise, false.\r
- /// </returns>\r
- public override bool Equals(object obj) {\r
- if (obj == null)\r
- return false;\r
-\r
- if (GetType() != obj.GetType())\r
- return false;\r
-\r
- return Equals((TexturedVertex)obj);\r
- }\r
-\r
- /// <summary>\r
- /// Indicates whether the current object is equal to another object of the same type.\r
- /// </summary>\r
- /// <param name="other">An object to compare with this object.</param>\r
- /// <returns>\r
- /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.\r
- /// </returns>\r
- public bool Equals(TexturedVertex other) {\r
- return (Position == other.Position && TextureCoordinate == other.TextureCoordinate);\r
- }\r
- }\r
-}\r