final MeshEmitter emitter = (MeshEmitter) getParticleEmitter();
final Mesh mesh = emitter.getSource();
// Update the triangle model on each new particle creation.
final Vector3[] vertices = new Vector3[3];
final MeshData mData = mesh.getMeshData();
for (int x = 0; x < 3; x++) {
vertices[x] = new Vector3();
final int vertIndex = mData.getVertexIndex(index, x, 0);
BufferUtils.populateFromBuffer(vertices[x], mData.getVertexBuffer(), mData.getIndices() != null ? mData
.getIndices().get(vertIndex) : vertIndex);
}
Triangle t = p.getTriangleModel();
if (t == null) {
t = new Triangle(vertices[0], vertices[1], vertices[2]);