ShockShapes/Geometry.cpp
int Geometry::addTriangle(Triangle t)
{
	int index = triangles.size();
	triangles.push_back(t);

	//Update the vertex reference counts
	vbuffer_references[t.vertices[0]]++;
	vbuffer_references[t.vertices[1]]++;
	vbuffer_references[t.vertices[2]]++;

	//Update the normal reference counts
	nbuffer_references[t.normals[0]]++;
	nbuffer_references[t.normals[1]]++;
	nbuffer_references[t.normals[2]]++;

	return index;
}
//Add a triangle to the buffer
Add a triangle to the buffer
Add a triangle to the buffer
int Geometry::addTriangle(Triangle t)
{
	int index = triangles.size();
	triangles.push_back(t);
	vbuffer_references[t.vertices[0]]++;
	vbuffer_references[t.vertices[1]]++;
	vbuffer_references[t.vertices[2]]++;
	nbuffer_references[t.normals[0]]++;
	nbuffer_references[t.normals[1]]++;
	nbuffer_references[t.normals[2]]++;
	return index;
}
int Geometry :: addTriangle ( Triangle t ) { int index = triangles . size ( ) ; triangles . push_back ( t ) ; vbuffer_references [ t . vertices [ 0 ] ] ++ ; vbuffer_references [ t . vertices [ 1 ] ] ++ ; vbuffer_references [ t . vertices [ 2 ] ] ++ ; nbuffer_references [ t . normals [ 0 ] ] ++ ; nbuffer_references [ t . normals [ 1 ] ] ++ ; nbuffer_references [ t . normals [ 2 ] ] ++ ; return index ; }
Add a triangle to the buffer
Add a triangle to the buffer
//Update the vertex reference counts //Update the normal reference counts