/** @file
* Original ReactPhysics3D C++ library by Daniel Chappuis This code is re-licensed with permission from ReactPhysics3D author.
* @author Daniel CHAPPUIS
* @author Edouard DUPIN
* @copyright 2010-2016, Daniel Chappuis
* @copyright 2017, Edouard DUPIN
* @license MPL v2.0 (see license file)
*/
#include
ephysics::TriangleVertexArray::TriangleVertexArray( Vector vertices, Vector triangles):
this.vertices(vertices),
this.triangles(triangles) {
}
long ephysics::TriangleVertexArray::getNbVertices() {
return this.vertices.size();
}
long ephysics::TriangleVertexArray::getNbTriangles() {
return this.triangles.size()/3;
}
Vector ephysics::TriangleVertexArray::getVertices() {
return this.vertices;
}
Vector ephysics::TriangleVertexArray::getIndices() {
return this.triangles;
}
ephysics::Triangle ephysics::TriangleVertexArray::getTriangle(int id) {
ephysics::Triangle out;
out[0] = this.vertices[this.triangles[id*3]];
out[1] = this.vertices[this.triangles[id*3+1]];
out[2] = this.vertices[this.triangles[id*3+2]];
return out;
}