Browse Source

Made docs RST sources formatting bit saner.

Using comments, though I wonder if using "rubric" thing is the right way to organize.
alteredq 13 years ago
parent
commit
3920c5df0f

+ 6 - 0
docs/api/cameras/Camera.rst

@@ -1,7 +1,9 @@
 Camera - Abstract base class for cameras
 ----------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Camera()
 
@@ -10,7 +12,9 @@ Camera - Abstract base class for cameras
     Inherits from :class:`Object3D`
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Camera.matrixWorldInverse
 
@@ -26,7 +30,9 @@ Camera - Abstract base class for cameras
 
 
 
+.. ...............................................................................
 .. rubric:: Methods
+.. ...............................................................................
 
 .. function:: Camera.lookAt( vector )
 

+ 8 - 0
docs/api/cameras/OrthographicCamera.rst

@@ -1,7 +1,9 @@
 OrthographicCamera - Camera with orthographic projection
 ------------------------------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: OrthographicCamera( left, right, top, bottom, near, far )
 
@@ -19,7 +21,9 @@ OrthographicCamera - Camera with orthographic projection
     :param float far: far
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: OrthographicCamera.left
 
@@ -46,14 +50,18 @@ OrthographicCamera - Camera with orthographic projection
     Camera frustum far plane
 
 
+.. ...............................................................................
 .. rubric:: Method
+.. ...............................................................................
 
 .. function:: OrthographicCamera.updateProjectionMatrix()
 
     Updated camera's projection matrix. Must be called after change of parameters.
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 12 - 2
docs/api/cameras/PerspectiveCamera.rst

@@ -1,7 +1,9 @@
 PerspectiveCamera - Camera with perspective projection
 ---------------------------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: PerspectiveCamera( fov, aspect, near, far )
 
@@ -12,12 +14,14 @@ PerspectiveCamera - Camera with perspective projection
     Inherits from :class:`Object3D` :class:`Camera`
 
     :param float fov: field of view
-    :param float aspect: aspect
+    :param float aspect: aspect ratio
     :param float near: near
     :param float far: far
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: PerspectiveCamera.fov
 
@@ -25,7 +29,7 @@ PerspectiveCamera - Camera with perspective projection
 
 .. attribute:: PerspectiveCamera.aspect
 
-    Camera frustum aspect
+    Camera frustum aspect ratio
 
 .. attribute:: PerspectiveCamera.near
 
@@ -35,7 +39,9 @@ PerspectiveCamera - Camera with perspective projection
 
     Camera frustum far plane
 
+.. ...............................................................................
 .. rubric:: Multi-view attributes
+.. ...............................................................................
 
 .. attribute:: PerspectiveCamera.fullWidth
 .. attribute:: PerspectiveCamera.fullHeight
@@ -45,7 +51,9 @@ PerspectiveCamera - Camera with perspective projection
 .. attribute:: PerspectiveCamera.height
 
 
+.. ...............................................................................
 .. rubric:: Methods
+.. ...............................................................................
 
 .. function:: PerspectiveCamera.updateProjectionMatrix()
 
@@ -107,7 +115,9 @@ PerspectiveCamera - Camera with perspective projection
     :param float height: height of subcamera
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 8 - 0
docs/api/core/Color.rst

@@ -1,7 +1,9 @@
 Color - Represents a color
 --------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Color(hex)
 
@@ -10,7 +12,9 @@ Color - Represents a color
     :param integer hex: Hex value to intialize the color
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Color.r
 
@@ -25,7 +29,9 @@ Color - Represents a color
     Blue channel (float between 0 and 1)
 
 
+.. ...............................................................................
 .. rubric:: Methods
+.. ...............................................................................
 
 .. function:: Color.convertGammaToLinear()
 
@@ -104,7 +110,9 @@ Color - Represents a color
     :rtype: Color
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 8 - 2
docs/api/core/Face3.rst

@@ -1,7 +1,9 @@
 Face3 - Triangle face
 ------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Face3( a, b, c, normal, color, materialIndex )
 
@@ -17,7 +19,9 @@ Face3 - Triangle face
     :param integer materialIndex: material index
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Face3.a
 
@@ -35,7 +39,7 @@ Face3 - Triangle face
 
     Face normal
 
-    :class:`Vector3` - default ``(0,0,0)``
+    :class:`Vector3` - default ``( 0, 0, 0 )``
 
 .. attribute:: Face3.color
 
@@ -47,7 +51,7 @@ Face3 - Triangle face
 
     Face centroid
 
-    :class:`Vector3` - default ``(0,0,0)``
+    :class:`Vector3` - default ``( 0, 0, 0 )``
 
 .. attribute:: Face3.vertexNormals
 
@@ -73,7 +77,9 @@ Face3 - Triangle face
 
     default ``0``
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 6 - 0
docs/api/core/Face4.rst

@@ -1,7 +1,9 @@
 Face4 - Quad face
 ------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Face4( a, b, c, d, normal, color, materialIndex )
 
@@ -18,7 +20,9 @@ Face4 - Quad face
     :param integer materialIndex: material index
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Face4.a
 
@@ -77,7 +81,9 @@ Face4 - Quad face
     default ``0``
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 12 - 0
docs/api/core/Geometry.rst

@@ -1,7 +1,9 @@
 Geometry - Base class for geometries
 ----------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Geometry()
 
@@ -10,7 +12,9 @@ Geometry - Base class for geometries
     Encapsulates unique instances of vertex buffer objects in :class:`WebGLRenderer`
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Geometry.id
 
@@ -41,7 +45,9 @@ Geometry - Base class for geometries
     Face indices index into this array.
 
 
+.. ...............................................................................
 .. rubric:: Attribute buffers
+.. ...............................................................................
 
 .. attribute:: Geometry.faces
 
@@ -102,7 +108,9 @@ Geometry - Base class for geometries
     Array of skinning indices (:class:`Vector4`), matching number and order of vertices.
 
 
+.. ...............................................................................
 .. rubric:: Flags
+.. ...............................................................................
 
 .. attribute:: Geometry.hasTangents
 
@@ -119,7 +127,9 @@ Geometry - Base class for geometries
     ``default false``
 
 
+.. ...............................................................................
 .. rubric:: Methods
+.. ...............................................................................
 
 .. function:: Geometry.applyMatrix( matrix )
 
@@ -162,7 +172,9 @@ Geometry - Base class for geometries
     Checks for duplicate vertices using hashmap.
     Duplicated vertices are removed and faces' vertices are updated.
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 18 - 8
docs/api/core/Math.rst

@@ -1,32 +1,42 @@
 Math - Math utility functions
 -----------------------------
 
+.. ...............................................................................
 .. rubric:: Methods
+.. ...............................................................................
 
-.. function:: Math.clamp(x, a, b)
+.. function:: Math.clamp( x, a, b )
 
     Clamps the x to be between a and b
 
     :param float x: value to be clamped
-    :param float a: minimum value  
+    :param float a: minimum value
     :param float b: maximum value
     :returns: Clamped value
     :rtype: float
 
-.. function:: Math.clampBottom(x, a)
+.. function:: Math.clampBottom( x, a )
 
     Clamps the x to be larger than a
 
     :param float x: value to be clamped
-    :param float a: minimum value  
+    :param float a: minimum value
     :returns: Clamped value
     :rtype: float
 
-.. function:: Math.mapLinear(x, a1, a2, b1, b2)
+.. function:: Math.mapLinear( x, a1, a2, b1, b2 )
 
-//todo:description
- 
-.. function:: Math.random16() 
+    Linear mapping of x from range <a1, a2> to range <b1, b2>
+
+    :param float x: value to be mapped
+    :param float a1: minimum value for range A
+    :param float a2: maximum value for range A
+    :param float b1: minimum value for range B
+    :param float b2: maximum value for range B
+    :returns: mapped value
+    :rtype: float
+
+.. function:: Math.random16()
 
     Random float from <0, 1> with 16 bits of randomness
     (standard Math.random() creates repetitive patterns when applied over larger space)

+ 30 - 22
docs/api/core/Matrix4.rst

@@ -1,13 +1,17 @@
 Matrix4 - A 4x4 Matrix
 ----------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
-.. class:: Matrix4([ n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43,n44] )
+.. class:: Matrix4( [ n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43,n44 ] )
 
     A 4x4 Matrix
-    
+
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Matrix4.n11
 .. attribute:: Matrix4.n12
@@ -27,10 +31,12 @@ Matrix4 - A 4x4 Matrix
 .. attribute:: Matrix4.n44
 
 
+.. ...............................................................................
 .. rubric:: Methods
+.. ...............................................................................
 
 .. function:: Matrix4.set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43,n44)
-    
+
     Sets all fields of this matrix
 
 .. function:: Matrix4.identity()
@@ -50,7 +56,7 @@ Matrix4 - A 4x4 Matrix
     :param Vector3 eye: //todo
     :param Vector3 center: //todo
     :param Vector3 up: //todo
-    
+
 .. function:: Matrix4.multiply(a,b)
 
     //todo:description
@@ -65,15 +71,15 @@ Matrix4 - A 4x4 Matrix
     :param Matrix4 a: //todo
 
 .. function:: Matrix4.multiplyToArray(a,b,r)
-     
+
     //todo:description
-    
+
     :param Matrix4 a: //todo
     :param Matrix4 b: //todo
     :param array r: //todo
 
 .. function:: Matrix4.multiplyScalar(s)
-    
+
     //todo:description
 
     :param float  a: //todo
@@ -95,7 +101,7 @@ Matrix4 - A 4x4 Matrix
 .. function:: Matrix4.rotateAxis(v)
 
     //todo:description
-    
+
     :param Vector3 v: //todo
 
 .. function:: Matrix4.crossVector(a)
@@ -115,7 +121,7 @@ Matrix4 - A 4x4 Matrix
 .. function:: Matrix4.clone()
 
     Clones this matrix
-    
+
     :returns: New instance of this matrix
     :rtype: Matrix4
 
@@ -129,7 +135,7 @@ Matrix4 - A 4x4 Matrix
 
     :param array flat: //todo
     :rtype: array
-     
+
 .. function:: Matrix4.flattenToArrayOffset(flat,offset)
 
     //todo:description
@@ -202,13 +208,13 @@ Matrix4 - A 4x4 Matrix
 
     //todo:description
 
-    :param Matrix4 m: //todo   
+    :param Matrix4 m: //todo
 
 .. function:: Matrix4.setRotationFromEuler(v,order)
 
     //todo:description
 
-    :param Vector3 v: Vector3 with all the rotations  
+    :param Vector3 v: Vector3 with all the rotations
     :param string order: The order of rotations eg. 'XYZ'
 
 .. function:: Matrix4.setRotationFromQuaternion(q)
@@ -226,15 +232,15 @@ Matrix4 - A 4x4 Matrix
 .. function:: Matrix4.compose(translation, rotation, scale)
 
     //todo:description
-    
+
     :param Vector3 translation: //todo
     :param Quaternion rotation: //todo
     :param Vector3 scale: //todo
 
 .. function:: Matrix4.decompose(translation, rotation, scale)
-    
+
     //todo:description
-    
+
     :param Vector3 translation: //todo
     :param Quaternion rotation: //todo
     :param Vector3 scale: //todo
@@ -242,38 +248,38 @@ Matrix4 - A 4x4 Matrix
     :rtype: //todo
 
 .. function:: Matrix4.extractPosition(m)
-    
+
     //todo:description
 
     :param Matrix4 m:
 
 .. function:: Matrix4.extractRotation(m)
-  
+
     //todo:description
 
     :param Matrix4 m:
 
 .. function:: Matrix4.rotateByAxis(axis,angle)
-    
+
     //todo:description
 
     :param Vector3 axis: //todo:description
     :param float angle: //todo:description
 
 .. function:: Matrix4.rotateX(angle)
-    
+
     //todo:description
 
     :param float angle: //todo:description
 
 .. function:: Matrix4.rotateY(angle)
-    
+
     //todo:description
 
     :param float angle: //todo:description
 
 .. function:: Matrix4.rotateZ(angle)
-    
+
     //todo:description
 
     :param float angle: //todo:description
@@ -311,7 +317,9 @@ Matrix4 - A 4x4 Matrix
     :returns: //todo
     :rtype: Matrix4
 
-.. rubric:: Example(s)
+.. ...............................................................................
+.. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 15 - 3
docs/api/core/Object3D.rst

@@ -1,14 +1,26 @@
 Object3D - Base class for scene graph objects
 ---------------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Object3D()
 
     Base class for scene graph objects
-    
+
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
+
+.. attribute:: Object3D.id
+
+    Unique number of this object instance
 
-.. rubric:: Method
+.. ...............................................................................
+.. rubric:: Methods
+.. ...............................................................................
 
-.. rubric:: Example(s)
+.. ...............................................................................
+.. rubric:: Example
+.. ...............................................................................

+ 28 - 5
docs/api/core/UV.rst

@@ -1,14 +1,37 @@
-UV - Represents a texture coordinate
+UV - A texture coordinate
 ------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
-.. class:: UV()
+.. class:: UV( u, v )
 
-    Represents a texture coordinate
-    
+    A texture coordinate
+
+    :param float u: u coordinate
+    :param float v: v coordinate
+
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
+.. attribute:: UV.u
+.. attribute:: UV.v
+
+.. ...............................................................................
 .. rubric:: Method
+.. ...............................................................................
+
+.. function:: UV.set( u, v )
+.. function:: UV.copy( uv )
+.. function:: UV.clone( )
+
+
+.. ...............................................................................
+.. rubric:: Example
+.. ...............................................................................
+
+::
 
-.. rubric:: Example(s)
+    var uv = new THREE.UV( 0, 1 );

+ 6 - 0
docs/api/lights/AmbientLight.rst

@@ -1,7 +1,9 @@
 AmbientLight - An ambient light
 -------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: AmbientLight( hex )
 
@@ -14,7 +16,9 @@ AmbientLight - An ambient light
     :param integer hex: light color
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: AmbientLight.color
 
@@ -23,7 +27,9 @@ AmbientLight - An ambient light
     Material's ambient color gets multiplied by this color.
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 8 - 0
docs/api/lights/DirectionalLight.rst

@@ -1,7 +1,9 @@
 DirectionalLight - A directional light
 --------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: DirectionalLight( hex, intensity, distance )
 
@@ -18,7 +20,9 @@ DirectionalLight - A directional light
     :param float distance: distance affected by light
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: DirectionalLight.color
 
@@ -39,7 +43,9 @@ DirectionalLight - A directional light
     Modulating directional light by distance not implemented in :class:`WebGLRenderer`
 
 
+.. ...............................................................................
 .. rubric:: Shadow attributes
+.. ...............................................................................
 
 .. attribute:: DirectionalLight.castShadow
 
@@ -126,7 +132,9 @@ DirectionalLight - A directional light
     ``default 512``
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 4 - 0
docs/api/lights/Light.rst

@@ -1,7 +1,9 @@
 Light - Abstract base class for lights
 --------------------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: Light( hex )
 
@@ -12,7 +14,9 @@ Light - Abstract base class for lights
     :param integer hex: light color
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: Light.color
 

+ 6 - 0
docs/api/lights/PointLight.rst

@@ -1,7 +1,9 @@
 PointLight - A point light
 --------------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: PointLight( hex, intensity, distance )
 
@@ -18,7 +20,9 @@ PointLight - A point light
     :param float distance: distance affected by light
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: PointLight.color
 
@@ -39,7 +43,9 @@ PointLight - A point light
     If non-zero, light will attenuate linearly from maximum intensity at light ``position`` down to zero at ``distance``
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::
 

+ 8 - 0
docs/api/lights/SpotLight.rst

@@ -1,7 +1,9 @@
 SpotLight - A spotlight
 -----------------------
 
+.. ...............................................................................
 .. rubric:: Constructor
+.. ...............................................................................
 
 .. class:: SpotLight( hex, intensity, distance, castShadow )
 
@@ -20,7 +22,9 @@ SpotLight - A spotlight
 
 
 
+.. ...............................................................................
 .. rubric:: Attributes
+.. ...............................................................................
 
 .. attribute:: SpotLight.color
 
@@ -42,7 +46,9 @@ SpotLight - A spotlight
 
 
 
+.. ...............................................................................
 .. rubric:: Shadow attributes
+.. ...............................................................................
 
 .. attribute:: SpotLight.castShadow
 
@@ -111,7 +117,9 @@ SpotLight - A spotlight
     ``default 512``
 
 
+.. ...............................................................................
 .. rubric:: Example
+.. ...............................................................................
 
 ::