Skip to content

Commit 3e2eb41

Browse files
committed
docs
1 parent de97986 commit 3e2eb41

File tree

4 files changed

+50
-39
lines changed

4 files changed

+50
-39
lines changed

docs/api/lights/DirectionalLight.html

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,26 @@ <h3>[property:DirectionalLightShadow shadow]</h3>
9999

100100
<h3>[property:Object3D target]</h3>
101101
<p>
102-
The DirectionalLight points from its [page:.position position] to target.position. The default
103-
position of the target is *(0, 0, 0)*.<br />
104-
105-
*Note*: For the target's position to be changed to anything other than the default,
106-
it must be added to the [page:Scene scene] using
107-
</p>
108-
<code>
109-
scene.add( light.target );
110-
</code>
111-
<p>
112-
This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
113-
updated each frame.<br /><br />
114-
115-
It is also possible to set the target to be another object in the scene (anything with a
116-
[page:Object3D.position position] property), like so:
117-
</p>
118-
<code>
119-
var targetObject = new THREE.Object3D();
120-
scene.add(targetObject);
121-
122-
light.target = targetObject;
123-
</code>
124-
<p>
125-
The directionalLight will now track the target object.
102+
The DirectionalLight points from its [page:.position position] to target.position.
103+
If target is undefined, it points to to the origin *(0, 0, 0)* of its parent frame.<br />
104+
105+
The position pointed to by the DirectionalLight may be changed using lookAt
106+
<code>
107+
light.lookAt( x, y, z ); // or
108+
light.lookAt( lookAtPosition );
109+
</code>
110+
*Note*: the LookAt position must be expressed in the parent frame of the light, which is typically
111+
the world frame if the light has been added to the scene with no rotation/translation.
112+
113+
Alternatively, it may be set to track a target object.
114+
<code>
115+
var targetObject = new THREE.Object3D();
116+
scene.add(targetObject);
117+
118+
light.target = targetObject;
119+
</code>
120+
*Note*: The target object mush be added to the [page:Scene scene] to get its
121+
[page:Object3D.matrixWorld matrixWorld] automatically updated each frame.
126122
</p>
127123

128124

docs/api/lights/SpotLight.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,30 +152,28 @@ <h3>[property:SpotLightShadow shadow]</h3>
152152

153153
<h3>[property:Object3D target]</h3>
154154
<p>
155-
The Spotlight points from its [page:.position position] to target.position. The default
156-
position of the target is *(0, 0, 0)*.<br />
155+
The Spotlight points from its [page:.position position] to target.position.
156+
If target is undefined, it points to to the origin *(0, 0, 0)* of its parent frame.<br />
157157

158-
*Note*: For the target's position to be changed to anything other than the default,
159-
it must be added to the [page:Scene scene] using
158+
The position pointed to by the Spotlight may be changed using lookAt
160159
<code>
161-
scene.add( light.target );
160+
light.lookAt( x, y, z ); // or
161+
light.lookAt( vector3 );
162162
</code>
163+
*Note*: the LookAt position must be expressed in the parent frame of the light, which is typically
164+
the world frame if the light has been added to the scene with no rotation/translation.
163165

164-
This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
165-
updated each frame.<br /><br />
166-
167-
It is also possible to set the target to be another object in the scene (anything with a
168-
[page:Object3D.position position] property), like so:
166+
Alternatively, it may be set to track a target object.
169167
<code>
170168
var targetObject = new THREE.Object3D();
171169
scene.add(targetObject);
172170

173171
light.target = targetObject;
174172
</code>
175-
The spotlight will now track the target object.
173+
*Note*: The target object mush be added to the [page:Scene scene] to get its
174+
[page:Object3D.matrixWorld matrixWorld] automatically updated each frame.
176175
</p>
177176

178-
179177
<h2>Methods</h2>
180178

181179
See the base [page:Light Light] class for common methods.

docs/api/lights/shadows/DirectionalLightShadow.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ <h2>Example</h2>
6161
</code>
6262
</p>
6363

64+
<h3>[name]( [param:OrthographicCamera camera] )</h3>
65+
<p>
66+
[page:OrthographicCamera camera] - (optional) the light's view of the world.<br /><br />
67+
68+
Create a new [name]. If not provided, the constructor creates an [page:OrthographicCamera]
69+
to manage the shadow's view of the world. This is not intended to be called directly - it is called
70+
internally by [page:DirectionalLight].
71+
</p>
72+
73+
6474
<h2>Constructor</h2>
6575
<h3>[name]( )</h3>
6676
<p>
@@ -73,7 +83,7 @@ <h2>Properties</h2>
7383
See the base [page:LightShadow LightShadow] class for common properties.
7484
</p>
7585

76-
<h3>[property:Camera camera]</h3>
86+
<h3>[property:OrthographicCamera camera]</h3>
7787
<p>
7888
The light's view of the world. This is used to generate a depth map of the scene; objects behind
7989
other objects from the light's perspective will be in shadow.<br /><br />

docs/api/lights/shadows/SpotLightShadow.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,20 @@ <h2>Example</h2>
5959

6060
<h2>Constructor</h2>
6161

62-
The constructor creates a [param:PerspectiveCamera PerspectiveCamera] to manage the shadow's view of the world.
62+
<h3>[name]( [param:PerspectiveCamera camera] )</h3>
63+
<p>
64+
[page:PerspectiveCamera camera] - (optional) the light's view of the world.<br /><br />
65+
66+
Create a new [name]. If not provided, the constructor creates a [page:PerspectiveCamera]
67+
to manage the shadow's view of the world.
68+
</p>
69+
6370

6471
<h2>Properties</h2>
6572
See the base [page:LightShadow LightShadow] class for common properties.
6673

6774

68-
<h3>[property:Camera camera]</h3>
75+
<h3>[property:PerspectiveCamera camera]</h3>
6976
<p>
7077
The light's view of the world. This is used to generate a depth map of the scene; objects behind
7178
other objects from the light's perspective will be in shadow.<br /><br />

0 commit comments

Comments
 (0)