Finding Camera Documentation

If I do a search for “base.camera.” through all of the .py files in the P3D distribution I find all of the following methods being used:


getPos(...)
getHpr(...)
iPos(...)
getMat(...)
setFov(...)
setHpr(...)
setX(...)
setY(...)
setZ(...)
lookAt(...)
getNetTransform(...)

I want to be able to get a quaternion from the camera pointing vector (a rotation matrix would suffice) but I can’t seem to find documentation describing all of the camera methods. Can you help me by pointing me to the camera API documentation?

Also help me out here plz … Now that I see base and base.camera in the code, how would I go about finding what class they are associated with (e.g. what class is base and what class is base.camera)? If I knew that then I suppose I could easily find it in the dox. Pardon me for being dense here plz, I am a noob to P3D and Python.

Thx!

Camera class: http://www.panda3d.org/apiref.php?page=Camera

but if you look at the type of base.camera (or only ‘camera’ which is the same), you’ll realize it’s a NodePath (http://www.panda3d.org/apiref.php?page=NodePath).

>>> print base.camera
render/camera
>>> print camera     
render/camera
>>> type(base.camera)
<type 'libpanda.NodePath'>
>>> 

getting the quaternion from a NodePath is easy:


q = np.getQuat()

so for the camera you can do these things to get to the quaternion or matrix:

quat = camera.getQuat() # base.camera.getQuat() does work too
mat = camera.getMat()

hth,
kaweh