From 28ec1ca1883e0fe9b8b0e0de4049564ae652bd90 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Thu, 10 Dec 2015 15:58:05 +0000 Subject: Refactor picking to use one thread per entity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added triangle visitor by refactor the triangle volume extractor Added ability to do a ray intersection with a single volume without using a thread Added entity collector Use one thread for each entity Ignore entities that don’t have a pick object Removed list of triangle volumes stored on each entity Use triangle visitor to test each triangle by creating a single volume on the stack Added triangle and 3 vertex index to the pick event Change-Id: Id3fd53549bf3ea07805426ef868df174f30e176b Reviewed-by: Sean Harmer --- src/render/jobs/calcboundingvolumejob.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/render/jobs/calcboundingvolumejob.cpp') diff --git a/src/render/jobs/calcboundingvolumejob.cpp b/src/render/jobs/calcboundingvolumejob.cpp index feeb7c422..ccffe2c84 100644 --- a/src/render/jobs/calcboundingvolumejob.cpp +++ b/src/render/jobs/calcboundingvolumejob.cpp @@ -123,9 +123,11 @@ void calculateLocalBoundingVolume(NodeManagers *manager, Entity *node) const int stride = pickVolumeAttribute->byteStride() ? pickVolumeAttribute->byteStride() : sizeof(float) * pickVolumeAttribute->dataSize(); QVector vertices(pickVolumeAttribute->count()); + // TODO avoid copying the vertices for (int c = 0, vC = vertices.size(); c < vC; ++c) { QVector3D v; const float *fptr = reinterpret_cast(rawBuffer); + // TODO unwrap loop (switch?) for (uint i = 0, m = qMin(pickVolumeAttribute->dataSize(), 3U); i < m; ++i) v[i] = fptr[i]; vertices[c] = v; -- cgit v1.2.3