3 using SiliconStudio.Core.Mathematics;
5 namespace SiliconStudio.
Paradox.Graphics
7 public partial class GeometricMultiTexcoordPrimitive
14 private const int CubeFaceCount = 6;
16 private static readonly
Vector3[] faceNormals =
26 private static readonly
Vector2[] textureCoordinates =
53 public static GeometricMeshData<VertexPositionNormalTangentMultiTexture>
New(
float size = 1.0f,
bool toLeftHanded =
false)
56 var indices =
new int[CubeFaceCount * 6];
63 for (
int i = 0; i < CubeFaceCount; i++)
65 Vector3 normal = faceNormals[i];
74 Vector3.Cross(ref normal, ref side1, out side2);
78 indices[indexCount++] = (vbase + 0);
79 indices[indexCount++] = (vbase + 1);
80 indices[indexCount++] = (vbase + 2);
82 indices[indexCount++] = (vbase + 0);
83 indices[indexCount++] = (vbase + 2);
84 indices[indexCount++] = (vbase + 3);
94 return new GeometricMeshData<VertexPositionNormalTangentMultiTexture>(vertices, indices, toLeftHanded) { Name =
"Cube" };
static void Cross(ref Vector3 left, ref Vector3 right, out Vector3 result)
Calculates the cross product of two vectors.
SiliconStudio.Paradox.Games.Mathematics.Vector2 Vector2
Represents a two dimensional mathematical vector.
A geometric primitive. Use Sphere to learn how to use it.
Describes a custom vertex format structure that contains position, color and 10 texture coordinates i...
static GeometricMeshData< VertexPositionNormalTangentMultiTexture > New(float size=1.0f, bool toLeftHanded=false)
Creates a cube with six faces each one pointing in a different direction.
Represents a three dimensional mathematical vector.
static readonly Vector3 UnitZ
The Z unit SiliconStudio.Core.Mathematics.Vector3 (0, 0, 1).
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Represents a four dimensional mathematical vector.
A cube has six faces, each one pointing in a different direction.
static readonly Vector3 UnitY
The Y unit SiliconStudio.Core.Mathematics.Vector3 (0, 1, 0).
static GeometricMultiTexcoordPrimitive New(GraphicsDevice device, float size=1.0f, bool toLeftHanded=false)
Creates a cube with six faces each one pointing in a different direction.
SiliconStudio.Core.Mathematics.Vector3 Vector3
_In_ size_t _In_ size_t size