couch/core/Ball.cpp

40 lines
1.2 KiB
C++
Raw Normal View History

2021-01-13 10:42:57 -06:00
#include "Ball.h"
Ball::Ball() {
2021-01-20 14:54:54 -06:00
IndexList indices;
VertexList vertices;
2021-01-13 16:47:16 -06:00
// It's a cube really
// Front
vertices.push_back(Vertex(1.0f, 1.0f, 1.0f, 0.0f, 1.0f));
vertices.push_back(Vertex(1.0f, -1.0f, 1.0f, 0.0f, 0.0f));
vertices.push_back(Vertex(-1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
vertices.push_back(Vertex(-1.0f, -1.0f, 1.0f, 1.0f, 0.0f));
2021-01-13 16:47:16 -06:00
// Back
vertices.push_back(Vertex(1.0f, 1.0f, -1.0f, 0.0f, 0.0f));
vertices.push_back(Vertex(1.0f, -1.0f, -1.0f, 0.0f, 1.0f));
vertices.push_back(Vertex(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f));
vertices.push_back(Vertex(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f));
2021-01-13 10:42:57 -06:00
2021-01-13 16:47:16 -06:00
//Front
2021-01-13 10:42:57 -06:00
indices.push_back(Index(0, 1, 2));
2021-01-13 13:17:31 -06:00
indices.push_back(Index(1, 2, 3));
2021-01-13 16:47:16 -06:00
//Back
indices.push_back(Index(4, 5, 6));
indices.push_back(Index(5, 6, 7));
// Top
indices.push_back(Index(0, 4, 6));
indices.push_back(Index(0, 2, 6));
// Bottom
indices.push_back(Index(1, 3, 7));
indices.push_back(Index(1, 5, 7));
// Left side
indices.push_back(Index(0, 1, 5));
indices.push_back(Index(0, 4, 5));
// Right side
indices.push_back(Index(2, 3, 7));
indices.push_back(Index(2, 6, 7));
2021-01-20 14:54:54 -06:00
submeshes.push_back(new SubMesh(vertices, indices));
2021-01-13 10:42:57 -06:00
}