Skip to content

Commit

Permalink
UPBGE: Manage per eye projection and modelview camera setting.
Browse files Browse the repository at this point in the history
Previously there was no difference between the left and right eye when
updating the projection and modelview matrix into the camera, only the
value of these matrices was different.

To help futur work to compute all the camera matrices before rendering,
these matrices are stored in a little struct named View in KX_Camera.
This struct embed the projection and modelveiw matrix but also the frustum
and some flag about the validity of some values.

Because of this new organisation, the user can see in case of stereo the
two projection from python using camera.projectionMatrix[Left/Right].
  • Loading branch information
panzergame authored and youle31 committed May 26, 2019
1 parent 5cf021d commit 3da78e0
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 192 deletions.
20 changes: 20 additions & 0 deletions doc/python_api/rst/bge_types/bge.types.KX_Camera.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ base class --- :class:`KX_GameObject`

:type: 4x4 Matrix [[float]]

.. attribute:: projectionMatrixLeft

This camera's 4x4 left eye projection matrix.

.. note::

This is the identity matrix prior to rendering the first frame (any Python done on frame 1).

:type: 4x4 Matrix [[float]]

.. attribute:: projectionMatrixRight

This camera's 4x4 right eye projection matrix.

.. note::

This is the identity matrix prior to rendering the first frame (any Python done on frame 1).

:type: 4x4 Matrix [[float]]

.. attribute:: modelview_matrix

This camera's 4x4 model view matrix. (read-only).
Expand Down
Loading

0 comments on commit 3da78e0

Please sign in to comment.