Browse Source

Docs: Matrix4 and Object3D.

Mr.doob 13 years ago
parent
commit
b598dd7b67

+ 1 - 1
docs/api/core/Geometry.html

@@ -112,7 +112,7 @@ True if geometry has tangents. Set in [page:Geometry Geometry.computeTangents].
 
 
 <h3>.[page:Boolean dynamic]</h3>
 <h3>.[page:Boolean dynamic]</h3>
 <div>
 <div>
-Set to <strong>true</strong> if attribute buffers will need to change in runtime (using "dirty" flags).<br/>
+Set to *true* if attribute buffers will need to change in runtime (using "dirty" flags).<br/>
 Unless set to true internal typed arrays corresponding to buffers will be deleted once sent to GPU.
 Unless set to true internal typed arrays corresponding to buffers will be deleted once sent to GPU.
 </div>
 </div>
 
 

+ 6 - 6
docs/api/core/Math.html

@@ -12,7 +12,7 @@ a — Minimum value<br />
 b — Maximum value.
 b — Maximum value.
 </div>
 </div>
 <div>
 <div>
-Clamps the <strong>x</strong> to be between <strong>a</strong> and <strong>b</strong>.
+Clamps the *x* to be between *a* and *b*.
 </div>
 </div>
 
 
 <h3>.clampBottom( [page:Float x], [page:Float a] ) [page:Float]</h3>
 <h3>.clampBottom( [page:Float x], [page:Float a] ) [page:Float]</h3>
@@ -21,7 +21,7 @@ x — Value to be clamped.<br />
 a — Minimum value
 a — Minimum value
 </div>
 </div>
 <div>
 <div>
-Clamps the <strong>x</strong> to be larger than <strong>a</strong>.
+Clamps the *x* to be larger than *a*.
 </div>
 </div>
 
 
 <h3>.mapLinear( [page:Float x], [page:Float a] ) [page:Float]</h3>
 <h3>.mapLinear( [page:Float x], [page:Float a] ) [page:Float]</h3>
@@ -33,7 +33,7 @@ b1 — Minimum value for range B.<br />
 b2 — Maximum value for range B.
 b2 — Maximum value for range B.
 </div>
 </div>
 <div>
 <div>
-Linear mapping of <strong>x</strong> from range [<strong>a1</strong>, <strong>a2</strong>] to range [<strong>b1</strong>, <strong>b2</strong>].
+Linear mapping of *x* from range [*a1*, *a2*] to range [*b1*, *b2*].
 </div>
 </div>
 
 
 <h3>.random16() [page:Float]</h3>
 <h3>.random16() [page:Float]</h3>
@@ -44,17 +44,17 @@ Standard Math.random() creates repetitive patterns when applied over larger spac
 
 
 <h3>.randInt( [page:Integer low], [page:Integer high] ) [page:Integer]</h3>
 <h3>.randInt( [page:Integer low], [page:Integer high] ) [page:Integer]</h3>
 <div>
 <div>
-Random integer from <strong>low</strong> to <strong>high</strong> interval.
+Random integer from *low* to *high* interval.
 </div>
 </div>
 
 
 <h3>.randFloat( [page:Float low], [page:Float high] ) [page:Float]</h3>
 <h3>.randFloat( [page:Float low], [page:Float high] ) [page:Float]</h3>
 <div>
 <div>
-Random float from <strong>low</strong> to <strong>high</strong> interval.
+Random float from *low* to *high* interval.
 </div>
 </div>
 
 
 <h3>.randFloatSpread( [page:Float range] ) [page:Float]</h3>
 <h3>.randFloatSpread( [page:Float range] ) [page:Float]</h3>
 <div>
 <div>
-Random float from <strong>- range / 2</strong> to <strong>range / 2</strong> interval.
+Random float from *- range / 2* to *range / 2* interval.
 </div>
 </div>
 
 
 
 

+ 80 - 21
docs/api/core/Matrix4.html

@@ -80,48 +80,48 @@ Resets this matrix to identity.
 
 
 <h3>.copy( [page:Matrix4 m] ) [page:Matrix4]</h3>
 <h3>.copy( [page:Matrix4 m] ) [page:Matrix4]</h3>
 <div>
 <div>
-Copies a matrix <strong>m</strong> into this matrix.
+Copies a matrix *m* into this matrix.
 </div>
 </div>
 
 
 <h3>.lookAt( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4]</h3>
 <h3>.lookAt( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4]</h3>
 <div>
 <div>
-Constructs a rotation matrix, looking from <strong>eye</strong> towards <strong>center</strong> with defined <strong>up</strong> vector.
+Constructs a rotation matrix, looking from *eye* towards *center* with defined *up* vector.
 </div>
 </div>
 
 
 <h3>.multiply( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4]</h3>
 <h3>.multiply( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4]</h3>
 <div>
 <div>
-Sets this matrix to <strong>a * b</strong>.
+Sets this matrix to *a x b*.
 </div>
 </div>
 
 
 <h3>.multiplySelf( [page:Matrix4 m] ) [page:Matrix4]</h3>
 <h3>.multiplySelf( [page:Matrix4 m] ) [page:Matrix4]</h3>
 <div>
 <div>
-Multiplies this matrix by <strong>m</strong>.
+Multiplies this matrix by *m*.
 </div>
 </div>
 
 
 <h3>.multiplyToArray( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4]</h3>
 <h3>.multiplyToArray( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4]</h3>
 <div>
 <div>
-Sets this matrix to <strong>a * b</strong> and sets result into flat array <strong>r</strong>.<br />
+Sets this matrix to *a x b* and sets result into flat array *r*.<br />
 Destination array can be regular Array or TypedArray.
 Destination array can be regular Array or TypedArray.
 </div>
 </div>
 
 
 <h3>.multiplyScalar( [page:Float s] ) [page:Matrix4]</h3>
 <h3>.multiplyScalar( [page:Float s] ) [page:Matrix4]</h3>
 <div>
 <div>
-Multiplies this matrix by <strong>s</strong>.
+Multiplies this matrix by *s*.
 </div>
 </div>
 
 
 <h3>.multiplyVector3( [page:Vector3 v] ) [page:Vector3]</h3>
 <h3>.multiplyVector3( [page:Vector3 v] ) [page:Vector3]</h3>
 <div>
 <div>
-Applies this matrix to <strong>v</strong>.
+Applies this matrix to *v*.
 </div>
 </div>
 
 
 <h3>.multiplyVector4( [page:Vector4 v] ) [page:Vector4]</h3>
 <h3>.multiplyVector4( [page:Vector4 v] ) [page:Vector4]</h3>
 <div>
 <div>
-Applies this matrix to <strong>v</strong>.
+Applies this matrix to *v*.
 </div>
 </div>
 
 
 <h3>.rotateAxis( [page:Vector3 v] ) [page:Vector3]</h3>
 <h3>.rotateAxis( [page:Vector3 v] ) [page:Vector3]</h3>
 <div>
 <div>
-Applies rotation submatrix of this matrix to vector <strong>v</strong> and then normalizes it.
+Applies rotation submatrix of this matrix to vector *v* and then normalizes it.
 </div>
 </div>
 
 
 <h3>.crossVector( [page:Vector4 a] ) [page:Vector4]</h3>
 <h3>.crossVector( [page:Vector4 a] ) [page:Vector4]</h3>
@@ -144,12 +144,12 @@ Flattens this matrix into internal [page:Matrix4 Matrix4.flat] array.
 
 
 <h3>.flattenToArray( [page:Array flat] ) [page:Array]</h3>
 <h3>.flattenToArray( [page:Array flat] ) [page:Array]</h3>
 <div>
 <div>
-Flattens this matrix into supplied <strong>flat</strong> array.
+Flattens this matrix into supplied *flat* array.
 </div>
 </div>
 
 
 <h3>.flattenToArrayOffset( [page:Array flat], [page:Integer offset] ) [page:Array]</h3>
 <h3>.flattenToArrayOffset( [page:Array flat], [page:Integer offset] ) [page:Array]</h3>
 <div>
 <div>
-Flattens this matrix into supplied <strong>flat</strong> array starting from <strong>offset</strong> position in the array.
+Flattens this matrix into supplied *flat* array starting from *offset* position in the array.
 </div>
 </div>
 
 
 <h3>.setTranslation( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]</h3>
 <h3>.setTranslation( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]</h3>
@@ -167,7 +167,7 @@ Sets this matrix as scale transform.
 theta — Rotation angle in radians.
 theta — Rotation angle in radians.
 </div>
 </div>
 <div>
 <div>
-Sets this matrix as rotation transform around x axis by <strong>theta</strong> radians.
+Sets this matrix as rotation transform around x axis by *theta* radians.
 </div>
 </div>
 
 
 <h3>.setRotationY( [page:Float theta] ) [page:Matrix4]</h3>
 <h3>.setRotationY( [page:Float theta] ) [page:Matrix4]</h3>
@@ -175,7 +175,7 @@ Sets this matrix as rotation transform around x axis by <strong>theta</strong> r
 theta — Rotation angle in radians.
 theta — Rotation angle in radians.
 </div>
 </div>
 <div>
 <div>
-Sets this matrix as rotation transform around y axis by <strong>theta</strong> radians.
+Sets this matrix as rotation transform around y axis by *theta* radians.
 </div>
 </div>
 
 
 <h3>.setRotationZ( [page:Float theta] ) [page:Matrix4]</h3>
 <h3>.setRotationZ( [page:Float theta] ) [page:Matrix4]</h3>
@@ -183,7 +183,7 @@ Sets this matrix as rotation transform around y axis by <strong>theta</strong> r
 theta — Rotation angle in radians.
 theta — Rotation angle in radians.
 </div>
 </div>
 <div>
 <div>
-Sets this matrix as rotation transform around z axis by <strong>theta</strong> radians.
+Sets this matrix as rotation transform around z axis by *theta* radians.
 </div>
 </div>
 
 
 <h3>.setRotationAxis( [page:Vector3 axis], [page:Float theta] ) [page:Matrix4]</h3>
 <h3>.setRotationAxis( [page:Vector3 axis], [page:Float theta] ) [page:Matrix4]</h3>
@@ -192,13 +192,13 @@ axis — Rotation axis.
 theta — Rotation angle in radians.
 theta — Rotation angle in radians.
 </div>
 </div>
 <div>
 <div>
-Sets this matrix as rotation transform around <strong>axis</strong> by <strong>angle</strong> radians.<br />
+Sets this matrix as rotation transform around *axis* by *angle* radians.<br />
 Based on <a href="http://www.gamedev.net/reference/articles/article1199.asp">http://www.gamedev.net/reference/articles/article1199.asp</a>.
 Based on <a href="http://www.gamedev.net/reference/articles/article1199.asp">http://www.gamedev.net/reference/articles/article1199.asp</a>.
 </div>
 </div>
 
 
 <h3>.setPosition( [page:Vector3 v] ) [page:Matrix4]</h3>
 <h3>.setPosition( [page:Vector3 v] ) [page:Matrix4]</h3>
 <div>
 <div>
-Sets the position component for this matrix from vector <strong>v</strong>.
+Sets the position component for this matrix from vector *v*.
 </div>
 </div>
 
 
 <h3>.getPosition() [page:Vector3]</h3>
 <h3>.getPosition() [page:Vector3]</h3>
@@ -227,7 +227,7 @@ Note: this method returns a reference to internal class vector, make copy or clo
 
 
 <h3>.getInverse( [page:Matrix4 m] ) [page:Matrix4]</h3>
 <h3>.getInverse( [page:Matrix4 m] ) [page:Matrix4]</h3>
 <div>
 <div>
-Sets this matrix to inverse of matrix <strong>m</strong>.<br />
+Sets this matrix to inverse of matrix *m*.<br />
 Based on <a href="http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm">http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm</a>.
 Based on <a href="http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm">http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm</a>.
 </div>
 </div>
 
 
@@ -243,25 +243,84 @@ Default order "XYZ".
 
 
 <h3>.setRotationFromQuaternion( [page:Quaternion q] ) [page:Matrix4]</h3>
 <h3>.setRotationFromQuaternion( [page:Quaternion q] ) [page:Matrix4]</h3>
 <div>
 <div>
-Sets rotation submatrix of this matrix to rotation specified by <strong>q</strong>.
+Sets rotation submatrix of this matrix to rotation specified by *q*.
 </div>
 </div>
 
 
 <h3>.scale( [page:Vector3 v] ) [page:Matrix4]</h3>
 <h3>.scale( [page:Vector3 v] ) [page:Matrix4]</h3>
 <div>
 <div>
-Multiplies columns of this matrix by vector <strong>v</strong>.
+Multiplies columns of this matrix by vector *v*.
 </div>
 </div>
 
 
 <h3>.compose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Matrix4]</h3>
 <h3>.compose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Matrix4]</h3>
 <div>
 <div>
-Sets this matrix to transform composed of <strong>translation</strong>, <strong>rotation</strong> and <strong>scale</strong>.
+Sets this matrix to transform composed of *translation*, *rotation* and *scale*.
 </div>
 </div>
 
 
 <h3>.decompose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Array]</h3>
 <h3>.decompose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Array]</h3>
 <div>
 <div>
-Decomposes this matrix into <strong>translation</strong>, <strong>rotation</strong> and <strong>scale</strong> components.<br />
+Decomposes this matrix into *translation*, *rotation* and *scale* components.<br />
 If parameters are not supplied, new instances will be created.
 If parameters are not supplied, new instances will be created.
 </div>
 </div>
 
 
+<h3>.extractPosition( [page:Matrix4 m] ) [page:Matrix4]</h3>
+<div>
+Copies translation component of supplied matrix *m* into this matrix translation.
+</div>
+
+<h3>.extractRotation( [page:Matrix4 m] ) [page:Matrix4]</h3>
+<div>
+Copies rotation component of supplied matrix *m* into this matrix rotation.
+</div>
+
+<h3>.rotateByAxis( [page:Vector3 axis], [page:Float angle] ) [page:Matrix4]</h3>
+<div>
+Rotates this matrix around supplied *axis* by *angle*.
+</div>
+
+<h3>.rotateX( [page:Float angle] ) [page:Matrix4]</h3>
+<div>
+Rotates this matrix around x axis by *angle*.
+</div>
+
+<h3>.rotateY( [page:Float angle] ) [page:Matrix4]</h3>
+<div>
+Rotates this matrix around y axis by *angle*.
+</div>
+
+<h3>.rotateZ( [page:Float angle] ) [page:Matrix4]</h3>
+<div>
+Rotates this matrix around z axis by *angle*.
+</div>
+
+<h3>.translate( [page:Vector3 v] ) [page:Matrix4]</h3>
+<div>
+Translates this matrix by vector *v*.
+</div>
+
+
+<h2>Static Methods</h2>
+
+<h3>.makeInvert3x3( [page:Matrix4 m] ) [page:Matrix3]</h3>
+<div>
+Inverts just rotation submatrix of matrix *m*.<br />
+Note: this method returns a reference to internal 3x3 matrix, make copy or clone if you don't use it right away.<br />
+Based on <a href="http://code.google.com/p/webgl-mjs/">http://code.google.com/p/webgl-mjs/</a>.
+</div>
+
+<h3>.makeFrustum( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4]</h3>
+<div>
+Creates frustum matrix.
+</div>
+
+<h3>.makePerspective( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] ) [page:Matrix4]</h3>
+<div>
+Creates perspective projection matrix.
+</div>
+
+<h3>.makeOrtho( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4]</h3>
+<div>
+Creates orthographic projection matrix.
+</div>
 
 
 <h2>Source</h2>
 <h2>Source</h2>
 
 

+ 0 - 476
docs/api/core/Matrix4.rst

@@ -1,476 +0,0 @@
-Matrix4 - A 4x4 Matrix
-----------------------
-
-.. ...............................................................................
-.. rubric:: Constructor
-.. ...............................................................................
-
-.. 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
-.. attribute:: Matrix4.n13
-.. attribute:: Matrix4.n14
-.. attribute:: Matrix4.n21
-.. attribute:: Matrix4.n22
-.. attribute:: Matrix4.n23
-.. attribute:: Matrix4.n24
-.. attribute:: Matrix4.n31
-.. attribute:: Matrix4.n32
-.. attribute:: Matrix4.n33
-.. attribute:: Matrix4.n34
-.. attribute:: Matrix4.n41
-.. attribute:: Matrix4.n42
-.. attribute:: Matrix4.n43
-.. attribute:: Matrix4.n44
-
-
-.. ...............................................................................
-.. rubric:: Methods
-.. ...............................................................................
-
-.. function:: Matrix4.clone( )
-
-    Clones this matrix
-
-    :returns: New instance identical to this matrix
-    :rtype: :class:`Matrix4`
-
-.. 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
-
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.identity()
-
-    Resets this matrix to identity
-
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.copy( m )
-
-    Copies a matrix ``m`` into this matrix
-
-    :param Matrix4 m: Matrix to be copied
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.lookAt( eye, center, up )
-
-    Constructs rotation matrix, looking from ``eye`` towards ``center`` with defined ``up`` vector
-
-    :param Vector3 eye: vector
-    :param Vector3 center: vector
-    :param Vector3 up: vector
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.multiply( a, b )
-
-    Sets this matrix to ``a * b``
-
-    :param Matrix4 a: source matrix A
-    :param Matrix4 b: source matrix B
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.multiplyToArray( a, b, r )
-
-    Sets this matrix to ``a * b`` and sets result into flat array ``r``
-
-    Destination array can be regular JS array or Typed Array
-
-    :param Matrix4 a: source matrix A
-    :param Matrix4 b: source matrix B
-    :param array r: destination array
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.multiplySelf( a )
-
-    Multiplies this matrix by ``a``
-
-    :param Matrix4 a: matrix
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.multiplyScalar( s )
-
-    Multiplies this matrix by ``s``
-
-    :param float  a: number
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.multiplyVector3( v )
-
-    Applies this matrix to a :class:`Vector3`
-
-    :param Vector3 v: vector
-    :returns: Multiplied vector
-    :rtype: :class:`Vector3`
-
-.. function:: Matrix4.multiplyVector4( v )
-
-    Applies this matrix to a :class:`Vector4`
-
-    :param Vector4 v: vector
-    :returns: Multiplied vector
-    :rtype: :class:`Vector4`
-
-.. function:: Matrix4.rotateAxis( v )
-
-    Applies rotation submatrix of this matrix to vector ``v`` and then normalizes it
-
-    :param Vector3 v: vector
-    :returns: Rotated vector
-    :rtype: :class:`Vector3`
-
-.. function:: Matrix4.crossVector( a )
-
-    //todo:description
-
-    :param Vector4 a: vector
-    :rtype: :class:`Vector4`
-
-.. function:: Matrix4.determinant()
-
-    Computes determinant of this matrix
-
-    Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
-
-    :returns: Determinant
-    :rtype: float
-
-.. function:: Matrix4.transpose()
-
-    Transposes this matrix
-
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.flatten()
-
-    Flattens this matrix into internal :attr:`Matrix4.flat` array
-
-    :returns: Flat array with this matrix values
-    :rtype: array
-
-.. function:: Matrix4.flattenToArray( flat )
-
-    Flattens this matrix into supplied ``flat`` array
-
-    :param array flat: array
-    :returns: Flat array with this matrix values
-    :rtype: array
-
-.. function:: Matrix4.flattenToArrayOffset( flat, offset )
-
-    Flattens this matrix into supplied ``flat`` array starting from ``offset`` position in the array
-
-    :param array flat: array
-    :param integer offset: offset
-    :returns: Flat array with this matrix values
-    :rtype: array
-
-.. function:: Matrix4.setTranslation( x, y, z )
-
-    Sets this matrix as translation transform
-
-    :param float x: x-translation
-    :param float y: y-translation
-    :param float z: z-translation
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setScale( x, y, z )
-
-    Sets this matrix as scale transform
-
-    :param float x: x-scale
-    :param float y: y-scale
-    :param float z: z-scale
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setRotationX( theta )
-
-    Sets this matrix as rotation transform around x-axis by ``theta`` radians
-
-    :param float theta: Rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setRotationY( theta )
-
-    Sets this matrix as rotation transform around y-axis by ``theta`` radians
-
-    :param float theta: Rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setRotationZ( theta )
-
-    Sets this matrix as rotation transform around z-axis by ``theta`` radians
-
-    :param float theta: Rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setRotationAxis( axis, angle )
-
-    Sets this matrix as rotation transform around ``axis`` by ``angle`` radians
-
-    Based on http://www.gamedev.net/reference/articles/article1199.asp
-
-    :param Vector3 axis: Rotation axis
-    :param float angle: Rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setPosition( v )
-
-    Sets just position component for this matrix from vector ``v``
-
-    :param Vector3 v: position vector
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.getPosition()
-
-    Returns position component from this matrix
-
-    Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.
-
-    :returns: Vector with position
-    :rtype: :class:`Vector3`
-
-.. function:: Matrix4.getColumnX()
-
-    Returns x-column component from this matrix
-
-    Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.
-
-    :returns: Vector with x-column
-    :rtype: :class:`Vector3`
-
-.. function:: Matrix4.getColumnY()
-
-    Returns y-column component from this matrix
-
-    Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.
-
-    :returns: Vector with y-column
-    :rtype: :class:`Vector3`
-
-.. function:: Matrix4.getColumnZ()
-
-    Returns z-column component from this matrix
-
-    Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.
-
-    :returns: Vector with z-column
-    :rtype: :class:`Vector3`
-
-.. function:: Matrix4.getInverse( m )
-
-    Sets this matrix to inverse of matrix ``m``
-
-    Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
-
-    :param Matrix4 m: source matrix
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setRotationFromEuler( v, order )
-
-    Sets rotation submatrix of this matrix to rotation specified by Euler angles
-
-    Default order ``XYZ``
-
-    :param Vector3 v: Vector3 with all the rotations
-    :param string order: The order of rotations eg. 'XYZ'
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.setRotationFromQuaternion( q )
-
-    Sets rotation submatrix of this matrix to rotation specified by quaternion
-
-    :param Quaternion q: rotation
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.scale( v )
-
-    Multiplies columns of this matrix by vector ``v``
-
-    :param Vector3 v: scale vector
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.compose( translation, rotation, scale )
-
-    Sets this matrix to transform composed of ``translation``, ``rotation`` and ``scale``
-
-    :param Vector3 translation: vector
-    :param Quaternion rotation: quaternion
-    :param Vector3 scale: vector
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.decompose( translation, rotation, scale )
-
-    Decomposes this matrix into `translation``, ``rotation`` and ``scale`` components
-
-    If parameters are not supplied, new instances will be created
-
-    :param Vector3 translation: destination translation vector
-    :param Quaternion rotation: destination rotation quaternion
-    :param Vector3 scale: destination scale vector
-    :returns: Array [ translation, rotation, scale ]
-    :rtype: Array
-
-.. function:: Matrix4.extractPosition( m )
-
-    Copies translation component of supplied matrix ``m`` into this matrix translation
-
-    :param Matrix4 m: source matrix
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.extractRotation( m )
-
-    Copies rotation component of supplied matrix ``m`` into this matrix rotation
-
-    :param Matrix4 m: source matrix
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.rotateByAxis( axis, angle )
-
-    Rotates this matrix around supplied ``axis`` by ``angle``
-
-    :param Vector3 axis: rotation axis
-    :param float angle: rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.rotateX( angle )
-
-    Rotates this matrix around x-axis by ``angle``
-
-    :param float angle: rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.rotateY( angle )
-
-    Rotates this matrix around y-axis by ``angle``
-
-    :param float angle: rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.rotateZ( angle )
-
-    Rotates this matrix around z-axis by ``angle``
-
-    :param float angle: rotation angle in radians
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.translate( v )
-
-    Translates this matrix by vector ``v``
-
-    :param Vector3 v: translation vector
-    :returns: This matrix
-    :rtype: :class:`Matrix4`
-
-.. ...............................................................................
-.. rubric:: Static methods
-.. ...............................................................................
-
-.. function:: Matrix4.makeInvert3x3( m )
-
-    Inverts just rotation submatrix of matrix ``m``
-
-    Note: this method returns a reference to internal 3x3 matrix, make copy or clone if you don't use it right away.
-
-    Based on http://code.google.com/p/webgl-mjs/
-
-    :param Matrix4 m: source matrix
-    :returns: inverted submatrix
-    :rtype: :class:`Matrix3`
-
-.. function:: Matrix4.makeFrustum( left, right, bottom, top, near, far )
-
-    Creates frustum matrix
-
-    :param float left: left
-    :param float right: right
-    :param float bottom: bottom
-    :param float top: top
-    :param float near: near
-    :param float far: far
-    :returns: New instance of frustum matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.makePerspective( fov, aspect, near, far )
-
-    Creates perspective projection matrix
-
-    :param float fov: vertical field of view in degrees
-    :param float aspect: aspect ratio
-    :param float near: near plane
-    :param float far: far plane
-    :returns: New instance of projection matrix
-    :rtype: :class:`Matrix4`
-
-.. function:: Matrix4.makeOrtho( left, right, top, bottom, near, far )
-
-    Creates orthographic projection matrix
-
-    :param float left: left
-    :param float right: right
-    :param float top: top
-    :param float bottom: bottom
-    :param float near: near plane
-    :param float far: far plane
-    :returns: New instance of projection matrix
-    :rtype: :class:`Matrix4`
-
-.. ...............................................................................
-.. rubric:: Example
-.. ...............................................................................
-
-::
-
-    // simple rig for rotation around 3 axes
-
-    var m = new THREE.Matrix4();
-
-    var m1 = new THREE.Matrix4();
-    var m2 = new THREE.Matrix4();
-    var m3 = new THREE.Matrix4();
-
-    var alpha = 0;
-    var beta = Math.PI;
-    var gamma = Math.PI/2;
-
-    m1.setRotationX( alpha );
-    m2.setRotationY( beta );
-    m3.setRotationZ( gamma );
-
-    m.multiply( m1, m2 );
-    m.multiplySelf( m3 );

+ 165 - 4
docs/api/core/Object3D.html

@@ -1,6 +1,6 @@
 <h1>[name]</h1>
 <h1>[name]</h1>
 
 
-<div class="desc">todo</div>
+<div class="desc">Base class for scene graph objects</div>
 
 
 
 
 <h2>Constructor</h2>
 <h2>Constructor</h2>
@@ -10,14 +10,175 @@
 
 
 <h2>Properties</h2>
 <h2>Properties</h2>
 
 
-<h3>.[page:Vector3 todo]</h3>
+<h3>.[page:Integer id]</h3>
+<div>
+Unique number of this object instance.
+</div>
+
+<h3>.[page:String name]</h3>
+<div>
+Optional name of the object (doesn't have to be unique).
+</div>
+
+<h3>.[page:Object3D parent]</h3>
+<div>
+Object's parent in scene graph.
+</div>
+
+<h3>.[page:Object3D children]</h3>
+<div>
+Array with object's children.
+</div>
+
+<h3>.[page:Vector3 position]</h3>
+<div>
+Object's local position.
+</div>
+
+<h3>.[page:Vector3 rotation]</h3>
+<div>
+Object's local rotation (Euler angles).
+</div>
+
+<h3>.[page:String eulerOrder]</h3>
+<div>
+Order of axis for Euler angles.
+</div>
+
+<h3>.[page:Vector3 scale]</h3>
+<div>
+Object's local scale.
+</div>
+
+<h3>.[page:Vector3 up]</h3>
+<div>
+Up direction.
+</div>
+
+<h3>.[page:Vector3 matrix]</h3>
+<div>
+Local transform.
+</div>
+
+<h3>.[page:Vector3 matrixRotationWorld]</h3>
+<div>
+Global rotation.
+</div>
+
+<h3>.[page:Quaternion quaternion]</h3>
+<div>
+Global rotation.
+</div>
+
+<h3>.[page:Boolean useQuaternion]</h3>
+<div>
+Use quaternion instead of Euler angles for specifying local rotation.
+</div>
+
+<h3>.[page:Float boundRadius]</h3>
+
+<h3>.[page:Float boundRadiusScale]</h3>
+<div>
+Maximum scale from x, y, z scale components.
+</div>
+
+<h3>.[page:Float renderDepth]</h3>
+<div>
+Override depth-sorting order if non *null*.
+</div>
+
+<h3>.[page:Boolean visible]</h3>
+<div>
+Object gets rendered if *true*.
+</div>
+
+<h3>.[page:Boolean doubleSided]</h3>
+<div>
+Both sides of faces visible if *true*.
+</div>
+
+<h3>.[page:Boolean flipSided]</h3>
+<div>
+Backside of face visible if *true*.
+</div>
+
+<h3>.[page:Boolean castShadow]</h3>
+<div>
+Gets rendered into shadow map.
+</div>
+
+<h3>.[page:Boolean receiveShadow]</h3>
+<div>
+Material gets baked in shadow receiving.
+</div>
+
+<h3>.[page:Boolean frustumCulled]</h3>
+
+<h3>.[page:Boolean matrixAutoUpdate]</h3>
+
+<h3>.[page:Boolean matrixWorldNeedsUpdate]</h3>
+
+<h3>.[page:Boolean rotationAutoUpdate]</h3>
 
 
 
 
 <h2>Methods</h2>
 <h2>Methods</h2>
 
 
-<h3>.todo( [page:Vector3 todo] )</h3>
+<h3>.translate( [page:Float distance], [page:Vector3 axis] )</h3>
+<div>
+distance - Distance.<br />
+axis - Translation direction.
+</div>
+<div>
+Translates object along arbitrary *axis* by *distance*.
+</div>
+
+<h3>.translateX( [page:Float distance] )</h3>
+<div>
+Translates object along x axis by distance.
+</div>
+
+<h3>.translateY( [page:Float distance] )</h3>
+<div>
+Translates object along y axis by distance.
+</div>
+
+<h3>.translateZ( [page:Float distance] )</h3>
+<div>
+Translates object along z axis by distance.
+</div>
+
+<h3>.lookAt( [page:Vector3 vector] )</h3>
+<div>
+Rotates object to face point in space.
+</div>
+
+<h3>.add( [page:Object3D object] )</h3>
+<div>
+Adds *object* as child of this object.
+</div>
+
+<h3>.remove( [page:Object3D object] )</h3>
+<div>
+Removes *object* as child of this object.
+</div>
+
+<h3>.getChildByName( [page:String name], [page:Boolean recursive] )</h3>
+<div>
+name - Object name.<br />
+recursive - Whether check in the objects's children.
+</div>
+<div>
+Gets first child with name matching the argument. Searches whole subgraph recursively if *recursive* is true.
+</div>
+
+<h3>.updateMatrix()</h3>
+<div>
+Updates local transform.
+</div>
+
+<h3>.updateMatrixWorld( [page:Boolean force] )</h3>
 <div>
 <div>
-todo — todo<br />
+Updates global transform of the object and its children.
 </div>
 </div>
 
 
 
 

+ 0 - 239
docs/api/core/Object3D.rst

@@ -1,239 +0,0 @@
-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
-
-.. attribute:: Object3D.name
-
-    Optional name of the object (doesn't have to be unique)
-
-.. ...............................................................................
-.. rubric:: Scene graph attributes
-.. ...............................................................................
-
-.. attribute:: Object3D.parent
-
-    Object's parent in scene graph
-
-.. attribute:: Object3D.children
-
-    Array with object's children
-
-.. ...............................................................................
-.. rubric:: Transform attributes
-.. ...............................................................................
-
-.. attribute:: Object3D.position
-
-    Object's local position
-
-    :class:`Vector3` - default  ``( 0, 0, 0 )``
-
-.. attribute:: Object3D.rotation
-
-    Object's local rotation (Euler angles)
-
-    :class:`Vector3` - default  ``( 0, 0, 0 )``
-
-.. attribute:: Object3D.eulerOrder
-
-    Order of axis for Euler angles
-
-    ``string`` - default ``XYZ``
-
-.. attribute:: Object3D.scale
-
-    Object's local scale
-
-    :class:`Vector3` - default  ``( 1, 1, 1 )``
-
-.. attribute:: Object3D.up
-
-    Up direction
-
-    :class:`Vector3` - default  ``( 0, 1, 0 )``
-
-.. attribute:: Object3D.matrix
-
-    Local transform
-
-    :class:`Matrix4`
-
-.. attribute:: Object3D.matrixWorld
-
-    Global transform
-
-    :class:`Matrix4`
-
-.. attribute:: Object3D.matrixRotationWorld
-
-    Global rotation
-
-    :class:`Matrix4`
-
-.. attribute:: Object3D.quaternion
-
-    Rotation quaternion
-
-    :class:`Quaternion`
-
-.. attribute:: Object3D.useQuaternion
-
-    Use quaternion instead of Euler angles for specifying local rotation
-
-    boolean - default ``false``
-
-.. attribute:: Object3D.boundRadius
-
-    ``float`` - default ``0.0``
-
-.. attribute:: Object3D.boundRadiusScale
-
-    Maximum scale from X, Y, Z scale components
-
-    ``float`` - default ``1.0``
-
-.. attribute:: Object3D.renderDepth
-
-    Override depth-sorting order if non ``null``
-
-    ``float`` - default ``null``
-
-.. ...............................................................................
-.. rubric:: Appearance flags
-.. ...............................................................................
-
-.. attribute:: Object3D.visible
-
-    Object gets rendered if ``true``
-
-    ``boolean`` - default ``true``
-
-.. attribute:: Object3D.doubleSided
-
-    Both sides of faces visible if ``true``
-
-    default ``false``
-
-.. attribute:: Object3D.flipSided
-
-    Backside of face visible
-
-    default ``false``
-
-.. attribute:: Object3D.castShadow
-
-    Gets rendered into shadow map
-
-    ``boolean`` - default ``false``
-
-.. attribute:: Object3D.receiveShadow
-
-    Material gets baked in shadow receiving
-
-    ``boolean`` - default ``false``
-
-
-.. ...............................................................................
-.. rubric:: Scene graph flags
-.. ...............................................................................
-
-.. attribute:: Object3D.frustumCulled
-
-    ``boolean`` - default ``true``
-
-.. attribute:: Object3D.matrixAutoUpdate
-
-    ``boolean`` - default ``true``
-
-.. attribute:: Object3D.matrixWorldNeedsUpdate
-
-    ``boolean`` - default ``true``
-
-.. attribute:: Object3D.rotationAutoUpdate
-
-    ``boolean`` - default ``true``
-
-
-.. ...............................................................................
-.. rubric:: Methods
-.. ...............................................................................
-
-.. function:: Object3D.translate ( distance, axis )
-
-    Translates object along arbitrary axis by distance
-
-    :param float distance: distance
-    :param Vector3 axis: translation direction
-
-.. function:: Object3D.translateX ( distance )
-
-    Translates object along X-axis by distance
-
-    :param float distance: distance
-
-.. function:: Object3D.translateY ( distance )
-
-    Translates object along Y-axis by distance
-
-    :param float distance: distance
-
-.. function:: Object3D.translateZ ( distance )
-
-    Translates object along Z-axis by distance
-
-    :param float distance: distance
-
-.. function:: Object3D.lookAt ( vector )
-
-    Rotates object to face point in space
-
-    :param Vector3 vector: vector
-
-.. function:: Object3D.add ( object )
-
-    Adds child object to this object
-
-    :param Object3D object: child
-
-.. function:: Object3D.remove ( object )
-
-    Removes child object from this object
-
-    :param Object3D object: child
-
-.. function:: Object3D.getChildByName ( name, doRecurse )
-
-    Gets first child with name matching the argument (searches whole subgraph recursively if flag is set).
-
-    :param string name: child name
-    :param boolean doRecurse: recurse flag
-    :returns: child with matching name or ``undefined``
-    :rtype: :class:`Object3D`
-
-.. function:: Object3D.updateMatrix ( )
-
-    Updates local transform
-
-.. function:: Object3D.updateMatrixWorld ( force )
-
-    Updates global transform of the object and its children
-
-
-.. ...............................................................................
-.. rubric:: Example
-.. ...............................................................................

+ 6 - 6
src/core/Object3D.js

@@ -174,9 +174,9 @@ THREE.Object3D.prototype = {
 
 
 	},
 	},
 
 
-	getChildByName: function ( name, doRecurse ) {
+	getChildByName: function ( name, recursive ) {
 
 
-		var c, cl, child, recurseResult;
+		var c, cl, child;
 
 
 		for ( c = 0, cl = this.children.length; c < cl; c ++ ) {
 		for ( c = 0, cl = this.children.length; c < cl; c ++ ) {
 
 
@@ -188,13 +188,13 @@ THREE.Object3D.prototype = {
 
 
 			}
 			}
 
 
-			if ( doRecurse ) {
+			if ( recursive ) {
 
 
-				recurseResult = child.getChildByName( name, doRecurse );
+				child = child.getChildByName( name, recursive );
 
 
-				if ( recurseResult !== undefined ) {
+				if ( child !== undefined ) {
 
 
-					return recurseResult;
+					return child;
 
 
 				}
 				}