@@ -41,14 +41,6 @@ class CameraData:
4141 """Stores position, orientation, and zoom for a camera.
4242
4343 This is like where a camera is placed in 3D space.
44-
45- Attributes:
46- position: A 3D vector which describes where the camera is located.
47- up: A 3D vector which describes which direction is up (+y).
48- forward: a 3D vector which describes which direction is forwards (+z).
49- zoom: A scaler that records the zoom of the camera. While this most often affects the projection matrix
50- it allows camera controllers access to the zoom functionality
51- without interacting with the projection data.
5244 """
5345
5446 __slots__ = ("position" , "up" , "forward" , "zoom" )
@@ -59,9 +51,15 @@ def __init__(self,
5951 forward : Point3 = (0.0 , 0.0 , - 1.0 ),
6052 zoom : float = 1.0 ):
6153
62- # View matrix data
54+ #: A 3D vector which describes where the camera is located.
6355 self .position : Tuple [float , float , float ] = position
56+ #: A 3D vector which describes which direction is up (+y).
6457 self .up : Tuple [float , float , float ] = up
58+ #: A scalar which describes which direction the camera is pointing.
59+ #:
60+ #: While this affects the projection matrix, it also allows camera
61+ #: controllers to access zoom functionality without interacting with
62+ #: projection data.
6563 self .forward : Tuple [float , float , float ] = forward
6664
6765 # Zoom
@@ -104,15 +102,6 @@ class OrthographicProjectionData:
104102 This is by default a Left-handed system. with the X axis going from left to right, The Y axis going from
105103 bottom to top, and the Z axis going from towards the screen to away from the screen. This can be made
106104 right-handed by making the near value greater than the far value.
107-
108- Attributes:
109- left: The left most value, which gets mapped to x = -1.0 (anything below this value is not visible).
110- right: The right most value, which gets mapped to x = 1.0 (anything above this value is not visible).
111- bottom: The bottom most value, which gets mapped to y = -1.0 (anything below this value is not visible).
112- top: The top most value, which gets mapped to y = 1.0 (anything above this value is not visible).
113- near: The 'closest' value, which gets mapped to z = -1.0 (anything below this value is not visible).
114- far: The 'furthest' value, Which gets mapped to z = 1.0 (anything above this value is not visible).
115- viewport: The pixel bounds which will be drawn onto. (left, bottom, width, height)
116105 """
117106
118107 __slots__ = ("rect" , "near" , "far" )
@@ -129,11 +118,23 @@ def __init__(
129118
130119 # Data for generating Orthographic Projection matrix
131120 self .rect : Rect = LRBT (left , right , bottom , top )
121+ #: The 'closest' visible position along the forward direction.
122+ #:
123+ #: It will get mapped to z = -1.0. Anything closer than this value
124+ #: is not visible.
132125 self .near : float = near
126+ #: The 'farthest' visible position along the forward direction.
127+ #:
128+ #: It will get mapped to z = 1.0. Anything father than this value
129+ #: is not visible.
133130 self .far : float = far
134131
135132 @property
136133 def left (self ) -> float :
134+ """"The left-side cutoff value, which gets mapped to x = -1.0.
135+
136+ Anything to the left of this value is not visible.
137+ """
137138 return self .rect .left
138139
139140 @left .setter
@@ -153,6 +154,10 @@ def left(self, new_left: AsFloat):
153154
154155 @property
155156 def right (self ) -> float :
157+ """"The right-side cutoff value, which gets mapped to x = 1.0.
158+
159+ Anything to the left of this value is not visible.
160+ """
156161 return self .rect .right
157162
158163 @right .setter
@@ -172,6 +177,10 @@ def right(self, new_right: AsFloat):
172177
173178 @property
174179 def bottom (self ) -> float :
180+ """"The bottom-side cutoff value, which gets mapped to -y = 1.0.
181+
182+ Anything to the left of this value is not visible.
183+ """
175184 return self .rect .bottom
176185
177186 @bottom .setter
@@ -191,6 +200,10 @@ def bottom(self, new_bottom: AsFloat):
191200
192201 @property
193202 def top (self ) -> float :
203+ """"The top-side cutoff value, which gets mapped to y = 1.0.
204+
205+ Anything to the left of this value is not visible.
206+ """
194207 return self .rect .top
195208
196209 @top .setter
@@ -239,14 +252,7 @@ def orthographic_from_rect(rect: Rect, near: float, far: float) -> OrthographicP
239252
240253class PerspectiveProjectionData :
241254 """Describes a perspective projection.
242-
243- Attributes:
244- aspect: The aspect ratio of the screen (width over height).
245- fov: The field of view in degrees. With the aspect ratio defines
246- the size of the projection at any given depth.
247- near: The 'closest' value, which gets mapped to z = -1.0 (anything below this value is not visible).
248- far: The 'furthest' value, Which gets mapped to z = 1.0 (anything above this value is not visible).
249- viewport: The pixel bounds which will be drawn onto. (left, bottom, width, height)
255+ )
250256 """
251257 __slots__ = ("aspect" , "fov" , "near" , "far" )
252258
@@ -255,10 +261,22 @@ def __init__(self,
255261 fov : float ,
256262 near : float ,
257263 far : float ):
258- # Data for generating Perspective Projection matrix
264+ #: The aspect ratio of the screen (width over height).
259265 self .aspect : float = aspect
266+ #: The field of view in degrees.
267+ #:
268+ #: Together with the aspect ratio, it defines the size of the
269+ #: perspective projection for any given depth.
260270 self .fov : float = fov
271+ #: The 'closest' visible position along the forward direction.
272+ #:
273+ #: It will get mapped to z = -1.0. Anything closer than this value
274+ #: is not visible.
261275 self .near : float = near
276+ #: The 'farthest' visible position along the forward direction.
277+ #:
278+ #: It will get mapped to z = 1.0. Anything father than this value
279+ #: is not visible.
262280 self .far : float = far
263281
264282 def __str__ (self ):
0 commit comments