Browse Source

Added docs for RectAreaLight and RectAreaLightShadow

Lewy Blue 8 years ago
parent
commit
9c667b920f

+ 157 - 0
docs/api/lights/RectAreaLight.html

@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Object3D] &rarr; [page:Light] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+			This light gets emitted uniformly across the face a rectangular plane. This can be
+			used to simulate things like bright windows or strip lighting.<br /><br />
+
+			This light can cast shadows - see the [page:RectAreaLightShadow] page for details.<br /><br />
+
+			<em>NOTE:</em> this class is currently under active development and is probably not
+			production ready yet (as of r83). Check back in a month or two! And feel free to try it out in the meantime.
+		</div>
+
+
+
+
+		<h2>Examples</h2>
+
+		<div>
+			[example:webgl_lights_arealight WebGL / arealight ]<br />
+			[example:webgl_lights_rectarealight WebGL / rectarealight ]
+
+			<code>
+var width = 2;
+var height = 10;
+var rectLight = new THREE.RectAreaLight( 0xffffff, undefined,  width, height );
+rectLight.matrixAutoUpdate = true;
+rectLight.intensity = 70.0;
+rectLight.position.set( 5, 5, 0 );
+rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
+rectLight.add( rectLightHelper );
+
+scene.add(rectLight)
+			</code>
+		</div>
+
+
+
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( [page:Integer color], [page:Float intensity], [page:Float distance], [page:Radians angle], [page:Float penumbra], [page:Float decay] )</h3>
+		<div>
+			[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
+			[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
+			[page:Float width] - (optional) width of the light. Default is 10.<br />
+			[page:Float height] - (optional) height of the light. Default is 10.
+
+			Creates a new [name].
+		</div>
+
+		<h2>Properties</h2>
+		<div>
+			See the base [page:Light Light] class for common properties.
+		</div>
+
+
+		<h3>[property:Boolean castShadow]</h3>
+		<div>
+			If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and
+			requires tweaking to get shadows looking right. See the [page:RectAreaLightShadow] for details.
+			The default is *false*.<br /><br />
+
+			<em>Note:</em> this is not yet implemented for this light type! (r83)
+		</div>
+
+		<h3>[property:Float decay]</h3>
+		<div>
+			The amount the light dims along the distance of the light.<br />
+			In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to
+			physically realistic light falloff. The default is *1*.<br /><br />
+
+			<em>Note:</em> this is not yet implemented for this light type! (r83)
+		</div>
+
+		<h3>[property:Float distance]</h3>
+		<div>
+			If non-zero, light will attenuate linearly from maximum intensity at the light's
+			position down to zero at this distance from the light. Default is *0.0*.<br /><br />
+
+			<em>Note:</em> this is not yet implemented for this light type! (r83)
+		</div>
+
+		<h3>[property:Boolean isRectAreaLight]</h3>
+		<div>
+			Used to check whether this or derived classes are spot lights. Default is *true*.<br /><br />
+
+			You should not change this, as it used internally for optimisation.
+		</div>
+
+		<h3>[property:Vector3 position]</h3>
+		<div>
+			This is set equal to [page:Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
+		</div>
+
+		<h3>[property:RectAreaLightShadow shadow]</h3>
+		<div>
+			A [page:RectAreaLightShadow] used to calculate shadows for this light.<br /><br />
+
+			<em>Note:</em> this is not yet implemented for this light type! (r83)
+		</div>
+
+
+		<h3>[property:Object3D target]</h3>
+		<div>
+			The RectAreaLight points from its [page:.position position] to target.position. The default
+			position of the target is *(0, 0, 0)*.<br />
+
+			*Note*: For the the target's position to be changed to anything other than the default,
+			it must be added to the [page:Scene scene] using
+			<code>
+				scene.add( light.target );
+			</code>
+
+			This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
+			updated each frame.<br /><br />
+
+			It is also possible to set the target to be another object in the scene (anything with a
+			[page:Object3D.position position] property), like so:
+			<code>
+var targetObject = new THREE.Object3D();
+scene.add(targetObject);
+
+light.target = targetObject;
+			</code>
+			The RectAreaLight will now track the target object.
+		</div>
+
+
+		<h2>Methods</h2>
+		<div>
+			See the base [page:Light Light] class for common methods.
+		</div>
+
+
+		<h3>[method:RectAreaLight copy]( [page:RectAreaLight source] )</h3>
+		<div>
+		Copies value of all the properties from the [page:RectAreaLight source] to this
+		RectAreaLight.
+		</div>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 54 - 0
docs/api/lights/shadows/RectAreaLightShadow.html

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+			<em>Note: this is currently being developed and does nothing at the moment (r83).
+				Check back in a while!</em><br /><br />
+
+			This used internally by [page:RectAreaLight RectAreaLight] for calculating shadows.
+		</div>
+
+
+		<!--
+		<h2>Example</h2>
+		<div>
+			<code>
+			</code>
+		</div>
+	-->
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:Camera camera] )</h3>
+		<div>
+		[page:Camera camera] - the light's view of the world.<br /><br />
+
+		Create a new [name]. This is not intended to be called directly - it is called
+		internally by [page:RectAreaLight].
+		</div>
+
+		<h2>Properties</h2>
+		<div>
+			See the base [page:LightShadow] class for common properties.
+		</div>
+
+		<h2>Methods</h2>
+		<div>
+			See the base [page:LightShadow] class for common methods.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 0
docs/list.js

@@ -182,12 +182,14 @@ var list = {
 			[ "HemisphereLight", "api/lights/HemisphereLight" ],
 			[ "HemisphereLight", "api/lights/HemisphereLight" ],
 			[ "Light", "api/lights/Light" ],
 			[ "Light", "api/lights/Light" ],
 			[ "PointLight", "api/lights/PointLight" ],
 			[ "PointLight", "api/lights/PointLight" ],
+			[ "RectAreaLight", "api/lights/RectAreaLight" ],
 			[ "SpotLight", "api/lights/SpotLight" ]
 			[ "SpotLight", "api/lights/SpotLight" ]
 		],
 		],
 
 
 		"Lights / Shadows": [
 		"Lights / Shadows": [
 			[ "DirectionalLightShadow", "api/lights/shadows/DirectionalLightShadow" ],
 			[ "DirectionalLightShadow", "api/lights/shadows/DirectionalLightShadow" ],
 			[ "LightShadow", "api/lights/shadows/LightShadow" ],
 			[ "LightShadow", "api/lights/shadows/LightShadow" ],
+			[ "RectAreaLightShadow", "api/lights/shadows/RectAreaLightShadow" ],
 			[ "SpotLightShadow", "api/lights/shadows/SpotLightShadow" ]
 			[ "SpotLightShadow", "api/lights/shadows/SpotLightShadow" ]
 		],
 		],
 
 

+ 1 - 1
src/lights/RectAreaLight.js

@@ -47,4 +47,4 @@ RectAreaLight.prototype = Object.assign( Object.create( Light.prototype ), {
 
 
 } );
 } );
 
 
-export { RectAreaLight };
+export { RectAreaLight };