diff options
| author | Miles Macklin <[email protected]> | 2017-07-05 12:59:25 +1200 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2017-07-05 12:59:25 +1200 |
| commit | 7f669cec7c812a366eedaf0cdfe09d6a5bad84af (patch) | |
| tree | 5744216f9f88788c88f07a69ad11a43d232c95f9 /demo/helpers.h | |
| parent | 1.2.0.beta.1 (diff) | |
| download | flex-7f669cec7c812a366eedaf0cdfe09d6a5bad84af.tar.xz flex-7f669cec7c812a366eedaf0cdfe09d6a5bad84af.zip | |
Flex 1.2 (beta 2)
Diffstat (limited to 'demo/helpers.h')
| -rw-r--r-- | demo/helpers.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/demo/helpers.h b/demo/helpers.h index adc9af5..984883f 100644 --- a/demo/helpers.h +++ b/demo/helpers.h @@ -708,10 +708,15 @@ NvFlexTriangleMeshId CreateTriangleMesh(Mesh* m) Vec3 lower, upper; m->GetBounds(lower, upper); - NvFlexVector<Vec3> positions(g_flexLib); + NvFlexVector<Vec4> positions(g_flexLib, m->m_positions.size()); + positions.map(); NvFlexVector<int> indices(g_flexLib); - positions.assign((Vec3*)&m->m_positions[0], m->m_positions.size()); + for (int i = 0; i < int(m->m_positions.size()); ++i) + { + Vec3 vertex = Vec3(m->m_positions[i]); + positions[i] = Vec4(vertex, 0.0f); + } indices.assign((int*)&m->m_indices[0], m->m_indices.size()); positions.unmap(); |