Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
VertexPositionNormalTexture.cs
Go to the documentation of this file.
1using System;
4
6
9{
10 [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
12
13 [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
15
16 [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
18
19 [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
20 public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0), new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0), new VertexElement(24, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0))
21 {
22 Name = "VertexPositionNormalTexture.VertexDeclaration"
23 };
24
25 VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
26
27 public VertexPositionNormalTexture(Vector3 position, Vector3 normal, Vector2 textureCoordinate)
28 {
29 Position = position;
30 Normal = normal;
31 TextureCoordinate = textureCoordinate;
32 }
33
34 public override int GetHashCode()
35 {
36 return Helpers.SmartGetHashCode(this);
37 }
38
39 public override string ToString()
40 {
41 return string.Format(CultureInfo.CurrentCulture, "{{Position:{0} Normal:{1} TextureCoordinate:{2}}}", new object[3] { Position, Normal, TextureCoordinate });
42 }
43
45 {
46 if (left.Position == right.Position && left.Normal == right.Normal)
47 {
48 return left.TextureCoordinate == right.TextureCoordinate;
49 }
50 return false;
51 }
52
54 {
55 return !(left == right);
56 }
57
58 public override bool Equals(object obj)
59 {
60 if (obj == null)
61 {
62 return false;
63 }
64 if (obj.GetType() != GetType())
65 {
66 return false;
67 }
68 return this == (VertexPositionNormalTexture)obj;
69 }
70}
static unsafe int SmartGetHashCode(object obj)
Definition Helpers.cs:43
static CultureInfo CurrentCulture
VertexPositionNormalTexture(Vector3 position, Vector3 normal, Vector2 textureCoordinate)
static bool operator!=(VertexPositionNormalTexture left, VertexPositionNormalTexture right)
static bool operator==(VertexPositionNormalTexture left, VertexPositionNormalTexture right)