Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

System memory copy of vertices/mesh

$
0
0
I needed a system memory copy of the vertices for AABB Collision so I can update there min/max because I only have static vertices access. How can I do this. Im in directx 11. c++. As my object translates, I need to calculale the new AABB min/max and I cant get to the vertices. void IvAABB::Set( const IvPoint3* points, unsigned int numPoints) { ASSERT( points); // compute minimal and maximal bounds mMinima.Set(points[0]); mMaxima.Set(points[0]); for (unsigned int i = 1; i < numPoints; ++i) { if (points[i].x < mMinima.x) mMinima.x = points[i].x; else if (points[i].x > mMaxima.x) mMaxima.x = points[i].x; if (points[i].y < mMinima.y) mMinima.y = points[i].y; else if (points[i].y > mMaxima.y) mMaxima.y = points[i].y; if (points[i].z < mMinima.z) mMinima.z = points[i].z; else if (points[i].z > mMaxima.z) mMaxima.z = points[i].z; } }

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>