diff options
author | Alex Sakhartchouk <alexst@google.com> | 2010-08-13 14:39:01 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-13 14:39:01 -0700 |
commit | 991f8f33ca47a7555eeae17e3de39a28b4360863 (patch) | |
tree | f2650aaaa9ffc19c61a09d2facdc5f89db527885 /rsScriptC_LibGL.cpp | |
parent | 40dbbf0c522e3788b7c71da714362877b7175d7e (diff) | |
parent | ba4aa5c768a498bc3fbb8cb5547b7a9ad6f4b771 (diff) | |
download | rs-991f8f33ca47a7555eeae17e3de39a28b4360863.tar.gz |
Merge "Adding bounding box computation."
Diffstat (limited to 'rsScriptC_LibGL.cpp')
-rw-r--r-- | rsScriptC_LibGL.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rsScriptC_LibGL.cpp b/rsScriptC_LibGL.cpp index f5e59534..4b8de765 100644 --- a/rsScriptC_LibGL.cpp +++ b/rsScriptC_LibGL.cpp @@ -251,6 +251,20 @@ static void SC_drawMeshPrimitiveRange(RsMesh vsm, uint32_t primIndex, uint32_t s sm->renderPrimitiveRange(rsc, primIndex, start, len); } +static void SC_meshComputeBoundingBox(RsMesh vsm, float *minX, float *minY, float *minZ, + float *maxX, float *maxY, float *maxZ) +{ + GET_TLS(); + Mesh *sm = static_cast<Mesh *>(vsm); + sm->computeBBox(); + *minX = sm->mBBoxMin[0]; + *minY = sm->mBBoxMin[1]; + *minZ = sm->mBBoxMin[2]; + *maxX = sm->mBBoxMax[0]; + *maxY = sm->mBBoxMax[1]; + *maxZ = sm->mBBoxMax[2]; +} + ////////////////////////////////////////////////////////////////////////////// // @@ -390,6 +404,7 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_drawMesh }, { "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_drawMeshPrimitive }, { "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_drawMeshPrimitiveRange }, + { "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_meshComputeBoundingBox }, { "_Z13rsgClearColorffff", (void *)&SC_ClearColor }, { "_Z13rsgClearDepthf", (void *)&SC_ClearDepth }, |