MatrixLens

from panda3d.core import MatrixLens
class MatrixLens

Bases: Lens

A completely generic linear lens. This is provided for the benefit of low- level code that wants to specify a perspective or orthographic frustum via an explicit projection matrix, but not mess around with fov’s or focal lengths or any of that nonsense.

Inheritance diagram

Inheritance diagram of MatrixLens

__init__(*args, **kwargs)
clearLeftEyeMat()

C++ Interface: clear_left_eye_mat(const MatrixLens self)

/**
  • Removes the custom projection matrix set for the left eye, and uses the

  • center matrix (set by set_user_mat) instead.

*/

clearRightEyeMat()

C++ Interface: clear_right_eye_mat(const MatrixLens self)

/**
  • Removes the custom projection matrix set for the right eye, and uses the

  • center matrix (set by set_user_mat) instead.

*/

clear_left_eye_mat()

C++ Interface: clear_left_eye_mat(const MatrixLens self)

/**
  • Removes the custom projection matrix set for the left eye, and uses the

  • center matrix (set by set_user_mat) instead.

*/

clear_right_eye_mat()

C++ Interface: clear_right_eye_mat(const MatrixLens self)

/**
  • Removes the custom projection matrix set for the right eye, and uses the

  • center matrix (set by set_user_mat) instead.

*/

getClassType()

C++ Interface: get_class_type()

getLeftEyeMat()

C++ Interface: get_left_eye_mat(MatrixLens self)

/**
  • Returns the custom projection matrix for the left eye, if any, or the

  • center matrix if there is no custom matrix set for the left eye.

*/

getRightEyeMat()

C++ Interface: get_right_eye_mat(MatrixLens self)

/**
  • Returns the custom projection matrix for the right eye, if any, or the

  • center matrix if there is no custom matrix set for the right eye.

*/

getUserMat()

C++ Interface: get_user_mat(MatrixLens self)

/**
  • Returns the explicit projection matrix as set by the user. This does not

  • include transforms on the lens or film (e.g. a film offset or view hpr).

*/

get_class_type()

C++ Interface: get_class_type()

get_left_eye_mat()

C++ Interface: get_left_eye_mat(MatrixLens self)

/**
  • Returns the custom projection matrix for the left eye, if any, or the

  • center matrix if there is no custom matrix set for the left eye.

*/

get_right_eye_mat()

C++ Interface: get_right_eye_mat(MatrixLens self)

/**
  • Returns the custom projection matrix for the right eye, if any, or the

  • center matrix if there is no custom matrix set for the right eye.

*/

get_user_mat()

C++ Interface: get_user_mat(MatrixLens self)

/**
  • Returns the explicit projection matrix as set by the user. This does not

  • include transforms on the lens or film (e.g. a film offset or view hpr).

*/

hasLeftEyeMat()

C++ Interface: has_left_eye_mat(MatrixLens self)

/**
  • Returns true if the camera has a custom projection matrix set for the left

  • eye, or false if the center matrix (set by set_user_mat) will be used for

  • the left eye.

*/

hasRightEyeMat()

C++ Interface: has_right_eye_mat(MatrixLens self)

/**
  • Returns true if the camera has a custom projection matrix set for the right

  • eye, or false if the center matrix (set by set_user_mat) will be used for

  • the right eye.

*/

has_left_eye_mat()

C++ Interface: has_left_eye_mat(MatrixLens self)

/**
  • Returns true if the camera has a custom projection matrix set for the left

  • eye, or false if the center matrix (set by set_user_mat) will be used for

  • the left eye.

*/

has_right_eye_mat()

C++ Interface: has_right_eye_mat(MatrixLens self)

/**
  • Returns true if the camera has a custom projection matrix set for the right

  • eye, or false if the center matrix (set by set_user_mat) will be used for

  • the right eye.

*/

setLeftEyeMat()

C++ Interface: set_left_eye_mat(const MatrixLens self, const LMatrix4f user_mat)

/**
  • Sets a custom projection matrix for the left eye. This is only used if the

  • lens is attached to a stereo camera, in which case the left eye matrix will

  • be used to draw the scene in the left eye (but the center matrix–the

  • user_mat–will still be used to cull the scene).

  • This matrix should not be too different from the center matrix (set by

  • set_user_mat()) or culling errors may become obvious.

*/

setRightEyeMat()

C++ Interface: set_right_eye_mat(const MatrixLens self, const LMatrix4f user_mat)

/**
  • Sets a custom projection matrix for the right eye. This is only used if

  • the lens is attached to a stereo camera, in which case the right eye matrix

  • will be used to draw the scene in the right eye (but the center matrix–the

  • user_mat–will still be used to cull the scene).

  • This matrix should not be too different from the center matrix (set by

  • set_user_mat()) or culling errors may become obvious.

*/

setUserMat()

C++ Interface: set_user_mat(const MatrixLens self, const LMatrix4f user_mat)

/**
  • Explicitly specifies the projection matrix. This matrix should convert X

  • and Y to the range [-film_size/2, film_size/2], where (-fs/2,-fs/2) is the

  • lower left corner of the screen and (fs/2, fs/2) is the upper right. Z

  • should go to the range [-1, 1], where -1 is the near plane and 1 is the far

  • plane. Note that this is a left-handed Y-up coordinate system.

  • The default film_size for a MatrixLens is 2, so the default range is [-1,

  • 1] for both X and Y. This is consistent with the GL conventions for

  • projection matrices.

*/

set_left_eye_mat()

C++ Interface: set_left_eye_mat(const MatrixLens self, const LMatrix4f user_mat)

/**
  • Sets a custom projection matrix for the left eye. This is only used if the

  • lens is attached to a stereo camera, in which case the left eye matrix will

  • be used to draw the scene in the left eye (but the center matrix–the

  • user_mat–will still be used to cull the scene).

  • This matrix should not be too different from the center matrix (set by

  • set_user_mat()) or culling errors may become obvious.

*/

set_right_eye_mat()

C++ Interface: set_right_eye_mat(const MatrixLens self, const LMatrix4f user_mat)

/**
  • Sets a custom projection matrix for the right eye. This is only used if

  • the lens is attached to a stereo camera, in which case the right eye matrix

  • will be used to draw the scene in the right eye (but the center matrix–the

  • user_mat–will still be used to cull the scene).

  • This matrix should not be too different from the center matrix (set by

  • set_user_mat()) or culling errors may become obvious.

*/

set_user_mat()

C++ Interface: set_user_mat(const MatrixLens self, const LMatrix4f user_mat)

/**
  • Explicitly specifies the projection matrix. This matrix should convert X

  • and Y to the range [-film_size/2, film_size/2], where (-fs/2,-fs/2) is the

  • lower left corner of the screen and (fs/2, fs/2) is the upper right. Z

  • should go to the range [-1, 1], where -1 is the near plane and 1 is the far

  • plane. Note that this is a left-handed Y-up coordinate system.

  • The default film_size for a MatrixLens is 2, so the default range is [-1,

  • 1] for both X and Y. This is consistent with the GL conventions for

  • projection matrices.

*/

user_mat