<commit_before>#ifndef __ASYNC_VBO_TRANSFERS_CUBE_GEN_H__
#define __ASYNC_VBO_TRANSFERS_CUBE_GEN_H__
#include <glm/glm.hpp>
#include <glm/ext.hpp>

#define CUBE_FACE_COUNT			6


typedef unsigned short ushort;
typedef unsigned int uint32;

namespace gen_cube_name{

struct vert{
	glm::vec3 pos;
	glm::vec3 norm;
	glm::vec2 uv;
};

struct triangle_pair_vert_indices{
	ushort t1_i1;
	ushort t1_i2;
	ushort t1_i3;
	ushort t2_i1;
	ushort t2_i2;
	ushort t2_i3;
};


const glm::vec3 v1(-1.0f, -1.0f, 1.0f);
const glm::vec3 v2(1.0f, -1.0f, 1.0f);
const glm::vec3 v3(1.0f, 1.0f, 1.0f);
const glm::vec3 v4(-1.0f, 1.0f, 1.0f);

const glm::vec3 v5(-1.0f, -1.0f, -1.0f);
const glm::vec3 v6(1.0f, -1.0f, -1.0f);
const glm::vec3 v7(1.0f, 1.0f, -1.0f);
const glm::vec3 v8(-1.0f, 1.0f, -1.0f);

const glm::vec3& near_v1 = v1;
const glm::vec3& near_v2 = v2;
const glm::vec3& near_v3 = v3;
const glm::vec3& near_v4 = v4;

const glm::vec3& right_v1 = v2;
const glm::vec3& right_v2 = v6;
const glm::vec3& right_v3 = v7;
const glm::vec3& right_v4 = v3;

const glm::vec3& far_v1 = v6;
const glm::vec3& far_v2 = v5;
const glm::vec3& far_v3 = v8;
const glm::vec3& far_v4 = v7;

const glm::vec3& left_v1 = v5;
const glm::vec3& left_v2 = v1;
const glm::vec3& left_v3 = v4;
const glm::vec3& left_v4 = v8;

const glm::vec3& bottom_v1 = v1;
const glm::vec3& bottom_v2 = v2;
const glm::vec3& bottom_v3 = v6;
const glm::vec3& bottom_v4 = v5;

const glm::vec3& top_v1 = v7;
const glm::vec3& top_v2 = v8;
const glm::vec3& top_v3 = v4;
const glm::vec3& top_v4 = v3;

const glm::vec3 normals[6] = { glm::vec3(0.0, 0.0, 1.0), glm::vec3(1.0, 0.0, 0.0), glm::vec3(0.0, 0.0, -1.0), glm::vec3(-1.0, 0.0, 0.0), glm::vec3(0.0, 1.0, 0.0), glm::vec3(0.0, -1.0, 0.0) };
};

void get_face_and_vert_count_for_tess_level(uint32 tess_level, uint32 & element_count, uint32 & vert_count) {
	vert_count = (1 << tess_level) + 1; // vert per edge
	element_count = (((vert_count - 1) * (vert_count - 1)) << 1) * CUBE_FACE_COUNT * 3;
	vert_count *= vert_count*CUBE_FACE_COUNT;
}

void gen_cube( uint32 tess_level, float * vert_data, ushort * index_array ){ 
	uint32 vertices_count_per_edge = (1 << tess_level) + 1;;
	uint32 vertices_count_per_face = vertices_count_per_edge * vertices_count_per_edge;<commit_msg>bottom ccw<commit_after>#ifndef __ASYNC_VBO_TRANSFERS_CUBE_GEN_H__
#define __ASYNC_VBO_TRANSFERS_CUBE_GEN_H__
#include <glm/glm.hpp>
#include <glm/ext.hpp>

#define CUBE_FACE_COUNT			6


typedef unsigned short ushort;
typedef unsigned int uint32;

namespace gen_cube_name{

struct vert{
	glm::vec3 pos;
	glm::vec3 norm;
	glm::vec2 uv;
};

struct triangle_pair_vert_indices{
	ushort t1_i1;
	ushort t1_i2;
	ushort t1_i3;
	ushort t2_i1;
	ushort t2_i2;
	ushort t2_i3;
};


const glm::vec3 v1(-1.0f, -1.0f, 1.0f);
const glm::vec3 v2(1.0f, -1.0f, 1.0f);
const glm::vec3 v3(1.0f, 1.0f, 1.0f);
const glm::vec3 v4(-1.0f, 1.0f, 1.0f);

const glm::vec3 v5(-1.0f, -1.0f, -1.0f);
const glm::vec3 v6(1.0f, -1.0f, -1.0f);
const glm::vec3 v7(1.0f, 1.0f, -1.0f);
const glm::vec3 v8(-1.0f, 1.0f, -1.0f);

const glm::vec3& near_v1 = v1;
const glm::vec3& near_v2 = v2;
const glm::vec3& near_v3 = v3;
const glm::vec3& near_v4 = v4;

const glm::vec3& right_v1 = v2;
const glm::vec3& right_v2 = v6;
const glm::vec3& right_v3 = v7;
const glm::vec3& right_v4 = v3;

const glm::vec3& far_v1 = v6;
const glm::vec3& far_v2 = v5;
const glm::vec3& far_v3 = v8;
const glm::vec3& far_v4 = v7;

const glm::vec3& left_v1 = v5;
const glm::vec3& left_v2 = v1;
const glm::vec3& left_v3 = v4;
const glm::vec3& left_v4 = v8;

const glm::vec3& bottom_v1 = v2;
const glm::vec3& bottom_v2 = v1;
const glm::vec3& bottom_v3 = v5;
const glm::vec3& bottom_v4 = v6;

const glm::vec3& top_v1 = v7;
const glm::vec3& top_v2 = v8;
const glm::vec3& top_v3 = v4;
const glm::vec3& top_v4 = v3;

const glm::vec3 normals[6] = { glm::vec3(0.0, 0.0, 1.0), glm::vec3(1.0, 0.0, 0.0), glm::vec3(0.0, 0.0, -1.0), glm::vec3(-1.0, 0.0, 0.0), glm::vec3(0.0, 1.0, 0.0), glm::vec3(0.0, -1.0, 0.0) };
};

void get_face_and_vert_count_for_tess_level(uint32 tess_level, uint32 & element_count, uint32 & vert_count) {
	vert_count = (1 << tess_level) + 1; // vert per edge
	element_count = (((vert_count - 1) * (vert_count - 1)) << 1) * CUBE_FACE_COUNT * 3;
	vert_count *= vert_count*CUBE_FACE_COUNT;
}

void gen_cube( uint32 tess_level, float * vert_data, ushort * index_array ){ 
	uint32 vertices_count_per_edge = (1 << tess_level) + 1;;
	uint32 vertices_count_per_face = vertices_count_per_edge * vertices_count_per_edge;
{'fraction_non_alphanumeric': 0.1686265808741957, 'fraction_numerical': 0.0967384069225649, 'mean_word_length': 4.706329113924051, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4960569', 'n_tokens_mistral': 2381, 'n_tokens_neox': 2289, 'n_words': 482}