diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-04-07 04:13:04 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-04-07 04:13:04 +0400 |
commit | 7bdb7331b586b5f4424a17d23275389673c18603 (patch) | |
tree | d072cc15cd23aa4bed73cd7fc65766fcbcbfbcb1 /source/gameengine/Ketsji | |
parent | ef57e50acfb5a3b4c4503a0b918497e31dd41124 (diff) |
BGE: KX_Camera.getScreenVect() was using glReadPixels to get a depth value, which was causing a sync event between the gpu and cpu. glReadPixels was always returning 0, so I removed it and set depth to be a constant 0.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index e56dbfdcac8..0cd06a7b6eb 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -1018,7 +1018,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenVect, vect[0] += viewport[0]; vect[1] += viewport[1]; - glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &vect[2]); + vect[2] = 0.f; + gluUnProject(vect[0], vect[1], vect[2], modelmatrix, projmatrix, viewport, &win[0], &win[1], &win[2]); campos = this->GetCameraLocation(); |