diff options
author | Alex Sakhartchouk <alexst@google.com> | 2010-08-13 14:32:23 -0700 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2010-08-13 14:32:23 -0700 |
commit | a80145de0014aff9bdafe14601046ca511a2f90c (patch) | |
tree | fe7abc78a30c88c28fd0b866f19b4878a315e2b4 /libs/rs/rsScriptC_LibGL.cpp | |
parent | ff9ca9c2c53c994481323390991ff0e9fd14d06f (diff) |
Adding bounding box computation.
Change-Id: I682609312519d9474176556ade7a208c7d0a1323
Diffstat (limited to 'libs/rs/rsScriptC_LibGL.cpp')
-rw-r--r-- | libs/rs/rsScriptC_LibGL.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_LibGL.cpp b/libs/rs/rsScriptC_LibGL.cpp index f5e595340aff..4b8de765f927 100644 --- a/libs/rs/rsScriptC_LibGL.cpp +++ b/libs/rs/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 }, |