未验证 提交 dd005602 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #13733 from donmccurdy/docs-linewidth-pt3

Docs: Reduce linewidth for Animation–Core sections.
......@@ -10,7 +10,7 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
AnimationActions schedule the performance of the animations which are stored in
[page:AnimationClip AnimationClips].<br /><br />
......@@ -18,28 +18,28 @@
For an overview of the different elements of the three.js animation system see the
"Animation System" article in the "Next Steps" section of the manual.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:AnimationMixer mixer], [param:AnimationClip clip], [param:Object3D localRoot] )</h3>
<div>
<p>
[page:AnimationMixer mixer] - the *AnimationMixer* that is controlled by this action.<br />
[page:AnimationClip clip] - the *AnimationClip* that holds the animation data for this action.<br />
[page:Object3D localRoot] - the root object on which this action is performed.<br /><br />
Note: Instead of calling this constructor directly you should instantiate an AnimationAction with
[page:AnimationMixer.clipAction] since this method provides caching for better performance.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Boolean clampWhenFinished]</h3>
<div>
<p>
If *clampWhenFinished* is set to true the animation will automatically be [page:.paused paused]
on its last frame.<br /><br />
......@@ -51,10 +51,10 @@
Note: *clampWhenFinished* has no impact if the action is interrupted (it has only an effect if
its last loop has really finished).
</div>
</p>
<h3>[property:Boolean enabled]</h3>
<div>
<p>
Setting *enabled* to *false* disables this action, so that it has no impact. Default is *true*.<br /><br />
When the action is re-enabled, the animation continues from its current [page:.time time]
......@@ -65,10 +65,10 @@
[page:.paused paused] is *false*, this action has not been deactivated in the meantime (by
executing a [page:.stop stop] or [page:.reset reset] command), and neither [page:.weight weight]
nor [page:.timeScale timeScale] is 0.
</div>
</p>
<h3>[property:Number loop]</h3>
<div>
<p>
The looping mode (can be changed with [page:.setLoop setLoop]). Default is
[page:Animation THREE.LoopRepeat] (with an infinite number of [page:.repetitions repetitions])<br /><br />
......@@ -78,33 +78,33 @@
each time jumping from the end of the clip directly to its beginning,<br />
[page:Animation THREE.LoopPingPong] - playing the clip with the choosen number of *repetitions*,
alternately playing forward and backward.
</div>
</p>
<h3>[property:Boolean paused]</h3>
<div>
<p>
Setting *paused* to *true* pauses the execution of the action by setting the effective time scale
to 0. Default is *false*.<br /><br />
</div>
</p>
<h3>[property:Number repetitions]</h3>
<div>
<p>
The number of repetitions of the performed [page:AnimationClip] over the course of this action.
Can be set via [page:.setLoop setLoop]. Default is *Infinity*.<br /><br />
Setting this number has no effect, if the [page:.loop loop mode] is set to
[page:Animation THREE.LoopOnce].
</div>
</p>
<h3>[property:Number time]</h3>
<div>
<p>
The local time of this action (in seconds, starting with 0).<br /><br />
The value gets clamped or wrapped to 0...clip.duration (according to the loop state). It can be
scaled relativly to the global mixer time by changing [page:.timeScale timeScale] (using
[page:.setEffectiveTimeScale setEffectiveTimeScale] or [page:.setDuration setDuration]).<br />
</div>
</p>
<h3>[property:Number timeScale]</h3>
<div>
<p>
Scaling factor for the [page:.time time]. A value of 0 causes the animation to pause. Negative
values cause the animation to play backwards. Default is 1.<br /><br />
Properties/methods concerning *timeScale* (respectively *time*) are:
......@@ -116,10 +116,10 @@
[page:.stopWarping stopWarping],
[page:.syncWith syncWith],
[page:.warp warp].
</div>
</p>
<h3>[property:Number weight]</h3>
<div>
<p>
The degree of influence of this action (in the interval [0, 1]). Values between 0 (no impact)
and 1 (full impact) can be used to blend between several actions. Default is 1. <br /><br />
Properties/methods concerning *weight* are:
......@@ -131,24 +131,24 @@
[page:.getEffectiveWeight getEffectiveWeight],
[page:.setEffectiveWeight setEffectiveWeight],
[page:.stopFading stopFading].
</div>
</p>
<h3>[property:Boolean zeroSlopeAtEnd]</h3>
<div>
<p>
Enables smooth interpolation without separate clips for start, loop and end. Default is *true*.
</div>
</p>
<h3>[property:Boolean zeroSlopeAtStart]</h3>
<div>
<p>
Enables smooth interpolation without separate clips for start, loop and end. Default is *true*.
</div>
</p>
<h2>Methods</h2>
<h3>[method:AnimationAction crossFadeFrom]( [param:AnimationAction fadeOutAction], [param:Number durationInSeconds], [param:Boolean warpBoolean] )</h3>
<div>
<p>
Causes this action to [page:.fadeIn fade in], fading out another action simultaneously, within
the passed time interval. This method can be chained.<br /><br />
......@@ -157,65 +157,65 @@
Note: Like with *fadeIn*/*fadeOut*, the fading starts/ends with a weight of 1.
</div>
</p>
<h3>[method:AnimationAction crossFadeTo]( [param:AnimationAction fadeInAction], [param:Number durationInSeconds], [param:Boolean warpBoolean] )</h3>
<div>
<p>
Causes this action to [page:.fadeOut fade out], fading in another action simultaneously, within
the passed time interval. This method can be chained.<br /><br />
If warpBoolean is true, additional [page:.warp warping] (gradually changes of the time scales)
will be applied.<br /><br />
Note: Like with *fadeIn*/*fadeOut*, the fading starts/ends with a weight of 1.
</div>
</p>
<h3>[method:AnimationAction fadeIn]( [param:Number durationInSeconds] )</h3>
<div>
<p>
Increases the [page:.weight weight] of this action gradually from 0 to 1, within the passed time
interval. This method can be chained.
</div>
</p>
<h3>[method:AnimationAction fadeOut]( [param:Number durationInSeconds] )</h3>
<div>
<p>
Decreases the [page:.weight weight] of this action gradually from 1 to 0, within the passed time
interval. This method can be chained.
</div>
</p>
<h3>[method:Number getEffectiveTimeScale]()</h3>
<div>
<p>
Returns the effective time scale (considering the current states of warping and
[page:.paused paused]).
</div>
</p>
<h3>[method:number getEffectiveWeight]()</h3>
<div>
<p>
Returns the effective weight (considering the current states of fading and
[page:.enabled enabled]).
</div>
</p>
<h3>[method:AnimationClip getClip]()</h3>
<div>
<p>
Returns the clip which holds the animation data for this action.
</div>
</p>
<h3>[method:AnimationMixer getMixer]()</h3>
<div>
<p>
Returns the mixer which is responsible for playing this action.
</div>
</p>
<h3>[method:Object3D getRoot]()</h3>
<div>
<p>
Returns the root object on which this action is performed.
</div>
</p>
<h3>[method:AnimationAction halt]( [param:Number durationInSeconds] )</h3>
<div>
<p>
Decelerates this animation's speed to 0 by decreasing [page:.timeScale timeScale] gradually
(starting from its current value), within the passed time interval. This method can be chained.
</div>
</p>
<h3>[method:Boolean isRunning]()</h3>
<div>
<p>
Returns true if the action’s [page:.time time] is currently running.<br /><br />
In addition to being activated in the mixer (see [page:.isScheduled isScheduled]) the following conditions must be fulfilled:
......@@ -225,17 +225,17 @@
Note: *isRunning* being true doesn’t necessarily mean that the animation can actually be seen.
This is only the case, if [page:.weight weight] is additionally set to a non-zero value.
</div>
</p>
<h3>[method:Boolean isScheduled]()</h3>
<div>
<p>
Returns true, if this action is activated in the mixer.<br /><br />
Note: This doesn’t necessarily mean that the animation is actually running (compare the additional
conditions for [page:.isRunning isRunning]).
</div>
</p>
<h3>[method:AnimationAction play]()</h3>
<div>
<p>
Tells the mixer to activate the action. This method can be chained.<br /><br />
Note: Activating this action doesn’t necessarily mean that the animation starts immediately:
......@@ -244,10 +244,10 @@
executed first. Some other settings ([page:.paused paused]=true, [page:.enabled enabled]=false,
[page:.weight weight]=0, [page:.timeScale timeScale]=0) can prevent the animation from playing,
too.
</div>
</p>
<h3>[method:AnimationAction reset]()</h3>
<div>
<p>
Resets the action. This method can be chained.<br /><br />
This method sets [page:.paused paused] to false, [page:.enabled enabled] to true,
......@@ -256,16 +256,16 @@
Note: .*reset* is always called by [page:.stop stop], but .*reset* doesn’t call .*stop* itself.
This means: If you want both, resetting and stopping, don’t call .*reset*; call .*stop* instead.
</div>
</p>
<h3>[method:AnimationAction setDuration]( [param:Number durationInSeconds] )</h3>
<div>
<p>
Sets the duration for a single loop of this action (by adjusting [page:.timeScale timeScale]
and stopping any scheduled warping). This method can be chained.
</div>
</p>
<h3>[method:AnimationAction setEffectiveTimeScale]( [param:Number timeScale] )</h3>
<div>
<p>
Sets the [page:.timeScale timeScale] and stops any scheduled warping. This method can be chained.<br /><br />
If [page:.paused paused] is false, the effective time scale (an internal property) will also be set
......@@ -274,10 +274,10 @@
Note: .*paused* will not be switched to *true* automatically, if .*timeScale* is set to 0 by
this method.
</div>
</p>
<h3>[method:AnimationAction setEffectiveWeight]( [param:Number weight] )</h3>
<div>
<p>
Sets the [page:.weight weight] and stops any scheduled fading. This method can be chained.<br /><br />
If [page:.enabled enabled] is true, the effective weight (an internal property) will also be set
......@@ -286,70 +286,70 @@
Note: .*enabled* will not be switched to *false* automatically, if .*weight* is set to 0 by
this method.
</div>
</p>
<h3>[method:AnimationAction setLoop]( [param:Number loopMode], [param:Number repetitions] )</h3>
<div>
<p>
Sets the [page:.loop loop mode] and the number of [page:.repetitions repetitions]. This method
can be chained.
</div>
</p>
<h3>[method:AnimationAction startAt]( [param:Number startTimeInSeconds] )</h3>
<div>
<p>
Defines the time for a delayed start (usually passed as [page:AnimationMixer.time] +
deltaTimeInSeconds). This method can be chained.<br /><br />
Note: The animation will only start at the given time, if .*startAt* is chained with
[page:.play play], or if the action has already been activated in the mixer (by a previous
call of .*play*, without stopping or resetting it in the meantime).
</div>
</p>
<h3>[method:AnimationAction stop]()</h3>
<div>
<p>
Tells the mixer to deactivate this action. This method can be chained.<br /><br />
The action will be immediately stopped and completely [page:.reset reset].<br /><br />
Note: You can stop all active actions on the same mixer in one go via
[page:AnimationMixer.stopAllAction mixer.stopAllAction].
</div>
</p>
<h3>[method:AnimationAction stopFading]()</h3>
<div>
<p>
Stops any scheduled [page:.fadeIn fading] which is applied to this action. This method can be
chained.
</div>
</p>
<h3>[method:AnimationAction stopWarping]()</h3>
<div>
<p>
Stops any scheduled [page:.warp warping] which is applied to this action. This method can be
chained.
</div>
</p>
<h3>[method:AnimationAction syncWith]( [param:AnimationAction otherAction] )</h3>
<div>
<p>
Synchronizes this action with the passed other action. This method can be chained.<br /><br />
Synchronizing is done by setting this action’s [page:.time time] and [page:.timeScale timeScale] values
to the corresponding values of the other action (stopping any scheduled warping).<br /><br />
Note: Future changes of the other action's *time* and *timeScale* will not be detected.
</div>
</p>
<h3>[method:AnimationAction warp]( [param:Number startTimeScale], [param:Number endTimeScale], [param:Number durationInSeconds] )</h3>
<div>
<p>
Changes the playback speed, within the passed time interval, by modifying
[page:.timeScale timeScale] gradually from *startTimeScale* to *endTimeScale*. This method can
be chained.
</div>
</p>
<h2>Events</h2>
<div class="desc">
<p class="desc">
There are two events indicating when a single loop of the action respectively the entire action has finished. You can react to them with:
</div>
</p>
<code>
mixer.addEventListener( 'loop', function( e ) { …} ); // properties of e: type, action and loopDelta
mixer.addEventListener( 'finished', function( e ) { …} ); // properties of e: type, action and direction
......
......@@ -10,19 +10,19 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
An AnimationClip is a reusable set of keyframe tracks which represent an animation.<br /><br />
For an overview of the different elements of the three.js animation system see the
"Animation System" article in the "Next Steps" section of the manual.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Number duration], [param:Array tracks] )</h3>
<div>
<p>
[page:String name] - a name for this clip.<br />
[page:Number duration] - the duration of this clip (in seconds). If a negative value is passed,
the duration will be calculated from the passed *tracks* array.<br />
......@@ -34,98 +34,98 @@
[page:.CreateClipsFromMorphTargetSequences CreateClipsFromMorphTargetSequences]) or from
animation hierarchies ([page:.parseAnimation parseAnimation]) - if your model doesn't already
hold AnimationClips in its geometry's animations array.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Number duration]</h3>
<div>
<p>
The duration of this clip (in seconds). This can be calculated from the [page:.tracks tracks]
array via [page:.resetDuration resetDuration].
</div>
</p>
<h3>[property:String name]</h3>
<div>
<p>
A name for this clip. A certain clip can be searched via [page:.findByName findByName].
</div>
</p>
<h3>[property:Array tracks]</h3>
<div>
<p>
An array containing a [page:KeyframeTrack] for each property that are animated by this clip.
</div>
</p>
<h3>[property:String uuid]</h3>
<div>
<p>
The [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this clip instance.
It gets automatically assigned and shouldn't be edited.
</div>
</p>
<h2>Methods</h2>
<h3>[method:AnimationClip optimize]()</h3>
<div>
<p>
Optimizes each track by removing equivalent sequential keys (which are common in morph target
sequences).
</div>
</p>
<h3>[method:null resetDuration]()</h3>
<div>
<p>
Sets the [page:.duration duration] of the clip to the duration of its longest
[page:KeyframeTrack].
</div>
</p>
<h3>[method:AnimationClip trim]()</h3>
<div>
<p>
Trims all tracks to the clip's duration.
</div>
</p>
<h2>Static Methods</h2>
<h3>[method:Array CreateClipsFromMorphTargetSequences]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3>
<div>
<p>
Returns an array of new AnimationClips created from the [page:Geometry.morphTargets morph
target sequences] of a geometry, trying to sort morph target names into animation-group-based
patterns like "Walk_001, Walk_002, Run_001, Run_002 ..."<br /><br />
This method is called by the [page:JSONLoader] internally, and it uses
[page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence].
</div>
</p>
<h3>[method:AnimationClip CreateFromMorphTargetSequence]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3>
<div>
<p>
Returns a new AnimationClip from the passed [page:Geometry.morphTargets morph targets array]
of a geometry, taking a name and the number of frames per second.<br /><br />
Note: The fps parameter is required, but the animation speed can be overridden in an
*AnimationAction* via [page:AnimationAction.setDuration animationAction.setDuration].
</div>
</p>
<h3>[method:AnimationClip findByName]( [param:Object objectOrClipArray], [param:String name] )</h3>
<div>
<p>
Searches for an AnimationClip by name, taking as its first parameter either an array of
AnimationClips, or a mesh or geometry that contains an array named "animations".
</div>
</p>
<h3>[method:AnimationClip parse]( [param:Object json] )</h3>
<div>
<p>
Parses a JSON representation of a clip and returns an AnimationClip.
</div>
</p>
<h3>[method:AnimationClip parseAnimation]( [param:Object animation], [param:Array bones] )</h3>
<div>
<p>
Parses the animation.hierarchy format and returns an AnimationClip.
</div>
</p>
<h3>[method:Object toJSON]( [param:AnimationClip clip] )</h3>
<div>
<p>
Takes an AnimationClip and returns a JSON object.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,47 +10,47 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
The AnimationMixer is a player for animations on a particular object in the scene. When
multiple objects in the scene are animated independently, one AnimationMixer may be used for
each object.<br /><br />
For an overview of the different elements of the three.js animation system see the
"Animation System" article in the "Next Steps" section of the manual.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:Object3D rootObject] )</h3>
<div>
<p>
[page:Object3D rootObject] - the object whose animations shall be played by this mixer.<br />
</div>
</p>
<h2>Properties</h2>
<h3>[property:Number time]</h3>
<div>
<p>
The global mixer time (in seconds; starting with 0 on the mixer's creation).
</div>
</p>
<h3>[property:Number timeScale]</h3>
<div>
<p>
A scaling factor for the global [page:.time mixer time].<br /><br />
Note: Setting the mixer's timeScale to 0 and later back to 1 is a possibility to pause/unpause
all actions that are controlled by this mixer.
</div>
</p>
<h2>Methods</h2>
<h3>[method:AnimationAction clipAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
<div>
<p>
Returns an [page:AnimationAction] for the passed clip, optionally using a root object different
from the mixer's default root. The first parameter can be either an [page:AnimationClip] object
or the name of an AnimationClip.<br /><br />
......@@ -59,48 +59,48 @@
Note: Calling this method several times with the same parameters returns always the same clip
instance.
</div>
</p>
<h3>[method:AnimationAction existingAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
<div>
<p>
Returns an existing [page:AnimationAction] for the passed clip, optionally using a root object
different from the mixer's default root.<br /><br />
The first parameter can be either an [page:AnimationClip] object or the name of an AnimationClip.
</div>
</p>
<h3>[method:Object3D getRoot]()</h3>
<div>
<p>
Returns this mixer's root object.
</div>
</p>
<h3>[method:AnimationMixer stopAllAction]()</h3>
<div>
<p>
Deactivates all previously scheduled actions on this mixer.
</div>
</p>
<h3>[method:AnimationMixer update]([param:Number deltaTimeInSeconds]) </h3>
<div>
<p>
Advances the global mixer time and updates the animation.<br /><br />
This is usually done in the render loop, passing [page:Clock.getDelta clock.getDelta] scaled by the mixer's [page:.timeScale timeScale]).
</div>
</p>
<h3>[method:null uncacheClip]([param:AnimationClip clip])</h3>
<div>
<p>
Deallocates all memory resources for a clip.
</div>
</p>
<h3>[method:null uncacheRoot]([param:Object3D root]) </h3>
<div>
<p>
Deallocates all memory resources for a root object.
</div>
</p>
<h3>[method:null uncacheAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
<div>
<p>
Deallocates all memory resources for an action.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,29 +10,29 @@
<body>
<h1>[name]</h1>
<div class="desc">A group of objects that receives a shared animation state.<br /><br />
<p class="desc">A group of objects that receives a shared animation state.<br /><br />
For an overview of the different elements of the three.js animation system see the
"Animation System" article in the "Next Steps" section of the manual.
</div>
</p>
<h2>Usage:</h2>
<div class="desc">
<p class="desc">
Add objects you would otherwise pass as 'root' to the constructor or the [page:AnimationMixer.clipAction clipAction]
method of [page:AnimationMixer AnimationMixer] and instead pass this object as 'root'.<br /><br />
Note that objects of this class appear as one object to the mixer,
so cache control of the individual objects must be done on the group.
</div>
</p>
<h2>Limitations</h2>
<div class="desc">
<p class="desc">
The animated properties must be compatible among all objects in the group.<br /><br />
A single property can either be controlled through a target group or directly, but not both.
</div>
</p>
<h2>Constructor</h2>
......@@ -46,35 +46,35 @@
<h3>[property:object stats]</h3>
<div>
<p>
An object that contains some informations of this *AnimationObjectGroup* (total number, number
in use, number of bindings per object)
</div>
</p>
<h3>[property:String uuid]</h3>
<div>
<p>
The [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this
*AnimationObjectGroup*. It gets automatically assigned and shouldn't be edited.
</div>
</p>
<h2>Methods</h2>
<h3>[method:null add]( [param:object obj1], [param:object obj2], [param:object obj3], ... )</h3>
<div>
<p>
Adds an arbitrary number of objects to this *AnimationObjectGroup*.
</div>
</p>
<h3>[method:null remove]( [param:object obj1], [param:object obj2], [param:object obj3], ... )</h3>
<div>
<p>
Removes an arbitrary number of objects from this *AnimationObjectGroup*.
</div>
</p>
<h3>[method:null uncache]( [param:object obj1], [param:object obj2], [param:object obj3], ... )</h3>
<div>
<p>
Deallocates all memory resources for the passed objects of this *AnimationObjectGroup*.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,43 +10,43 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
An object with various functions to assist with animations, used internally.
</div>
</p>
<h2>Methods</h2>
<h3>[method:Array arraySlice]( array, from, to )</h3>
<div>
<p>
This is the same as Array.prototype.slice, but also works on typed arrays.
</div>
</p>
<h3>[method:Array convertArray]( array, type, forceClone )</h3>
<div>
<p>
Converts an array to a specific type.
</div>
</p>
<h3>[method:Array flattenJSON]( jsonKeys, times, values, valuePropertyName )</h3>
<div>
<p>
Used for parsing AOS keyframe formats.
</div>
</p>
<h3>[method:Array getKeyframeOrder]( times )</h3>
<div>
<p>
Returns an array by which times and values can be sorted.
</div>
</p>
<h3>[method:Boolean isTypedArray]( object )</h3>
<div>
<p>
Returns *true* if the object is a typed array.
</div>
</p>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
<div>
<p>
Sorts the array previously returned by [page:AnimationUtils.getKeyframeOrder getKeyframeOrder].
</div>
</p>
<h2>Source</h2>
......
......@@ -11,58 +11,73 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A KeyframeTrack is a timed sequence of [link:https://en.wikipedia.org/wiki/Key_frame keyframes],
which are composed of lists of times and related values, and which are used to animate a
specific property of an object.<br /><br />
specific property of an object.
</p>
<p>
For an overview of the different elements of the three.js animation system see the
"Animation System" article in the "Next Steps" section of the manual.<br /><br />
"Animation System" article in the "Next Steps" section of the manual.
</p>
<p>
In contrast to the animation hierarchy of the
[link:https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3 JSON model format] a
*KeyframeTrack* doesn't store its single keyframes as objects in a "keys" array (holding the
times and the values for each frame together in one place).<br /><br />
times and the values for each frame together in one place).
</p>
<p>
Instead of this there are always two arrays in a *KeyframeTrack*: the [page:.times times] array
stores the time values for all keyframes of this track in sequential order, and the
[page:.values values] array contains the corresponding changing values of the animated property.<br /><br />
[page:.values values] array contains the corresponding changing values of the animated property.
</p>
<p>
A single value, belonging to a certain point of time, can not only be a simple number, but (for
example) a vector (if a position is animated) or a quaternion (if a rotation is animated). For
this reason the values array (which is a flat array, too) might be three or four times as long as the
times array.<br /><br />
times array.
</p>
<p>
Corresponding to the different possible types of animated values there are several subclasses of
*KeyframeTrack*, inheriting the most properties and methods:
<ul>
<li>[page:BooleanKeyframeTrack]</li>
<li>[page:ColorKeyframeTrack]</li>
<li>[page:NumberKeyframeTrack]</li>
<li>[page:QuaternionKeyframeTrack]</li>
<li>[page:StringKeyframeTrack]</li>
<li>[page:VectorKeyframeTrack]</li>
</ul>
</p>
<ul>
<li>[page:BooleanKeyframeTrack]</li>
<li>[page:ColorKeyframeTrack]</li>
<li>[page:NumberKeyframeTrack]</li>
<li>[page:QuaternionKeyframeTrack]</li>
<li>[page:StringKeyframeTrack]</li>
<li>[page:VectorKeyframeTrack]</li>
</ul>
<p>
Some examples of how to manually create [page:AnimationClip AnimationClips] with different sorts
of KeyframeTracks can be found in the [link:https://threejs.org/examples/js/AnimationClipCreator.js]
file.<br /><br />
file.
</p>
<p>
Since explicit values are only specified for the discrete points of time stored in the times array,
all values in between have to be interpolated.<br /><br />
all values in between have to be interpolated.
</p>
<p>
The track's name is important for the connection of this track with a specific property of the
animated node (done by [page:PropertyBinding]).
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values], [param:Constant interpolation] )</h3>
<div>
<p>
[page:String name] - the identifier for the *KeyframeTrack*.<br />
[page:Array times] - an array of keyframe times, converted internally to a
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array].<br />
......@@ -70,163 +85,173 @@
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array].<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is [page:Animation InterpolateLinear].
</div>
</p>
<h2>Properties</h2>
<h3>[property:String name]</h3>
<div>
<p>
The track's name can refer to [page:Geometry.morphTargets morph targets] or
[page:SkinnedMesh bones] or possibly other values within an animated object. See
[page:PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property
binding:<br /><br />
binding:
</p>
<p>
The name can specify the node either using its name or its uuid (although it needs to be in the
subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot,
the track applies to the root node that was passed into the mixer.<br /><br />
the track applies to the root node that was passed into the mixer.
</p>
<p>
Usually after the node a property will be specified directly. But you can also specify a
subproperty, such as .rotation[x], if you just want to drive the X component of the rotation
via a float track.<br /><br />
via a float track.
</p>
<p>
You can also specify bones or multimaterials by using an object name, for example:
.bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a
materials array - as a further example - can be accessed with .materials[3].diffuse[r].<br /><br />
materials array - as a further example - can be accessed with .materials[3].diffuse[r].
</p>
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].<br /><br />
<p>
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
</p>
<p>
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same
property. The result should be based on a weighted blend between the multiple tracks according to
the weights of their respective actions.
</div>
</p>
<h3>[property:Float32Array times]</h3>
<div>
<p>
A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
converted from the times array which is passed in the constructor.
</div>
</p>
<h3>[property:Float32Array values]</h3>
<div>
<p>
A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
converted from the values array which is passed in the constructor.
</div>
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
<p>
The default interpolation type: [page:Animation InterpolateLinear].
</div>
</p>
<h3>[property:Constant TimeBufferType ]</h3>
<div>
<p>
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
the type of the buffer internally used for the times.
</div>
</p>
<h3>[property:Constant ValueBufferType ]</h3>
<div>
<p>
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
the type of the buffer internally used for the values.
</div>
</p>
<h2>Methods</h2>
<h3>[method:null createInterpolant]()</h3>
<div>
<p>
Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant]
or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation
parameter passed in the constructor.
</div>
</p>
<h3>[method:null getInterpolation]()</h3>
<div>
<p>
Returns the interpolation type.
</div>
</p>
<h3>[method:Number getValueSize]()</h3>
<div>
<p>
Returns the size of each value (that is the length of the [page:.values values] array divided
by the length of the [page:.times times] array).
</div>
</p>
<h3>[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array result] )</h3>
<div>
<p>
Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the
[page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be
passed which will receive the results. Otherwise a new array with the appropriate size will be
created automatically.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodLinear]( [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array result] )</h3>
<div>
<p>
Creates a new [page:LinearInterpolant LinearInterpolant] from the
[page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be
passed which will receive the results. Otherwise a new array with the appropriate size will be
created automatically.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodSmooth]( [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array result] )</h3>
<div>
<p>
Create a new [page:CubicInterpolant CubicInterpolant] from the
[page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be
passed which will receive the results. Otherwise a new array with the appropriate size will be
created automatically.
</div>
</p>
<h3>[method:null optimize]()</h3>
<div>
<p>
Removes equivalent sequential keys, which are common in morph target sequences. Called
automatically by the constructor.
</div>
</p>
<h3>[method:null scale]()</h3>
<div>
<p>
Scales all keyframe times by a factor.<br /><br />
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it
is done internally by
[page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
</div>
</p>
<h3>[method:null setInterpolation]( [param:Constant interpolationType] )</h3>
<div>
<p>
Sets the interpolation type. See [page:Animation Animation Constants] for choices.
</div>
</p>
<h3>[method:null shift]( [param:Number timeOffsetInSeconds] )</h3>
<div>
<p>
Moves all keyframes either forward or backward in time.
</div>
</p>
<h3>[method:null trim]( [param:Number startTimeInSeconds], [param:Number endTimeInSeconds] )</h3>
<div>
<p>
Removes keyframes before *startTime* and after *endTime*,
without changing any values within the range [*startTime*, *endTime*].
</div>
</p>
<h3>[method:null validate]()</h3>
<div>
<p>
Performs minimal validation on the tracks. Called automatically by the constructor.<br /><br />
This method logs errors to the console, if a track is empty, if the [page:.valueSize value size] is not valid, if an item
in the [page:.times times] or [page:.values values] array is not a valid number or if the items in the *times* array are out of order.
</div>
</p>
<h2>Static Methods</h2>
<h3>[method:KeyframeTrack parse]( [param:JSON json] )</h3>
<div>
<p>
Parses a JSON object and returns a new keyframe track of the correct type.
</div>
</p>
<h3>[method:JSON toJSON]( [param:KeyframeTrack track] )</h3>
<div>
<p>
Converts the track to JSON.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,99 +10,99 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
This holds a reference to a real property in the scene graph; used internally.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:Object3D rootNode], path, parsedPath )</h3>
<div>
<p>
-- [page:Object3D rootNode]:
-- path
-- parsedPath (optional)
</div>
</p>
<h2>Properties</h2>
<h3>[property:Number path]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Number parsedPath]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Number node]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Number rootNode]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Object BindingType]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Object Versioning]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Array GetterByBindingType]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Array SetterByBindingTypeAndVersioning]</h3>
<div>
<p>
</div>
</p>
<h2>Methods</h2>
<h3>[method:null getValue]( [param:Array targetArray], [param:Number offset] )</h3>
<div>
</div>
<p>
</p>
<h3>[method:null setValue]( [param:Array sourceArray], [param:Number offset] )</h3>
<div>
</div>
<p>
</p>
<h3>[method:null bind]( )</h3>
<div>
<p>
Create getter / setter pair for a property in the scene graph. Used internally by
[page:PropertyBinding.getValue getValue] and [page:PropertyBinding.setValue setValue].
</div>
</p>
<h3>[method:null unbind]( )</h3>
<div>
<p>
Unbind getter / setter pair for a property in the scene graph.
</div>
</p>
<h3>[method:Constructor Composite]( targetGroup, path, optionalParsedPath )</h3>
<div>
<p>
Create a new Composite PropertyBinding.
</div>
</p>
<h3>[method:Constructor create]( root, path, parsedPath )</h3>
<div>
<p>
Create a new Composite PropertyBinding (if root is an [page:AnimationObjectGroup]) or PropertyBinding.
</div>
</p>
<h3>[method:Constructor parseTrackName]( trackName )</h3>
<div>
<p>
Matches strings in the following forms:<br />
-- nodeName.property<br />
-- nodeName.property[accessor]<br />
......@@ -113,12 +113,12 @@
-- parentName/parentName/nodeName.property[index]<br />
-- .bone[Armature.DEF_cog].position<br />
-- scene:helium_balloon_model:helium_balloon_model.position
</div>
</p>
<h3>[method:Constructor findNode]( root, nodeName )</h3>
<div>
<p>
Find a node in a node tree or [page:Skeleton Skeleton].
</div>
</p>
......
......@@ -10,85 +10,84 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Buffered scene graph property that allows weighted accumulation; used internally.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( binding, typeName, valueSize )</h3>
<div>
<p>
-- binding <br />
-- typeName <br />
-- valueSize <br />
</div>
</p>
<h2>Properties</h2>
<h3>[property:Number binding]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Number buffer]</h3>
<div>
<p>
Buffer with size [page:PropertyMixer valueSize] * 4. <br /><br />
This has the layout: [ incoming | accu0 | accu1 | orig ]<br /><br />
Interpolators can use .buffer as their .result and the data then goes to 'incoming'.<br />
Interpolators can use .buffer as their .result and the data then goes to 'incoming'.
'accu0' and 'accu1' are used frame-interleaved for the cumulative result and
are compared to detect changes.<br />
'orig' stores the original state of the property.<br />
</div>
are compared to detect changes. 'orig' stores the original state of the property.
</p>
<h3>[property:Number cumulativeWeight]</h3>
<div>
<p>
Default is *0*.
</div>
</p>
<h3>[property:Number valueSize]</h3>
<div>
<p>
</div>
</p>
<h3>[property:Number referenceCount]</h3>
<div>
<p>
Default is *0*.
</div>
</p>
<h3>[property:Number useCount]</h3>
<div>
<p>
Default is *0*.
</div>
</p>
<h2>Methods</h2>
<h3>[method:null accumulate]( accuIndex, weight )</h3>
<div>
<p>
Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.<br />
If weight is *0* this does nothing.
</div>
</p>
<h3>[method:null apply]( accuIndex )</h3>
<div>
<p>
Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
</div>
</p>
<h3>[method:null saveOriginalState]( )</h3>
<div>
<p>
Remember the state of the bound property and copy it to both accus.
</div>
</p>
<h3>[method:null restoreOriginalState]( )</h3>
<div>
<p>
Apply the state previously taken via 'saveOriginalState' to the binding.
</div>
</p>
<h2>Source</h2>
......
......@@ -13,61 +13,61 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A Track of boolean keyframe values.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<div>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
</div>
</p>
<h2>Properties</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
</div>
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
<p>
The default interpolation type to use, [page:Animation InterpolateDiscrete].
</div>
</p>
<h3>[property:Array ValueBufferType]</h3>
<div>
<p>
A normal Array (no Float32Array in this case, unlike *ValueBufferType* of [page:KeyframeTrack]).
</div>
</p>
<h3>[property:String ValueTypeName]</h3>
<div>
<p>
String 'bool'.
</div>
</p>
<h2>Methods</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodLinear ]()</h3>
<div>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodSmooth ]()</h3>
<div>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
</p>
<h2>Source</h2>
......
......@@ -13,46 +13,46 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A Track of keyframe values that represent color changes.<br /><br />
The very basic implementation of this subclass has nothing special yet. However, this is the place
for color space parameterization.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<div>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:Animation InterpolateLinear].
</div>
</p>
<h2>Properties</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
</div>
</p>
<h3>[property:String ValueTypeName]</h3>
<div>
<p>
String 'color'.
</div>
</p>
<h2>Methods</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
</div>
</p>
<h2>Source</h2>
......
......@@ -13,45 +13,45 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A Track of numeric keyframe values.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<div>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:Animation InterpolateLinear].
</div>
</p>
<h2>Properties</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
</div>
</p>
<h3>[property:String ValueTypeName]</h3>
<div>
<p>
String 'number'.
</div>
</p>
<h2>Methods</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
</div>
</p>
<h2>Source</h2>
......
......@@ -13,56 +13,56 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A Track of quaternion keyframe values.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<div>
<p>
[page:String name] (required) identifier for the KeyframeTrack.<br />
[page:Array times] (required) array of keyframe times.<br />
[page:Array values] values for the keyframes at the times specified.<br />
[page:Constant interpolation] the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:Animation InterpolateLinear].
</div>
</p>
<h2>Properties</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
</div>
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
<p>
The default interpolation type to use, [page:Animation InterpolateLinear].
</div>
</p>
<h3>[property:String ValueTypeName]</h3>
<div>
<p>
String 'quaternion'.
</div>
</p>
<h2>Methods</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodLinear]()</h3>
<div>
<p>
Returns a new [page:QuaternionLinearInterpolant QuaternionLinearInterpolant] based on the
[page:KeyframeTrack.values values], [page:KeyframeTrack.times times] and
[page:KeyframeTrack.valueSize valueSize] of the keyframes.
</div>
</p>
<h2>Source</h2>
......
......@@ -13,64 +13,64 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A Track of string keyframe values.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<div>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:Animation InterpolateDiscrete].
</div>
</p>
<h2>Properties</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
</div>
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
<p>
The default interpolation type to use, [page:Animation InterpolateDiscrete].
</div>
</p>
<h3>[property:Array ValueBufferType]</h3>
<div>
<p>
A normal Array (no Float32Array in this case, unlike *ValueBufferType* of [page:KeyframeTrack]).
</div>
</p>
<h3>[property:String ValueTypeName]</h3>
<div>
<p>
String 'string'.
</div>
</p>
<h2>Methods</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodLinear]()</h3>
<div>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
</p>
<h3>[method:null InterpolantFactoryMethodSmooth]()</h3>
<div>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
</p>
<h2>Source</h2>
......
......@@ -13,44 +13,44 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
A Track of vector keyframe values.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<div>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:Animation InterpolateLinear].
</div>
</p>
<h2>Properties</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
</div>
</p>
<h3>[property:String ValueTypeName]</h3>
<div>
<p>
String 'vector'.
</div>
</p>
<h2>Methods</h2>
<div class="desc">
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,19 +12,19 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Create a non-positional ( global ) audio object.<br /><br />
This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].
</div>
</p>
<h2>Example</h2>
<div>
<p>
[example:webaudio_sandbox webaudio / sandbox ]</br>
[example:webaudio_visualizer webaudio / visualizer ]
</div>
</p>
<code>
// create an AudioListener and add it to the camera
......@@ -49,158 +49,158 @@
<h3>[name]( [param:AudioListener listener] )</h3>
<div>
<p>
listener — (required) [page:AudioListener AudioListener] instance.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Boolean autoplay]</h3>
<div>Whether to start playback automatically. Default is *false*.</div>
<p>Whether to start playback automatically. Default is *false*.</p>
<h3>[property:AudioContext context]</h3>
<div>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</div>
<p>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</p>
<h3>[property:Array filters]</h3>
<div>Represents an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]. Can be used to apply a variety of low-order filters to create more complex sound effects. Filters are set via [page:Audio.setFilter] or [page:Audio.setFilters].</div>
<p>Represents an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]. Can be used to apply a variety of low-order filters to create more complex sound effects. Filters are set via [page:Audio.setFilter] or [page:Audio.setFilters].</p>
<h3>[property:GainNode gain]</h3>
<div>A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created
using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().</div>
<p>A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created
using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().</p>
<h3>[property:Boolean hasPlaybackControl]</h3>
<div>Whether playback can be controlled using the [page:Audio.play play](),
[page:Audio.pause pause]() etc. methods. Default is *true*.</div>
<p>Whether playback can be controlled using the [page:Audio.play play](),
[page:Audio.pause pause]() etc. methods. Default is *true*.</p>
<h3>[property:Number playbackRate]</h3>
<div>Speed of playback. Default is *1*.</div>
<p>Speed of playback. Default is *1*.</p>
<h3>[property:Boolean isPlaying]</h3>
<div>Whether the audio is currently playing.</div>
<p>Whether the audio is currently playing.</p>
<h3>[property:Number startTime]</h3>
<div>The time at which the sound should begin to play. Same as the *when* paramter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is *0*.</div>
<p>The time at which the sound should begin to play. Same as the *when* paramter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is *0*.</p>
<h3>[property:Number offset]</h3>
<div>An offset to the time within the audio buffer that playback should begin. Same as the *offset* paramter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is *0*.</div>
<p>An offset to the time within the audio buffer that playback should begin. Same as the *offset* paramter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is *0*.</p>
<h3>[property:String source]</h3>
<div>An [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode AudioBufferSourceNode] created
using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource AudioContext.createBufferSource]().</div>
<p>An [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode AudioBufferSourceNode] created
using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource AudioContext.createBufferSource]().</p>
<h3>[property:String sourceType]</h3>
<div>Type of the audio source. Default is string 'empty'.</div>
<p>Type of the audio source. Default is string 'empty'.</p>
<h3>[property:String type]</h3>
<div>String denoting the type, set to 'Audio'.</div>
<p>String denoting the type, set to 'Audio'.</p>
<h2>Methods</h2>
<h3>[method:null connect]()</h3>
<div>
<p>
Connect to the [page:Audio.source]. This is used internally on initialisation and when
setting / removing filters.
</div>
</p>
<h3>[method:null disconnect]()</h3>
<div>
<p>
Disconnect from the [page:Audio.source]. This is used internally when
setting / removing filters.
</div>
</p>
<h3>[method:Array getFilter]()</h3>
<div>
<p>
Returns the first element of the [page:Audio.filters filters] array.
</div>
</p>
<h3>[method:null getFilters]()</h3>
<div>
<p>
Returns the [page:Audio.filters filters] array.
</div>
</p>
<h3>[method:Boolean getLoop]()</h3>
<div>
<p>
Return the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop]
(whether playback should loop).
</div>
</p>
<h3>[method:GainNode getOutput]()</h3>
<div>
<p>
Return the [page:Audio.gain gainNode].
</div>
</p>
<h3>[method:Number getPlaybackRate]()</h3>
<div>
<p>
Return the value of [page:Audio.playbackRate playbackRate].
</div>
</p>
<h3>[method:Number getVolume]( value )</h3>
<div>
<p>
Return the current volume.
</div>
</p>
<h3>[method:null play]()</h3>
<div>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, starts playback.
</div>
</p>
<h3>[method:null pause]()</h3>
<div>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, pauses playback.
</div>
</p>
<h3>[method:null onEnded]()</h3>
<div>
<p>
Called automatically when playback finished. Sets If [page:Audio.isPlaying isPlaying] to false.
</div>
</p>
<h3>[method:Audio setBuffer]( audioBuffer )</h3>
<div>
<p>
Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'buffer'.<br />
If [page:Audio.autoplay autoplay], also starts playback.
</div>
</p>
<h3>[method:null setFilter]( filter )</h3>
<div>
<p>
Applies a single [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNode] to the audio.
</div>
</p>
<h3>[method:Audio setFilters]( [param:Array value] )</h3>
<div>
<p>
value - arrays of filters.<br />
Applies an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes] to the audio.
</div>
</p>
<h3>[method:null setLoop]( [param:Boolean value] )</h3>
<div>
<p>
Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] to *value*
(whether playback should loop).
</div>
</p>
<h3>[method:null setNodeSource]( audioNode )</h3>
<div>
<p>
Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'audioNode'.<br />
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
</div>
</p>
<h3>[method:null setPlaybackRate]( [param:Number value] )</h3>
<div>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, set the [page:Audio.playbackRate playbackRate] to *value*.
</div>
</p>
<h3>[method:null setVolume]( [param:Number value] )</h3>
<div>
<p>
Set the volume.
</div>
</p>
<h3>[method:null stop]()</h3>
<div>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, stops playback,
resets [page:Audio.startTime startTime] to *0* and sets [page:Audio.isPlaying isPlaying] to false.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,21 +10,21 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Create a AudioAnalyser object, which uses an [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode AnalyserNode]
to analyse audio data.<br /><br />
This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].
</div>
</p>
<h2>Example</h2>
<div>
<p>
[example:webaudio_sandbox webaudio / sandbox ]</br>
[example:webaudio_visualizer webaudio / visualizer ]
</div>
</p>
<code>
// create an AudioListener and add it to the camera
......@@ -55,42 +55,42 @@
<h3>[name]( audio, [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize fftSize] )</h3>
<div>
<p>
Create a new [page:AudioAnalyser AudioAnalyser].
</div>
</p>
<h2>Properties</h2>
<h3>[property:AnalyserNode analyser]</h3>
<div>An [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode AnalyserNode] used to analyze audio.</div>
<p>An [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode AnalyserNode] used to analyze audio.</p>
<h3>[property:Integer fftSize]</h3>
<div>
A non-zero power of two up to 2048, representing the size of the FFT (Fast Fourier Transform) to be used to determine the frequency domain.<br />
<p>
A non-zero power of two up to 2048, representing the size of the FFT (Fast Fourier Transform) to be used to determine the frequency domain.
See [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize this page] for details.
</div>
</p>
<h3>[property:Uint8Array data]</h3>
<div>
<p>
A Uint8Array with size determined by [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/frequencyBinCount analyser.frequencyBinCount]
used to hold analysis data.
</div>
</p>
<h2>Methods</h2>
<h3>[method:Uint8Array getFrequencyData]()</h3>
<div>
<p>
Uses the Web Audio's [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData getByteFrequencyData] method.
See that page.
</div>
</p>
<h3>[method:Number getAverageFrequency]()</h3>
<div>
<p>
Get the average of the frequencies returned by the [page:AudioAnalyser.getFrequencyData getFrequencyData] method.
</div>
</p>
<h2>Source</h2>
......
......@@ -11,28 +11,28 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
This contains methods for setting up an [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext].<br /><br />
Used internally by the [page:AudioListener AudioListener] and [page:AudioLoader AudioLoader] classes.<br /><br />
This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].
</div>
</p>
<h2>Methods</h2>
<h3>[method:AudioContext getContext]()</h3>
<div>
<p>
Return the value of the variable *context* in the outer scope, if defined,
otherwise set it to a new [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext].
</div>
</p>
<h3>[method:AudioContext setContext]( [param:AudioConetxt value] )</h3>
<div>
<p>
Set the variable *context* in the outer scope to *value*.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,20 +12,20 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
The [name] represents a virtual [link:https://developer.mozilla.org/de/docs/Web/API/AudioListener listener] of the all positional and non-positional audio effects in the scene.</br>
A three.js application usually creates a single instance of [name]. It is a mandatory construtor parameter for audios entities like [page:Audio Audio] and [page:PositionalAudio PositionalAudio].</br>
In most cases, the listener object is a child of the camera. So the 3D transformation of the camera represents the 3D transformation of the listener.
</div>
</p>
<h2>Example</h2>
<div>
<p>
[example:webaudio_sandbox webaudio / sandbox ]</br>
[example:webaudio_timing webaudio / timing ]</br>
[example:webaudio_visualizer webaudio / visualizer ]
</div>
</p>
<code>
// create an AudioListener and add it to the camera
......@@ -50,56 +50,56 @@
<h3>[name]( )</h3>
<div>
<p>
Create a new AudioListener.
</div>
</p>
<h2>Properties</h2>
<h3>[property:AudioContext context]</h3>
<div>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</div>
<p>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</p>
<h3>[property:GainNode gain]</h3>
<div>A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created
using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().</div>
<p>A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created
using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().</p>
<h3>[property:AudioNode filter]</h3>
<div>Default is *null*.</div>
<p>Default is *null*.</p>
<h2>Methods</h2>
<h3>[method:GainNode getInput]()</h3>
<div>
<p>
Return the [page:AudioListener.gain gainNode].
</div>
</p>
<h3>[method:null removeFilter]()</h3>
<div>
<p>
Set the [page:AudioListener.filter filter] property to *null*.
</div>
</p>
<h3>[method:AudioNode getFilter]()</h3>
<div>
<p>
Returns the value of the [page:AudioListener.filter filter] property.
</div>
</p>
<h3>[method:null setFilter]( [param:AudioNode value] )</h3>
<div>
<p>
Set the [page:AudioListener.filter filter] property to *value*.
</div>
</p>
<h3>[method:Number getMasterVolume]()</h3>
<div>
<p>
Return the volume.
</div>
</p>
<h3>[method:null setMasterVolume]( [param:Number value] )</h3>
<div>
<p>
Set the volume.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,19 +12,19 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Create a positional audio object.<br /><br />
This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].
</div>
</p>
<h2>Example</h2>
<div>
<p>
[example:webaudio_sandbox webaudio / sandbox ]</br>
[example:webaudio_timing webaudio / timing ]
</div>
</p>
<code>
// create an AudioListener and add it to the camera
......@@ -56,71 +56,71 @@
<h2>Constructor</h2>
<h3>[name]( [param:AudioListener listener] )</h3>
<div>
<p>
listener — (required) [page:AudioListener AudioListener] instance.
</div>
</p>
<h2>Properties</h2>
<div>
<p>
See the [page:Audio Audio] class for inherited properties.
</div>
</p>
<h3>[property:PannerNode panner]</h3>
<div>The PositionalAudio's [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode PannerNode].</div>
<p>The PositionalAudio's [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode PannerNode].</p>
<h2>Methods</h2>
<div>
<p>
See the [page:Audio Audio] class for inherited methods.
</div>
</p>
<h3>[method:PannerNode getOutput]()</h3>
<div>
<p>
Returns the [page:PositionalAudio.panner panner].
</div>
</p>
<h3>[method:Number getRefDistance]()</h3>
<div>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
</div>
</p>
<h3>[method:PannerNode setRefDistance]( [param:Number value] )</h3>
<div>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
</div>
</p>
<h3>[method:PannerNode getRolloffFactor]()</h3>
<div>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
</div>
</p>
<h3>[method:PannerNode setRolloffFactor]( [param:Number value] )</h3>
<div>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
</div>
</p>
<h3>[method:String getDistanceModel]()</h3>
<div>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
</div>
</p>
<h3>[method:String setDistanceModel]( [param:String value] )</h3>
<div>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
</div>
</p>
<h3>[method:PannerNode getMaxDistance]()</h3>
<div>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
</div>
</p>
<h3>[method:PannerNode setMaxDistance]( [param:Number value] )</h3>
<div>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
</div>
</p>
<h2>Source</h2>
......
......@@ -12,33 +12,33 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
[name] can be used in order to efficiently render a scene with a predefined set of cameras. This is an important performance aspect for rendering VR scenes.<br />
An instance of [name] always has an array of sub cameras. It's mandatory to define for each sub camera the *bounds* property which determines the part of the viewport that is rendered with this camera.
</div>
</p>
<h2>Example</h2>
<div>[example:webgl_camera_array camera / array ]</div>
<p>[example:webgl_camera_array camera / array ]</p>
<h2>Constructor</h2>
<h3>[name]( [param:Array array] )</h3>
<div>
<p>
An array of cameras.
</div>
</p>
<h2>Properties</h2>
<div>See the base [page:PerspectiveCamera] class for common properties.</div>
<p>See the base [page:PerspectiveCamera] class for common properties.</p>
<h3>[property:Array cameras]</h3>
<div>
<p>
An array of cameras.
</div>
</p>
<h2>Methods</h2>
<div>See the base [page:PerspectiveCamera] class for common methods.</div>
<p>See the base [page:PerspectiveCamera] class for common methods.</p>
<h2>Source</h2>
......
......@@ -12,70 +12,70 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Abstract base class for cameras. This class should always be inherited when you build a new camera.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]()</h3>
<div>
<p>
Creates a new [name]. Note that this class is not intended to be called directly;
you probably want a [page:PerspectiveCamera] or [page:OrthographicCamera] instead.
</div>
</p>
<h2>Properties</h2>
<div>See the base [page:Object3D] class for common properties.</div>
<p>See the base [page:Object3D] class for common properties.</p>
<h3>[property:Boolean isCamera]</h3>
<div>
<p>
Used to check whether this or derived classes are cameras. Default is *true*.<br /><br />
You should not change this, as it used internally by the renderer for optimisation.
</div>
</p>
<h3>[property:Layers layers]</h3>
<div>
<p>
The [page:Layers layers] that the camera is a member of. This is an inherited
property from [page:Object3D].<br /><br />
Objects must share at least one layer with the camera to be seen
when the camera's viewpoint is rendered.
</div>
</p>
<h3>[property:Matrix4 matrixWorldInverse]</h3>
<div>
<p>
This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has
the world transform of the Camera.
</div>
</p>
<h3>[property:Matrix4 projectionMatrix]</h3>
<div>This is the matrix which contains the projection.</div>
<p>This is the matrix which contains the projection.</p>
<h2>Methods</h2>
<div>See the base [page:Object3D] class for common methods.</div>
<p>See the base [page:Object3D] class for common methods.</p>
<h3>[method:Camera clone]( )</h3>
<div>
<p>
Return a new camera with the same properties as this one.
</div>
</p>
<h3>[method:Camera copy]( [param:Camera source] )</h3>
<div>
<p>
Copy the properties from the source camera into this one.
</div>
</p>
<h3>[method:Vector3 getWorldDirection]( [param:Vector3 target] )</h3>
<div>
<p>
[page:Vector3 target] — the result will be copied into this Vector3. <br /><br />
Returns a [page:Vector3] representing the world space direction in which the camera is looking.
(Note: A camera looks down its local, negative z-axis).<br /><br />
</p>
<h2>Source</h2>
......
......@@ -12,13 +12,13 @@
<h1>[name]</h1>
<div class="desc">Creates 6 cameras that render to a [page:WebGLRenderTargetCube].</div>
<p class="desc">Creates 6 cameras that render to a [page:WebGLRenderTargetCube].</p>
<h2>Examples</h2>
<div>[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]</div>
<div>[example:webgl_materials_cubemap_dynamic2 materials / cubemap / dynamic2 ]</div>
<div>[example:webgl_shading_physical shading / physical ]</div>
<p>[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]</p>
<p>[example:webgl_materials_cubemap_dynamic2 materials / cubemap / dynamic2 ]</p>
<p>[example:webgl_shading_physical shading / physical ]</p>
<code>// Create cube camera
var cubeCamera = new THREE.CubeCamera( 1, 100000, 128 );
......@@ -44,43 +44,43 @@
<h3>[name]( [param:Number near], [param:Number far], [param:Number cubeResolution] )</h3>
<div>
<p>
near -- The near clipping distance. <br />
far -- The far clipping distance <br />
cubeResolution -- Sets the length of the cube's edges.
</div>
<div>
</p>
<p>
Constructs a CubeCamera that contains 6 [page:PerspectiveCamera PerspectiveCameras] that
render to a [page:WebGLRenderTargetCube].
</div>
</p>
<h2>Properties</h2>
<div>See the base [page:Object3D] class for common properties.</div>
<p>See the base [page:Object3D] class for common properties.</p>
<h3>[property:WebGLRenderTargetCube renderTarget]</h3>
<div>
<p>
The cube texture that gets generated.
</div>
</p>
<h2>Methods</h2>
<div>See the base [page:Object3D] class for common methods.</div>
<p>See the base [page:Object3D] class for common methods.</p>
<h3>[method:null update]( [param:WebGLRenderer renderer], [param:Scene scene] )</h3>
<div>
<p>
renderer -- The current WebGL renderer <br />
scene -- The current scene
</div>
<div>
</p>
<p>
Call this to update the [page:CubeCamera.renderTarget renderTarget].
</div>
</p>
<h3>[method:null clear]( [param:WebGLRenderer renderer], [param:Boolean color], [param:Boolean depth], [param:Boolean stencil] )</h3>
<div>
<p>
Call this to clear the [page:CubeCamera.renderTarget renderTarget] color, depth, and/or stencil buffers.
The color buffer is set to the renderer's current clear color. Arguments default to *true*.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,29 +12,29 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Camera that uses [link:https://en.wikipedia.org/wiki/Orthographic_projection orthographic projection].<br /><br />
In this projection mode, an object's size in the rendered image stays constant
regardless of its distance from the camera.<br /><br />
This can be useful for rendering 2D scenes and UI elements, amongst other things.
</div>
</p>
<h2>Example</h2>
<div>[example:canvas_camera_orthographic camera / orthographic ]</div>
<div>[example:webgl_camera camera ]</div>
<div>[example:webgl_interactive_cubes_ortho interactive / cubes / ortho ]</div>
<div>[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]</div>
<div>[example:webgl_postprocessing_advanced postprocessing / advanced ]</div>
<div>[example:webgl_postprocessing_dof2 postprocessing / dof2 ]</div>
<div>[example:webgl_postprocessing_godrays postprocessing / godrays ]</div>
<div>[example:webgl_rtt rtt ]</div>
<div>[example:webgl_shaders_tonemapping shaders / tonemapping ]</div>
<div>[example:webgl_shadowmap shadowmap ]</div>
<div>[example:webgl_terrain_dynamic terrain / dynamic ]</div>
<p>[example:canvas_camera_orthographic camera / orthographic ]</p>
<p>[example:webgl_camera camera ]</p>
<p>[example:webgl_interactive_cubes_ortho interactive / cubes / ortho ]</p>
<p>[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]</p>
<p>[example:webgl_postprocessing_advanced postprocessing / advanced ]</p>
<p>[example:webgl_postprocessing_dof2 postprocessing / dof2 ]</p>
<p>[example:webgl_postprocessing_godrays postprocessing / godrays ]</p>
<p>[example:webgl_rtt rtt ]</p>
<p>[example:webgl_shaders_tonemapping shaders / tonemapping ]</p>
<p>[example:webgl_shadowmap shadowmap ]</p>
<p>[example:webgl_terrain_dynamic terrain / dynamic ]</p>
<code>var camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );
scene.add( camera );</code>
......@@ -44,7 +44,7 @@ scene.add( camera );</code>
<h3>[name]( [param:Number left], [param:Number right], [param:Number top], [param:Number bottom], [param:Number near], [param:Number far] )</h3>
<div>
<p>
left — Camera frustum left plane.<br />
right — Camera frustum right plane.<br />
top — Camera frustum top plane.<br />
......@@ -53,62 +53,62 @@ scene.add( camera );</code>
far — Camera frustum far plane.<br /><br />
Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
</div>
</p>
<h2>Properties</h2>
<div>
<p>
See the base [page:Camera] class for common properties.<br>
Note that after making changes to most of these properties you will have to call
[page:OrthographicCamera.updateProjectionMatrix .updateProjectionMatrix] for the changes to take effect.
</div>
</p>
<h3>[property:Float bottom]</h3>
<div>Camera frustum bottom plane.</div>
<p>Camera frustum bottom plane.</p>
<h3>[property:Float far]</h3>
<div>
<p>
Camera frustum far plane. Default is *2000*.<br /><br />
The valid range is between the current value of the [page:.near near] plane and infinity.
</div>
</p>
<h3>[property:Boolean isOrthographicCamera]</h3>
<div>
<p>
Used to test whether this or derived classes are OrthographicCameras. Default is *true*.<br /><br />
This should not be changed as it is used internally by the renderer for optimisation.
</div>
</p>
<h3>[property:Float left]</h3>
<div>Camera frustum left plane.</div>
<p>Camera frustum left plane.</p>
<h3>[property:Float near]</h3>
<div>
<p>
Camera frustum near plane. Default is *0.1*.<br /><br />
The valid range is between 0 and the current value of the [page:.far far] plane.
Note that, unlike for the [page:PerspectiveCamera], *0* is a valid value for an
OrthographicCamera's near plane.
</div>
</p>
<h3>[property:Float right]</h3>
<div>Camera frustum right plane.</div>
<p>Camera frustum right plane.</p>
<h3>[property:Float top]</h3>
<div>Camera frustum top plane.</div>
<p>Camera frustum top plane.</p>
<h3>[property:Object view]</h3>
<div>Set by [page:OrthographicCamera.setViewOffset setViewOffset]. Default is *null*.</div>
<p>Set by [page:OrthographicCamera.setViewOffset setViewOffset]. Default is *null*.</p>
<h3>[property:number zoom]</h3>
<div>Gets or sets the zoom factor of the camera. Default is *1*.</div>
<p>Gets or sets the zoom factor of the camera. Default is *1*.</p>
<h2>Methods</h2>
<div>See the base [page:Camera] class for common methods.</div>
<p>See the base [page:Camera] class for common methods.</p>
<h3>[method:null setViewOffset]( [param:Float fullWidth], [param:Float fullHeight], [param:Float x], [param:Float y], [param:Float width], [param:Float height] )</h3>
<div>
<p>
fullWidth — full width of multiview setup<br />
fullHeight — full height of multiview setup<br />
x — horizontal offset of subcamera<br />
......@@ -119,22 +119,22 @@ scene.add( camera );</code>
Sets an offset in a larger [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
This is useful for multi-window or multi-monitor/multi-machine setups.
For an example on how to use it see [page:PerspectiveCamera.setViewOffset PerspectiveCamera].
</div>
</p>
<h3>[method:null clearViewOffset]()</h3>
<div>
<p>
Removes any offset set by the .setViewOffset method.
</div>
</p>
<h3>[method:null updateProjectionMatrix]()</h3>
<div>
<p>
Updates the camera projection matrix. Must be called after any change of parameters.
</div>
</p>
<h3>[method:JSON toJSON]()</h3>
<div>
<p>
Return the camera's data in JSON format.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,23 +12,23 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Camera that uses [link:https://en.wikipedia.org/wiki/Perspective_(graphical) perspective projection].<br /><br />
This projection mode is designed to mimic the way the human eye sees. It is the most
common projection mode used for rendering a 3D scene.
</div>
</p>
<h2>Example</h2>
<div>[example:canvas_geometry_birds geometry / birds ]</div>
<div>[example:canvas_geometry_cube geometry / cube ]</div>
<div>[example:webgl_animation_skinning_blending animation / skinning / blending ]</div>
<div>[example:webgl_animation_skinning_morph animation / skinning / blending ]</div>
<div>[example:webgl_effects_stereo effects / stereo ]</div>
<div>[example:webgl_interactive_cubes interactive / cubes ]</div>
<div>[example:webgl_loader_collada_skinning loader / collada / skinning ]</div>
<p>[example:canvas_geometry_birds geometry / birds ]</p>
<p>[example:canvas_geometry_cube geometry / cube ]</p>
<p>[example:webgl_animation_skinning_blending animation / skinning / blending ]</p>
<p>[example:webgl_animation_skinning_morph animation / skinning / blending ]</p>
<p>[example:webgl_effects_stereo effects / stereo ]</p>
<p>[example:webgl_interactive_cubes interactive / cubes ]</p>
<p>[example:webgl_loader_collada_skinning loader / collada / skinning ]</p>
<code>var camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );
scene.add( camera );</code>
......@@ -37,122 +37,122 @@ scene.add( camera );</code>
<h2>Constructor</h2>
<h3>[name]( [param:Number fov], [param:Number aspect], [param:Number near], [param:Number far] )</h3>
<div>
<p>
fov — Camera frustum vertical field of view.<br />
aspect — Camera frustum aspect ratio.<br />
near — Camera frustum near plane.<br />
far — Camera frustum far plane.<br /><br />
Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
</div>
</p>
<h2>Properties</h2>
<div>
<p>
See the base [page:Camera] class for common properties.<br>
Note that after making changes to most of these poperties you will have to call
[page:PerspectiveCamera.updateProjectionMatrix .updateProjectionMatrix] for the changes to take effect.
</div>
</p>
<h3>[property:Float aspect]</h3>
<div>Camera frustum aspect ratio, usually the canvas width / canvas height. Default is *1* (square canvas).</div>
<p>Camera frustum aspect ratio, usually the canvas width / canvas height. Default is *1* (square canvas).</p>
<h3>[property:Float far]</h3>
<div>
<p>
Camera frustum far plane. Default is *2000*.<br /><br />
The valid range is between the current value of the [page:.near near] plane and infinity.
</div>
</p>
<h3>[property:Float filmGauge]</h3>
<div>Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.</div>
<p>Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.</p>
<h3>[property:Float filmOffset]</h3>
<div>Horizontal off-center offset in the same unit as .filmGauge. Default is *0*.</div>
<p>Horizontal off-center offset in the same unit as .filmGauge. Default is *0*.</p>
<h3>[property:Float focus]</h3>
<div>Object distance used for stereoscopy and depth-of-field effects.
<p>Object distance used for stereoscopy and depth-of-field effects.
This parameter does not influence the projection matrix unless a [page:StereoCamera] is being used.
Default is *10*.
</div>
</p>
<h3>[property:Float fov]</h3>
<div>Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is *50*.</div>
<p>Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is *50*.</p>
<h3>[property:Boolean isPerspectiveCamera]</h3>
<div>
<p>
Used to test whether this or derived classes are PerspectiveCameras. Default is *true*.<br /><br />
This should not be changed as it is used internally by the renderer for optimisation.
</div>
</p>
<h3>[property:Float near]</h3>
<div>
<p>
Camera frustum near plane. Default is *0.1*.<br /><br />
The valid range is greater than 0 and less than the current value of the [page:.far far] plane.
Note that, unlike for the [page:OrthographicCamera], *0* is <em>not</em> a valid value
for a PerspectiveCamera's near plane.
</div>
</p>
<h3>[property:Object view]</h3>
<div>
<p>
Frustum window specification or null.
This is set using the [page:PerspectiveCamera.setViewOffset .setViewOffset] method
and cleared using [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
</div>
</p>
<h3>[property:number zoom]</h3>
<div>Gets or sets the zoom factor of the camera. Default is *1*.</div>
<p>Gets or sets the zoom factor of the camera. Default is *1*.</p>
<h2>Methods</h2>
<div>See the base [page:Camera] class for common methods.</div>
<p>See the base [page:Camera] class for common methods.</p>
<h3>[method:null clearViewOffset]()</h3>
<div>Removes any offset set by the [page:PerspectiveCamera.setViewOffset .setViewOffset] method.</div>
<p>Removes any offset set by the [page:PerspectiveCamera.setViewOffset .setViewOffset] method.</p>
<h3>[method:Float getEffectiveFOV]()</h3>
<div>Returns the current vertical field of view angle in degrees considering .zoom.</div>
<p>Returns the current vertical field of view angle in degrees considering .zoom.</p>
<h3>[method:Float getFilmHeight]()</h3>
<div>
<p>
Returns the height of the image on the film. If .aspect is less than or equal to one
(portrait format), the result equals .filmGauge.
</div>
</p>
<h3>[method:Float getFilmWidth]()</h3>
<div>
<p>
Returns the width of the image on the film. If .aspect is greater than or equal to one
(landscape format), the result equals .filmGauge.
</div>
</p>
<h3>[method:Float getFocalLength]()</h3>
<div>Returns the focal length of the current .fov in respect to .filmGauge.</div>
<p>Returns the focal length of the current .fov in respect to .filmGauge.</p>
<h3>[method:null setFocalLength]( [param:Float focalLength] )</h3>
<div>
<p>
Sets the FOV by focal length in respect to the current [page:PerspectiveCamera.filmGauge .filmGauge].<br /><br />
By default, the focal length is specified for a 35mm (full frame) camera.
</div>
</p>
<h3>[method:null setViewOffset]( [param:Float fullWidth], [param:Float fullHeight], [param:Float x], [param:Float y], [param:Float width], [param:Float height] )</h3>
<div>
<p>
fullWidth — full width of multiview setup<br />
fullHeight — full height of multiview setup<br />
x — horizontal offset of subcamera<br />
y — vertical offset of subcamera<br />
width — width of subcamera<br />
height — height of subcamera
</div>
</p>
<div>
<p>
Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
</div>
</p>
<div>
<p>
For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:<br />
<pre>
......@@ -185,17 +185,17 @@ camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
</code>
Note there is no reason monitors have to be the same size or in a grid.
</div>
</p>
<h3>[method:null updateProjectionMatrix]()</h3>
<div>
<p>
Updates the camera projection matrix. Must be called after any change of parameters.
</div>
</p>
<h3>[method:JSON toJSON]()</h3>
<div>
<p>
Return camera data in JSON format.
</div>
</p>
<h2>Source</h2>
......
......@@ -11,25 +11,25 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Dual [page:PerspectiveCamera PerspectiveCamera]s used for effects such as
[link:https://en.wikipedia.org/wiki/Anaglyph_3D 3D Anaglyph] or [link:https://en.wikipedia.org/wiki/parallax_barrier Parallax Barrier].
</div>
</p>
<h2>Example</h2>
<div>[example:webgl_effects_anaglyph effects / anaglyph ]</div>
<div>[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]</div>
<div>[example:webgl_effects_stereo effects / stereo ]</div>
<p>[example:webgl_effects_anaglyph effects / anaglyph ]</p>
<p>[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]</p>
<p>[example:webgl_effects_stereo effects / stereo ]</p>
<div>
<p>
This class is used internally in the files<br /><br />
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/effects/AnaglyphEffect.js examples/js/effects/AnaglyphEffect.js]<br /><br />
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/effects/ParallaxBarrierEffect.js examples/js/effects/ParallaxBarrierEffect.js]<br /><br />
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/effects/StereoEffect.js examples/js/effects/StereoEffect.js]<br /><br />
used in the above examples.
</div>
</p>
<h2>Constructor</h2>
......@@ -39,26 +39,26 @@
<h2>Properties</h2>
<h3>[property:Float aspect]</h3>
<div>Default is *1*.</div>
<p>Default is *1*.</p>
<h3>[property:Float eyeSep]</h3>
<div>Default is *0.064*.</div>
<p>Default is *0.064*.</p>
<h3>[property:PerspectiveCamera cameraL]</h3>
<div>Left camera. This is added to [page:Layers layer 1] - objects to be rendered
by the left camera must also be added to this layer.</div>
<p>Left camera. This is added to [page:Layers layer 1] - objects to be rendered
by the left camera must also be added to this layer.</p>
<h3>[property:PerspectiveCamera cameraR]</h3>
<div>Right camera.This is added to [page:Layers layer 2] - objects to be rendered
by the right camera must also be added to this layer.</div>
<p>Right camera.This is added to [page:Layers layer 2] - objects to be rendered
by the right camera must also be added to this layer.</p>
<h2>Methods</h2>
<h3>[method:null update]( camera )</h3>
<div>
<p>
Update the stereo cameras based on the camera passed in.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,10 +12,12 @@
<h2>Example</h2>
<div>[example:webgl_materials_blending_custom materials / blending / custom ]</div>
<p>[example:webgl_materials_blending_custom materials / blending / custom ]</p>
<h2>Usage</h2>
These work with all material types. First set the material's blending mode to THREE.CustomBlending, then set the desired Blending Equation, Source Factor and Destination Factor.
<p>
These work with all material types. First set the material's blending mode to THREE.CustomBlending, then set the desired Blending Equation, Source Factor and Destination Factor.
</p>
<code>
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
......@@ -50,9 +52,9 @@
</code>
<h2>Destination Factors</h2>
<div>
<p>
All of the Source Factors are valid as Destination Factors, except for <code>THREE.SrcAlphaSaturateFactor</code>
</div>
</p>
<h2>Source</h2>
......
......@@ -10,7 +10,7 @@
<body>
<h1>Draw Mode Constants</h1>
<div class="desc">
<p class="desc">
These are valid values for [page:Mesh.drawMode], and control how the list of vertices is interpeted once sent to the GPU.<br /><br />
Note that these only work when [page:Mesh.geometry] is a [page:BufferGeometry]. Changing this
......@@ -18,31 +18,31 @@
</div>
</p>
<h2>Draw Modes</h2>
<code>
THREE.TrianglesDrawMode
</code>
<div>
<p>
This is the default, and results in every three consecutive vertices (v0, v1, v2), (v2, v3, v5), ...
being interpreted as a separate triangle. <br />
If the number of vertices is not a multiple of 3, excess vertices are ignored.
</div>
</p>
<code>
THREE.TriangleStripDrawMode
</code>
<div>
<p>
This will result in a series of triangles connected in a strip, given by (v0, v1, v2), (v2, v1, v3), (v2, v3, v4), ...
so that every subsequent triangle shares two vertices with the previous triangle.
</div>
</p>
<code>
THREE.TriangleFanDrawMode
</code>
<div>
<p>
This will result in a series of triangles each sharing the first vertex (like a fan),
given by (v0, v1, v2), (v0, v2, v3), (v0, v3, v4), ... <br /><br />
......@@ -50,7 +50,7 @@
render WebGL using [link:https://en.wikipedia.org/wiki/ANGLE_(software) ANGLE] on Windows,
internally this mode will be converted to a supported mode, which will likely lead to lowered
performance on those browsers.
</div>
</p>
<h2>Usage</h2>
......
......@@ -10,10 +10,10 @@
<body>
<h1>Material Constants</h1>
<div class="desc">
<p class="desc">
These constants define properties common to all material types,
with the exception of Texture Combine Operations which only apply to [page:MeshBasicMaterial.combine MeshBasicMaterial], [page:MeshLambertMaterial.combine MeshLambertMaterial] and [page:MeshPhongMaterial.combine MeshPhongMaterial].<br />
</div>
</p>
<h2>Side</h2>
......@@ -22,10 +22,10 @@
THREE.BackSide
THREE.DoubleSide
</code>
<div>
<p>
Defines which side of faces will be rendered - front, back or both.
Default is [page:Constant FrontSide].
</div>
</p>
<h2>Colors</h2>
......@@ -34,12 +34,12 @@
THREE.FaceColors
THREE.VertexColors
</code>
<div>
<p>
[page:Constant NoColors] is the default and applies the material's color to all faces.<br />
[page:Constant FaceColors] colors faces according to each [page:Face3 Face3][property:Color color] value.<br />
[page:Constant VertexColors] colors faces according to each [page:Face3 Face3][property:Array vertexColors] value. This is an array of three [page:Color Color]s, one for each vertex in the face.<br />
[page:Constant FaceColors] colors faces according to each [page:Face3 Face3] [page:Color Color] value.<br />
[page:Constant VertexColors] colors faces according to each [page:Face3 Face3] vertexColors value. This is an array of three [page:Color Color]s, one for each vertex in the face.<br />
See the [example:webgl_geometry_colors geometry / colors] example.
</div>
</p>
<h2>Blending Mode</h2>
<code>
......@@ -52,12 +52,12 @@
</code>
<div>
<p>
These control the source and destination blending equations for the material's RGB and Alpha sent to the WebGLRenderer for use by WebGL.<br />
[page:Constant NormalBlending] is the default.<br />
Note that [page:Constant CustomBlending] must be set to use [page:CustomBlendingEquation Custom Blending Equations].<br />
See the [example:webgl_materials_blending materials / blending] example.<br />
</div>
</p>
<h2>Depth Mode</h2>
<code>
......@@ -69,7 +69,7 @@
THREE.GreaterDepth
THREE.NotEqualDepth
</code>
<div>
<p>
Which depth function the material uses to compare incoming pixels Z-depth against the current Z-depth buffer value. If the result of the comparison is true, the pixel will be drawn.<br />
[page:Materials NeverDepth] will never return true.<br />
[page:Materials AlwaysDepth] will always return true.<br />
......@@ -78,7 +78,7 @@
[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
[page:Materials GreaterDepth] will return true if the incoming pixel Z-depth is greater than the current buffer Z-depth.<br />
[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is not equal to the current buffer Z-depth.<br />
</div>
</p>
<h2>Texture Combine Operations</h2>
<code>
......@@ -86,10 +86,12 @@
THREE.MixOperation
THREE.AddOperation
</code>
<p>
These define how the result of the surface's color is combined with the environment map (if present), for [page:MeshBasicMaterial.combine MeshBasicMaterial], [page:MeshLambertMaterial.combine MeshLambertMaterial] and [page:MeshPhongMaterial.combine MeshPhongMaterial]. <br />
[page:Constant MultiplyOperation] is the default and multiplies the environment map color with the surface color.<br />
[page:Constant MixOperation] uses reflectivity to blend between the two colors.<br />
[page:Constant AddOperation] adds the two colors.
</p>
<h2>Source</h2>
......
......@@ -17,22 +17,22 @@
THREE.CullFaceFront
THREE.CullFaceFrontBack
</code>
<div>
<p>
[page:constant CullFaceNone] disables face culling.<br />
[page:constant CullFaceBack] culls back faces (default).<br />
[page:constant CullFaceFront] culls front faces.<br />
[page:constant CullFaceFrontBack] culls both front and back faces.
</div>
</p>
<h2>Front Face Direction</h2>
<code>
THREE.FrontFaceDirectionCW
THREE.FrontFaceDirectionCCW
</code>
<div>
<p>
[page:constant FrontFaceDirectionCW] sets the winding order for polygons to clockwise.<br />
[page:constant FrontFaceDirectionCCW] sets the winding order for polygons to counter-clockwise (default).
</div>
</p>
<h2>Shadow Types</h2>
<code>
......@@ -40,13 +40,13 @@
THREE.PCFShadowMap
THREE.PCFSoftShadowMap
</code>
<div>
<p>
These define the WebGLRenderer's [page:WebGLRenderer.shadowMap.type shadowMap.type] property.<br /><br />
[page:constant BasicShadowMap] gives unfiltered shadow maps - fastest, but lowest quality.<br />
[page:constant PCFShadowMap] filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm (default).<br />
[page:constant PCFSoftShadowMap] filters shadow maps using the Percentage-Closer Soft Shadows (PCSS) algorithm.
</div>
</p>
<h2>Tone Mapping</h2>
<code>
......@@ -56,7 +56,7 @@
THREE.Uncharted2ToneMapping
THREE.CineonToneMapping
</code>
<div>
<p>
These define the WebGLRenderer's [page:WebGLRenderer.toneMapping toneMapping] property.
This is used to approximate the appearance of high dynamic range (HDR) on the
low dynamic range medium of a standard computer monitor or mobile device's screen.<br /><br />
......@@ -66,7 +66,7 @@
See the [example:webgl_tonemapping WebGL / tonemapping] example.
</div>
</p>
<h2>Source</h2>
......
......@@ -22,14 +22,14 @@
THREE.CubeUVRefractionMapping
</code>
<div>
<p>
These define the texture's mapping mode.<br />
[page:Constant UVMapping] is the default, and maps the texture using the mesh's UV coordinates.<br /><br />
The rest define environment mapping types.<br /><br />
[page:Constant CubeReflectionMapping] and [page:Constant CubeRefractionMapping] are for
use with a [page:CubeTexture CubeTexture], which is made up of six textures, one for each face of the cube.<br />
use with a [page:CubeTexture CubeTexture], which is made up of six textures, one for each face of the cube.
[page:Constant CubeReflectionMapping] is the default for a [page:CubeTexture CubeTexture]. <br /><br />
[page:Constant EquirectangularReflectionMapping] and [page:Constant EquirectangularRefractionMapping]
......@@ -43,7 +43,7 @@
of the position of the camera relative to the cubemapped object or surface.<br /><br />
See the [example:webgl_materials_envmaps materials / envmaps] example.
</div>
</p>
<h2>Wrapping Modes</h2>
......@@ -52,7 +52,7 @@
THREE.ClampToEdgeWrapping
THREE.MirroredRepeatWrapping
</code>
<div>
<p>
These define the texture's [page:Texture.wrapS wrapS] and [page:Texture.wrapT wrapT] properties,
which define horizontal and vertical texture wrapping.<br /><br />
......@@ -61,8 +61,8 @@
[page:constant ClampToEdgeWrapping] is the default.
The last pixel of the texture stretches to the edge of the mesh.<br /><br />
With [page:constant MirroredRepeatWrapping] the texture will repeats to infinity, mirroring on each repeat.<br />
</div>
With [page:constant MirroredRepeatWrapping] the texture will repeats to infinity, mirroring on each repeat.
</p>
<h2>Magnification Filters</h2>
<code>
......@@ -70,7 +70,7 @@
THREE.LinearFilter
</code>
<div>
<p>
For use with a texture's [page:Texture.magFilter magFilter] property,
these define the texture magnification function to be used when the pixel being textured maps to an
area less than or equal to one texture element (texel).<br /><br />
......@@ -82,7 +82,7 @@
of the four texture elements that are closest to the specified texture coordinates,
and can include items wrapped or repeated from other parts of a texture,
depending on the values of [page:Texture.wrapS wrapS] and [page:Texture.wrapT wrapT], and on the exact mapping.
</div>
</p>
<h2>Minification Filters</h2>
<code>
......@@ -94,7 +94,7 @@
THREE.LinearMipMapLinearFilter
</code>
<div>
<p>
For use with a texture's [page:Texture.minFilter minFilter] property, these define
the texture minifying function that is used whenever the pixel being textured maps
to an area greater than one texture element (texel).<br /><br />
......@@ -121,7 +121,7 @@
to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.<br /><br />
See the [example:webgl_materials_texture_filters materials / texture / filters] example.
</div>
</p>
<h2>Types</h2>
<code>
......@@ -138,11 +138,11 @@
THREE.UnsignedShort565Type
THREE.UnsignedInt248Type
</code>
<div>
<p>
For use with a texture's [page:Texture.type type] property, which must correspond to the correct format. See below for details.<br /><br />
[page:constant UnsignedByteType] is the default.
</div>
</p>
<h2>Formats</h2>
<code>
......@@ -155,7 +155,7 @@
THREE.DepthFormat
THREE.DepthStencilFormat
</code>
<div>
<p>
For use with a texture's [page:Texture.format format] property, these define
how elements of a 2d texture, or *texels*, are read by shaders.<br /><br />
......@@ -186,7 +186,7 @@
Note that the texture must have the correct [page:Texture.type type] set, as described above.
See [link:https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D WebGLRenderingContext.texImage2D] for details.
</div>
</p>
<h2>DDS / ST3C Compressed Texture Formats</h2>
<code>
......@@ -195,7 +195,7 @@
THREE.RGBA_S3TC_DXT3_Format
THREE.RGBA_S3TC_DXT5_Format
</code>
<div>
<p>
For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
these require support for the
[link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ WEBGL_compressed_texture_s3tc]
......@@ -206,7 +206,7 @@
[page:constant RGBA_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB image format with a simple on/off alpha value.<br />
[page:constant RGBA_S3TC_DXT3_Format]: A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.<br />
[page:constant RGBA_S3TC_DXT5_Format]: A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.<br />
</div>
</p>
<h2>PVRTC Compressed Texture Formats</h2>
<code>
......@@ -215,7 +215,7 @@
THREE.RGBA_PVRTC_4BPPV1_Format
THREE.RGBA_PVRTC_2BPPV1_Format
</code>
<div>
<p>
For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
these require support for the [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ WEBGL_compressed_texture_pvrtc]
extension. <br />
......@@ -226,17 +226,17 @@
[page:constant RGB_PVRTC_2BPPV1_Format]: RGB compression in 2-bit mode. One block for each 8×4 pixels.<br />
[page:constant RGBA_PVRTC_4BPPV1_Format]: RGBA compression in 4-bit mode. One block for each 4×4 pixels.<br />
[page:constant RGBA_PVRTC_2BPPV1_Format]: RGBA compression in 2-bit mode. One block for each 8×4 pixels.<br />
</div>
</p>
<h2>ETC Compressed Texture Format</h2>
<code>
THREE.RGB_ETC1_Format
</code>
<div>
<p>
For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format] property,
these require support for the [link:https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/ WEBGL_compressed_texture_etc1]
extension. <br /><br />
</div>
</p>
<h2>Encoding</h2>
<code>
......@@ -251,7 +251,7 @@
THREE.BasicDepthPacking
THREE.RGBADepthPacking
</code>
<div>
<p>
For use with a Texture's [page:Texture.encoding encoding] property.<br /><br />
If the encoding type is changed after the texture has already been used by a material,
......@@ -259,7 +259,7 @@
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,7 +10,7 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
This class stores data for an attribute (such as vertex positions, face indices, normals,
colors, UVs, and any custom attributes ) associated with a [page:BufferGeometry], which allows
for more efficient passing of data to the GPU. See that page for details and a usage example.<br /><br />
......@@ -18,11 +18,11 @@
Data is stored as vectors of any length (defined by [page:BufferAttribute.itemSize itemSize]),
and in general in the methods outlined below if passing in an index, this is automatically
multiplied by the vector length.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Boolean normalized] )</h3>
<div>
<p>
[page:TypedArray array] -- Must be a [link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/TypedArray TypedArray].
Used to instantiate the buffer. <br />
This array should have
......@@ -41,130 +41,130 @@
data will be mapped to 0.0f - +1.0f in the GLSL attribute. An Int16Array (signed) would map
from -32767 - +32767 to -1.0f - +1.0f. If [page:Boolean normalized] is false, the values
will be converted to floats which contain the exact value, i.e. 32767 becomes 32767.0f.
</div>
</p>
<h2>Properties</h2>
<h3>[property:TypedArray array]</h3>
<div>
<p>
The [page:TypedArray array] holding data stored in the buffer.
</div>
</p>
<h3>[property:Integer count]</h3>
<div>
<p>
Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].<br /><br />
If the buffer is storing a 3-component vector (such as a position, normal, or color),
then this will count the number of such vectors stored.
</div>
</p>
<h3>[property:Boolean dynamic]</h3>
<div>
<p>
Whether the buffer is dynamic or not. Default is *false*.<br />
If false, the GPU is informed that contents of the buffer are likely to be used often and not change often.
This corresponds to the [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.STATIC_DRAW] flag.<br />
if true, the GPU is informed that contents of the buffer are likely to be used often and change often.
This corresponds to the [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.DYNAMIC_DRAW] flag.
</div>
</p>
<h3>[property:Boolean isBufferAttribute]</h3>
<div>
<p>
Used to check whether this or derived classes are BufferAttributes. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
</p>
<h3>[property:Integer itemSize]</h3>
<div>The length of vectors that are being stored in the [page:BufferAttribute.array array].</div>
<p>The length of vectors that are being stored in the [page:BufferAttribute.array array].</p>
<h3>[property:String name]</h3>
<div>
<p>
Optional name for this attribute instance. Default is an empty string.
</div>
</p>
<h3>[property:Boolean needsUpdate]</h3>
<div>
<p>
Flag to indicate that this attribute has changed and should be re-sent to the GPU.
Set this to true when you modify the value of the array.<br /><br />
Setting this to true also increments the [page:BufferAttribute.version version].
</div>
</p>
<h3>[property:Boolean normalized]</h3>
<div>
<p>
Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
</div>
</p>
<h3>[property:Function onUploadCallback]</h3>
<div>
<p>
A callback function that is executed after the Renderer has transfered the attribute array data to the GPU.
</div>
</p>
<h3>[property:Object updateRange]</h3>
<div>Object containing:<br />
<p>Object containing:<br />
[page:Integer offset]: Default is *0*. Position at whcih to start update.<br />
[page:Integer count]: Default is *-1*, which means don't use update ranges. <br /><br />
This can be used to only update some components of stored vectors (for example, just the component
related to color).
</div>
</p>
<h3>[property:Integer version]</h3>
<div>A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.</div>
<p>A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.</p>
<h2>Methods</h2>
<h3>[method:BufferAttribute clone]() </h3>
<div>Return a copy of this bufferAttribute.</div>
<p>Return a copy of this bufferAttribute.</p>
<h3>[method:BufferAttribute copyArray]( array ) </h3>
<div>Copy the array given here (which can be a normal array or TypedArray) into
<p>Copy the array given here (which can be a normal array or TypedArray) into
[page:BufferAttribute.array array].<br /><br />
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]
for notes on requirements if copying a TypedArray.
</div>
</p>
<h3>[method:null copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] ) </h3>
<div>Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].</div>
<p>Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].</p>
<h3>[method:BufferAttribute copyColorsArray]( colors ) </h3>
<div>Copy an array representing RGB color values into [page:BufferAttribute.array array].</div>
<p>Copy an array representing RGB color values into [page:BufferAttribute.array array].</p>
<h3>[method:BufferAttribute copyVector2sArray]( vectors ) </h3>
<div>Copy an array representing [page:Vector2]s into [page:BufferAttribute.array array].</div>
<p>Copy an array representing [page:Vector2]s into [page:BufferAttribute.array array].</p>
<h3>[method:BufferAttribute copyVector3sArray]( vectors ) </h3>
<div>Copy an array representing [page:Vector3]s into [page:BufferAttribute.array array].</div>
<p>Copy an array representing [page:Vector3]s into [page:BufferAttribute.array array].</p>
<h3>[method:BufferAttribute copyVector4sArray]( vectors ) </h3>
<div>Copy an array representing [page:Vector4]s into [page:BufferAttribute.array array].</div>
<p>Copy an array representing [page:Vector4]s into [page:BufferAttribute.array array].</p>
<h3>[method:Number getX]( index ) </h3>
<div>Returns the x component of the vector at the given index.</div>
<p>Returns the x component of the vector at the given index.</p>
<h3>[method:Number getY]( index ) </h3>
<div>Returns the y component of the vector at the given index.</div>
<p>Returns the y component of the vector at the given index.</p>
<h3>[method:Number getZ]( index ) </h3>
<div>Returns the z component of the vector at the given index.</div>
<p>Returns the z component of the vector at the given index.</p>
<h3>[method:Number getW]( index ) </h3>
<div>Returns the w component of the vector at the given index.</div>
<p>Returns the w component of the vector at the given index.</p>
<h3>[method:null onUpload]( [param:Function callback] ) </h3>
<div>
<p>
Sets the value of the onUploadCallback property.<br /><br />
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory
after the buffer has been transfered to the GPU.
</div>
</p>
<h3>[method:null set] ( [param:Array value], [param:Integer offset] ) </h3>
<div>
<p>
value -- an [page:Array] or [page:TypedArray] from which to copy values. <br />
offset -- (optional) index of the [page:BufferAttribute.array array] at which to start copying.<br /><br />
......@@ -173,38 +173,38 @@
In particular, see that page for requirements on [page:Array value]
being a [page:TypedArray].
</div>
</p>
<h3>[method:null setArray] ( [param:TypedArray array] ) </h3>
<div>
<p>
[page:BufferAttribute.array array] to the TypedArray passed in here.<br /><br />
After setting the array, [page:BufferAttribute.needsUpdate needsUpdate] should be set to true.
</div>
</p>
<h3>[method:BufferAttribute setDynamic] ( [param:Boolean value] ) </h3>
<div>Set [page:BufferAttribute.dynamic dynamic] to value.</div>
<p>Set [page:BufferAttribute.dynamic dynamic] to value.</p>
<h3>[method:null setX]( index, x ) </h3>
<div>Sets the x component of the vector at the given index.</div>
<p>Sets the x component of the vector at the given index.</p>
<h3>[method:null setY]( index, y ) </h3>
<div>Sets the y component of the vector at the given index.</div>
<p>Sets the y component of the vector at the given index.</p>
<h3>[method:null setZ]( index, z ) </h3>
<div>Sets the z component of the vector at the given index.</div>
<p>Sets the z component of the vector at the given index.</p>
<h3>[method:null setW]( index, w ) </h3>
<div>Sets the w component of the vector at the given index.</div>
<p>Sets the w component of the vector at the given index.</p>
<h3>[method:null setXY]( index, x, y ) </h3>
<div>Sets the x and y components of the vector at the given index.</div>
<p>Sets the x and y components of the vector at the given index.</p>
<h3>[method:null setXYZ]( index, x, y, z ) </h3>
<div>Sets the x, y and z components of the vector at the given index.</div>
<p>Sets the x, y and z components of the vector at the given index.</p>
<h3>[method:null setXYZW]( index, x, y, z, w ) </h3>
<div>Sets the x, y, z and w components of the vector at the given index.</div>
<p>Sets the x, y, z and w components of the vector at the given index.</p>
......
......@@ -10,7 +10,6 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p>
An efficient representation of mesh, line, or point geometry. Includes vertex positions, face
indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of
......@@ -43,14 +42,14 @@
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var mesh = new THREE.Mesh( geometry, material );
</code>
<div>
<p>
[example:webgl_buffergeometry Mesh with non-indexed faces]<br />
[example:webgl_buffergeometry_indexed Mesh with indexed faces]<br />
[example:webgl_buffergeometry_lines Lines]<br />
[example:webgl_buffergeometry_lines_indexed Indexed Lines]<br />
[example:webgl_buffergeometry_custom_attributes_particles Particles]<br />
[example:webgl_buffergeometry_rawshader Raw Shaders]
</div>
</p>
<h2>Accessing Attributes</h2>
......@@ -68,21 +67,21 @@
The following attributes are set by various members of this class:
</p>
<h3>[page:BufferAttribute position] (itemSize: 3)</h3>
<div>
<p>
Stores the x, y, and z coordinates of each vertex in this geometry. Set by [page:.fromGeometry]().
</div>
</p>
<h3>[page:BufferAttribute normal] (itemSize: 3)</h3>
<div>
<p>
Stores the x, y, and z components of the vertex normal vector of each vertex in this geometry.
Set by [page:.fromGeometry]().
</div>
</p>
<h3>[page:BufferAttribute color] (itemSize: 3)</h3>
<div>
<p>
Stores the red, green, and blue channels of vertex color of each vertex in this geometry.
Set by [page:.fromGeometry]().
</div>
</p>
<p>
In addition to the the built-in attributes, you can set your own custom attributes using the addAttribute method. With [page:Geometry], these attributes are set and stored on the [page:Material]. In BufferGeometry, the attributes are stored with the geometry itself. Note that you still need to set the attributes information on the material as well, but the value of each attribute is stored in the BufferGeometry.
......@@ -101,35 +100,35 @@
<h2>Properties</h2>
<h3>[property:Object attributes]</h3>
<div>
<p>
This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use [page:.addAttribute] and [page:.getAttribute] to access attributes of this geometry.
</div>
</p>
<h3>[property:Box3 boundingBox]</h3>
<div>
<p>
Bounding box for the bufferGeometry, which can be calculated with
[page:.computeBoundingBox](). Default is *null*.
</div>
</p>
<h3>[property:Sphere boundingSphere]</h3>
<div>
<p>
Bounding sphere for the bufferGeometry, which can be calculated with
[page:.computeBoundingSphere](). Default is *null*.
</div>
</p>
<h3>[property:Object drawRange]</h3>
<div>
<p>
Used to determine what part of the geometry should be rendered. This should not
be set directly, instead use [page:.setDrawRange].<br />
Default is
<code>
{ start: 0, count: Infinity }
</code>
</div>
</p>
<h3>[property:Array groups]</h3>
<div>
<p>
Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.<br /><br />
......@@ -140,25 +139,25 @@
materialIndex specifies the material array index to use.<br /><br />
Use [page:.addGroup] to add groups, rather than modifying this array directly.
</div>
</p>
<!-- Note: groups used to be called drawCalls
<h3>[property:Array drawcalls]</h3>
<div>
<p>
For geometries that use indexed triangles, this Array can be used to split the object
into multiple WebGL draw calls. Each draw call will draw some subset of the vertices
in this geometry using the configured [page:Material shader]. This may be necessary if,
for instance, you have more than 65535 vertices in your object.
</div> -->
</p> -->
<h3>[property:Integer id]</h3>
<div>Unique number for this bufferGeometry instance.</div>
<p>Unique number for this bufferGeometry instance.</p>
<h3>[property:BufferAttribute index]</h3>
<div>
<p>
Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles" and
works much the same as it does in [page:Geometry]: each triangle is associated with the indices of three vertices.
This attribute therefore stores the index of each vertex for each triangular face.
......@@ -167,169 +166,169 @@
positions represent a single triangle.
Default is *null*.
</div>
</p>
<h3>[property:Boolean isBufferGeometry]</h3>
<div>
<p>
Used to check whether this or derived classes are BufferGeometries. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
</p>
<h3>[property:Object morphAttributes]</h3>
<div>
<p>
Hashmap of [page:BufferAttribute]s holding details of the geometry's [page:Geometry.morphTargets morphTargets].
</div>
</p>
<h3>[property:String name]</h3>
<div>
<p>
Optional name for this bufferGeometry instance. Default is an empty string.
</div>
</p>
<h3>[property:String uuid]</h3>
<div>
<p>
[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.
</div>
</p>
<h2>Methods</h2>
<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
<h3>[method:null addAttribute]( [param:String name], [param:BufferAttribute attribute] )</h3>
<div>
<p>
Adds an attribute to this geometry. Use this rather than the attributes property,
because an internal hashmap of [page:.attributes] is maintained to speed up iterating over
attributes.
</div>
</p>
<h3>[method:null addGroup]( [param:Integer start], [param:Integer count], [param:Integer materialIndex] )</h3>
<div>
<p>
Adds a group to this geometry; see the [page:BufferGeometry.groups groups]
property for details.
</div>
</p>
<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<div>Bakes matrix transform directly into vertex coordinates.</div>
<p>Bakes matrix transform directly into vertex coordinates.</p>
<h3>[method:BufferGeometry center] ()</h3>
<div>Center the geometry based on the bounding box.</div>
<p>Center the geometry based on the bounding box.</p>
<h3>[method:BufferGeometry clone]()</h3>
<div>Creates a clone of this BufferGeometry.</div>
<p>Creates a clone of this BufferGeometry.</p>
<h3>[method:BufferGeometry copy]( [param:BufferGeometry bufferGeometry] )</h3>
<div>Copies another BufferGeometry to this BufferGeometry.</div>
<p>Copies another BufferGeometry to this BufferGeometry.</p>
<h3>[method:null clearGroups]( )</h3>
<div>Clears all groups.</div>
<p>Clears all groups.</p>
<h3>[method:null computeBoundingBox]()</h3>
<div>
<p>
Computes bounding box of the geometry, updating [param:.boundingBox] attribute.<br />
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
</div>
</p>
<h3>[method:null computeBoundingSphere]()</h3>
<div>
<p>
Computes bounding sphere of the geometry, updating [page:.boundingSphere] attribute.<br />
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
</div>
</p>
<h3>[method:null computeVertexNormals]()</h3>
<div>Computes vertex normals by averaging face normals.</div>
<p>Computes vertex normals by averaging face normals.</p>
<h3>[method:null dispose]()</h3>
<div>
<p>
Disposes the object from memory. <br />
You need to call this when you want the bufferGeometry removed while the application is running.
</div>
</p>
<h3>[method:BufferGeometry fromDirectGeometry]( [param:Geometry] )</h3>
<div>
<p>
Populates this BufferGeometry with data from a [page:DirectGeometry] object.<br /><br />
Note: [page:DirectGeometry] is mainly used as an intermediary object for converting between [page:Geometry]
and BufferGeometry.
</div>
</p>
<h3>[method:BufferGeometry fromGeometry]( [param:Geometry] )</h3>
<div>Populates this BufferGeometry with data from a [page:Geometry] object.</div>
<p>Populates this BufferGeometry with data from a [page:Geometry] object.</p>
<h3>[method:BufferAttribute getAttribute]( [param:String name] )</h3>
<div>Returns the [page:BufferAttribute attribute] with the specified name.</div>
<p>Returns the [page:BufferAttribute attribute] with the specified name.</p>
<h3>[method:BufferAttribute getIndex] ()</h3>
<div>Return the [page:.index] buffer.</div>
<p>Return the [page:.index] buffer.</p>
<h3>[method:BufferGeometry lookAt] ( [param:Vector3 vector] )</h3>
<div>
<p>
vector - A world vector to look at.<br /><br />
Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt] for typical real-time mesh usage.
</div>
</p>
<h3>[method:null merge]( [param:BufferGeometry bufferGeometry], [param:Integer offset] )</h3>
<div>Merge in another BufferGeometry with an optional offset of where to start merging in.</div>
<p>Merge in another BufferGeometry with an optional offset of where to start merging in.</p>
<h3>[method:null normalizeNormals]()</h3>
<div>
<p>
Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
</div>
</p>
<h3>[method:BufferAttribute removeAttribute]( [param:String name] )</h3>
<div>Removes the [page:BufferAttribute attribute] with the specified name.</div>
<p>Removes the [page:BufferAttribute attribute] with the specified name.</p>
<h3>[method:BufferGeometry rotateX] ( [param:Float radians] )</h3>
<div>
<p>
Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</p>
<h3>[method:BufferGeometry rotateY] ( [param:Float radians] )</h3>
<div>
<p>
Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</p>
<h3>[method:BufferGeometry rotateZ] ( [param:Float radians] )</h3>
<div>
<p>
Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</p>
<h3>[method:BufferGeometry scale] ( [param:Float x], [param:Float y], [param:Float z] )</h3>
<div>
<p>
Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale] for typical real-time mesh scaling.
</div>
</p>
<h3>[method:null setIndex] ( [param:BufferAttribute index] )</h3>
<div>Set the [page:.index] buffer.</div>
<p>Set the [page:.index] buffer.</p>
<h3>[method:null setDrawRange] ( [param:Integer start], [param:Integer count] )</h3>
<div>Set the [page:.drawRange] buffer. See that property for details.</div>
<p>Set the [page:.drawRange] buffer. See that property for details.</p>
<h3>[method:BufferGeometry setFromObject] ( [param:Object3D object] )</h3>
<div>Sets the attributes for this BufferGeometry from an [page:Object3D].</div>
<p>Sets the attributes for this BufferGeometry from an [page:Object3D].</p>
<h3>[method:BufferGeometry setFromPoints] ( [param:Array points] )</h3>
<div>Sets the attributes for this BufferGeometry from an array of points.</div>
<p>Sets the attributes for this BufferGeometry from an array of points.</p>
<h3>[method:Object toJSON]()</h3>
<div>Returns a JSON object representation of the BufferGeometry.</div>
<p>Returns a JSON object representation of the BufferGeometry.</p>
<h3>[method:BufferGeometry toNonIndexed]()</h3>
<div>Return a non-index version of an indexed BufferGeometry.</div>
<p>Return a non-index version of an indexed BufferGeometry.</p>
<h3>[method:BufferGeometry translate] ( [param:Float x], [param:Float y], [param:Float z] )</h3>
<div>
<p>
Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position] for typical real-time mesh translation.
</div>
</p>
<h3>[method:BufferGeometry updateFromObject] ( [param:Object3D object] )</h3>
<div>Updates the attributes for this BufferGeometry from an [page:Object3D].</div>
......
......@@ -10,74 +10,74 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Object for keeping track of time. This uses <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/now">performance.now()</a>
if it is available, otherwise it reverts to the less accurate <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now">Date.now()</a>.
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:Boolean autoStart] )</h3>
<div>
<p>
autoStart — (optional) whether to automatically start the clock. Default is true.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Boolean autoStart]</h3>
<div>
<p>
If set, starts the clock automatically when the first update is called. Default is true.
</div>
</p>
<h3>[property:Float startTime]</h3>
<div>
<p>
Holds the time at which the clock's [page:Clock.start start] method was last called.
</div>
</p>
<h3>[property:Float oldTime]</h3>
<div>
<p>
Holds the time at which the clock's [page:Clock.start start], [page:Clock.getElapsedTime getElapsedTime] or [page:Clock.getDelta getDelta]
methods were last called.
</div>
</p>
<h3>[property:Float elapsedTime]</h3>
<div>
<p>
Keeps track of the total time that the clock has been running.
</div>
</p>
<h3>[property:Boolean running]</h3>
<div>
<p>
Whether the clock is running or not.
</div>
</p>
<h2>Methods</h2>
<h3>[method:null start]()</h3>
<div>
<p>
Starts clock. Also sets the [page:Clock.startTime startTime] and [page:Clock.oldTime oldTime]
to the current time, sets [page:Clock.elapsedTime elapsedTime] to *0* and [page:Clock.running running] to *true*.
</div>
</p>
<h3>[method:null stop]()</h3>
<div>
<p>
Stops clock and sets [page:Clock.oldTime oldTime] to the current time.
</div>
</p>
<h3>[method:Float getElapsedTime]()</h3>
<div>
<p>
Get the seconds passed since the clock started and sets [page:Clock.oldTime oldTime] to the current time.<br />
If [page:Clock.autoStart autoStart] is *true* and the clock is not running, also starts the clock.
</div>
</p>
<h3>[method:Float getDelta]()</h3>
<div>
<p>
Get the seconds passed since the time [page:Clock.oldTime oldTime] was set and sets [page:Clock.oldTime oldTime] to the current time.<br />
If [page:Clock.autoStart autoStart] is *true* and the clock is not running, also starts the clock.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,9 +10,9 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
This class is used internally to convert from [page:Geometry] to [page:BufferGeometry].
</div>
</p>
......@@ -20,85 +20,85 @@
<h3>[name]()</h3>
<div>This creates a new [name].</div>
<p>This creates a new [name].</p>
<h2>Properties</h2>
<h3>[property:Integer id]</h3>
<div>Unique number for this [name] instance.</div>
<p>Unique number for this [name] instance.</p>
<h3>[property:String name]</h3>
<div>Optional name. Default is the empty string.</div>
<p>Optional name. Default is the empty string.</p>
<h3>[property:Array type]</h3>
<div>String 'DirectGeometry'.</div>
<p>String 'DirectGeometry'.</p>
<h3>[property:Array vertices]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array normals]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array colors]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array uvs]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array uvs2]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array groups]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array morphTargets]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array skinWeights]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Array skinIndices]</h3>
<div>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</div>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<h3>[property:Box3 boundingBox]</h3>
<div>
<p>
Bounding box for the bufferGeometry, which can be calculated with
[page:.computeBoundingBox](). Default is *null*.
</div>
</p>
<h3>[property:Sphere boundingSphere]</h3>
<div>
<p>
Bounding sphere for the bufferGeometry, which can be calculated with
[page:.computeBoundingSphere](). Default is *null*.
</div>
</p>
<h3>[property:Boolean verticesNeedUpdate]</h3>
<div>Default is false.</div>
<p>Default is false.</p>
<h3>[property:Boolean normalsNeedUpdate]</h3>
<div>Default is false.</div>
<p>Default is false.</p>
<h3>[property:Boolean colorsNeedUpdate]</h3>
<div>Default is false.</div>
<p>Default is false.</p>
<h3>[property:Boolean uvsNeedUpdate]</h3>
<div>Default is false.</div>
<p>Default is false.</p>
<h3>[property:Boolean groupsNeedUpdate]</h3>
<div>Default is false.</div>
<p>Default is false.</p>
<h2>Methods</h2>
<h3>[property:null computeGroups]( [page:Geometry geometry] )</h3>
<div>
<p>
Compute the parts of the geometry that have different materialIndex.
See [page:BufferGeometry.groups].
</div>
</p>
<h3>[property:null fromGeometry]( [page:Geometry geometry] )</h3>
<div>Pass in a [page:Geometry] instance for conversion.</div>
<p>Pass in a [page:Geometry] instance for conversion.</p>
<h2>Source</h2>
......
......@@ -10,10 +10,10 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
JavaScript events for custom objects.<br />
[link:https://github.com/mrdoob/eventdispatcher.js Eventdispatcher on GitHub]
</div>
</p>
<h2>Example</h2>
......@@ -50,47 +50,47 @@ car.start();
<h2>Constructor</h2>
<h3>[name]()</h3>
<div>
<p>
Creates EventDispatcher object.
</div>
</p>
<h2>Methods</h2>
<h3>[method:null addEventListener]( [param:String type], [param:Function listener] )</h3>
<div>
<p>
type - The type of event to listen to.<br />
listener - The function that gets called when the event is fired.
</div>
<div>
</p>
<p>
Adds a listener to an event type.
</div>
</p>
<h3>[method:Boolean hasEventListener]( [param:String type], [param:Function listener] )</h3>
<div>
<p>
type - The type of event to listen to.<br />
listener - The function that gets called when the event is fired.
</div>
<div>
</p>
<p>
Checks if listener is added to an event type.
</div>
</p>
<h3>[method:null removeEventListener]( [param:String type], [param:Function listener] )</h3>
<div>
<p>
type - The type of the listener that gets removed.<br />
listener - The listener function that gets removed.
</div>
<div>
</p>
<p>
Removes a listener from an event type.
</div>
</p>
<h3>[method:null dispatchEvent]( [param:object event] )</h3>
<div>
<p>
event - The event that gets fired.
</div>
<div>
</p>
<p>
Fire an event type.
</div>
</p>
<h2>Source</h2>
......
......@@ -10,19 +10,19 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
Triangular face used in [page:Geometry]. These are created automatically for all
standard geometry types, however if you are building a custom geometry you will have to
create them manually.
</div>
</p>
<h2>Examples</h2>
<div>[example:misc_ubiquity_test ubiquity / test ]</div>
<div>[example:svg_sandbox svg / sandbox ]</div>
<div>[example:misc_exporter_obj exporter / obj ]</div>
<div>[example:webgl_shaders_vector WebGL / shaders / vector ]</div>
<p>[example:misc_ubiquity_test ubiquity / test ]</p>
<p>[example:svg_sandbox svg / sandbox ]</p>
<p>[example:misc_exporter_obj exporter / obj ]</p>
<p>[example:webgl_shaders_vector WebGL / shaders / vector ]</p>
<code>
......@@ -54,7 +54,7 @@ scene.add( new THREE.Mesh( geometry, material ) );
<h2>Constructor</h2>
<h3>[name]( [param:Integer a], [param:Integer b], [param:Integer c], [param:Vector3 normal], [param:Color color], [param:Integer materialIndex] )</h3>
<div>
<p>
a — Vertex A index.<br />
b — Vertex B index.<br />
c — Vertex C index.<br /><br />
......@@ -69,62 +69,62 @@ scene.add( new THREE.Mesh( geometry, material ) );
materialIndex — (optional) which index of an array of materials to associate
with the face.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Integer a]</h3>
<div>
<p>
Vertex A index.
</div>
</p>
<h3>[property:Integer b]</h3>
<div>
<p>
Vertex B index.
</div>
</p>
<h3>[property:Integer c]</h3>
<div>
<p>
Vertex C index.
</div>
</p>
<h3>[property:Vector3 normal]</h3>
<div>
<p>
Face normal - vector showing the direction of the Face3. If calculated automatically
(using [page:Geometry.computeFaceNormals]), this is the normalized cross product of two edges of the
triangle. Default is *(0, 0, 0)*.
</div>
</p>
<h3>[property:Color color]</h3>
<div>
<p>
Face color - for this to be used a material's [page:Material.vertexColors vertexColors] property
must be set to [page:Materials THREE.FaceColors].
</div>
</p>
<h3>[property:Array vertexNormals]</h3>
<div>
<p>
Array of 3 [page:Vector3 vertex normals].
</div>
</p>
<h3>[property:Array vertexColors]</h3>
<div>
<p>
Array of 3 vertex colors - for these to be used a material's [page:Material.vertexColors vertexColors] property
must be set to [page:Materials THREE.VertexColors].
</div>
</p>
<h3>[property:Integer materialIndex]</h3>
<div>
<p>
Material index (points to an index in the associated array of materials). Default is *0*.
</div>
</p>
<h2>Methods</h2>
<h3>[method:Face3 clone]()</h3>
<div>Creates a new clone of the Face3 object.</div>
<p>Creates a new clone of the Face3 object.</p>
<h3>[method:Face3 copy]( [param:Face3 face3] )</h3>
<div>Copy the paramaters of another Face3 into this.</div>
<p>Copy the paramaters of another Face3 into this.</p>
<h2>Source</h2>
......
......@@ -52,101 +52,101 @@
<h3>[name]()</h3>
<div>
<p>
The constructor takes no arguments.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Box3 boundingBox]</h3>
<div>
<p>
Bounding box for the Geometry, which can be calculated with
[page:.computeBoundingBox](). Default is *null*.
</div>
</p>
<h3>[property:Sphere boundingSphere]</h3>
<div>
<p>
Bounding sphere for the Geometry, which can be calculated with
[page:.computeBoundingSphere](). Default is *null*.
</div>
</p>
<h3>[property:Array colors]</h3>
<div>
<p>
Array of vertex [page:Color colors], matching number and order of vertices.<br /><br />
This is used by [page:Points] and [page:Line] and any classes derived from those such as [page:LineSegments] and various helpers.
[page:Mesh Meshes] use [page:Face3.vertexColors] instead of this.<br /><br />
To signal an update in this array, [page:Geometry Geometry.colorsNeedUpdate] needs to be set to true.
</div>
</p>
<h3>[property:Array faces]</h3>
<div>
<p>
Array of [page:Face3 faces].<br />
The array of faces describe how each vertex in the model is connected to form faces.
Additionally it holds information about face and vertex normals and colors.<br /><br />
To signal an update in this array, [page:Geometry Geometry.elementsNeedUpdate] needs to be set to true.
</div>
</p>
<h3>[property:Array faceVertexUvs]</h3>
<div>
<p>
Array of face [link:https://en.wikipedia.org/wiki/UV_mapping UV] layers, used for mapping textures onto the geometry.<br />
Each UV layer is an array of [page:UV]s matching the order and number of vertices in faces.<br /><br />
To signal an update in this array, [page:Geometry Geometry.uvsNeedUpdate] needs to be set to true.
</div>
</p>
<h3>[property:Integer id]</h3>
<div>Unique number for this geometry instance.</div>
<p>Unique number for this geometry instance.</p>
<h3>[property:Boolean isGeometry]</h3>
<div>
<p>
Used to check whether this or derived classes are Geometries. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
</p>
<h3>[property:array lineDistances]</h3>
<div>
<p>
An array containing distances between vertices for Line geometries.
This is required for [page:LineDashedMaterial] to render correctly.
</div>
</p>
<h3>[property:Array morphTargets]</h3>
<div>
<p>
Array of [link:https://en.wikipedia.org/wiki/Morph_target_animation morph targets]. Each morph target is a Javascript object:
<code>{ name: "targetName", vertices: [ new THREE.Vector3(), ... ] }</code>
Morph vertices match number and order of primary vertices.
</div>
</p>
<h3>[property:Array morphNormals]</h3>
<div>
<p>
Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object:
<code>morphNormal = { name: "NormalName", normals: [ new THREE.Vector3(), ... ] }</code>
See the [example:webgl_morphnormals WebGL / morphNormals] example.
</div>
</p>
<h3>[property:String name]</h3>
<div>Optional name for this geometry. Default is an empty string.</div>
<p>Optional name for this geometry. Default is an empty string.</p>
<h3>[property:Array skinWeights]</h3>
<div>
<p>
When working with a [page:SkinnedMesh], each vertex can have up to 4 [page:Bone bones] affecting it.
The skinWeights property is an array of weight values that correspond to the order of the vertices in
the geometry. So for instance, the first skinWeight would correspond to the first vertex in the geometry.
Since each vertex can be modified by 4 bones, a [page:Vector4] is used to represent the skin weights
for that vertex.
</div>
<div>
</p>
<p>
The values of the vector should typically be between 0 and 1. For instance when set to 0 the bone
transformation will have no affect. When set to 0.5 it will have 50% affect. When set to 100%, it will
have 100% affect. If there is only 1 bone associated with the vertex then you only need to worry about
the first component of the vector, the rest can be ignored and set to 0.
</div>
</p>
<h3>[property:Array skinIndices]</h3>
<div>
<p>
Just like the skinWeights property, the skinIndices' values correspond to the geometry's vertices.
Each vertex can have up to 4 bones associated with it. So if you look at the first vertex, and the
first skinIndex, this will tell you the bones associated with that vertex. For example the first vertex
......@@ -155,8 +155,8 @@
<strong>( 0.8, 0.2, 0, 0 )</strong>. In affect this would take the first vertex, and then the bone
<strong>mesh.bones[10]</strong> and apply it 80% of the way. Then it would take the bone <strong>skeleton.bones[2]</strong>
and apply it 20% of the way. The next two values have a weight of 0, so they would have no affect.
</div>
<div>
</p>
<p>
In code another example could look like this:
<code>
// e.g.
......@@ -172,41 +172,41 @@
skeleton.bones[9]; // weight of 0.3
skeleton.bones[10]; // weight of 0
</code>
</div>
</p>
<h3>[property:String uuid]</h3>
<div>
<p>
[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.
</div>
</p>
<h3>[property:Array vertices]</h3>
<div>
<p>
Array of [page:Vector3 vertices].<br />
The array of vertices holds the position of every vertex in the model.<br />
To signal an update in this array, [page:.verticesNeedUpdate] needs to be set to true.
</div>
</p>
<h3>[property:Boolean verticesNeedUpdate]</h3>
<div>Set to *true* if the vertices array has been updated.</div>
<p>Set to *true* if the vertices array has been updated.</p>
<h3>[property:Boolean elementsNeedUpdate]</h3>
<div>Set to *true* if the faces array has been updated.</div>
<p>Set to *true* if the faces array has been updated.</p>
<h3>[property:Boolean uvsNeedUpdate]</h3>
<div>Set to *true* if the uvs array has been updated. </div>
<p>Set to *true* if the uvs array has been updated. </p>
<h3>[property:Boolean normalsNeedUpdate]</h3>
<div>Set to *true* if the normals array has been updated.</div>
<p>Set to *true* if the normals array has been updated.</p>
<h3>[property:Boolean colorsNeedUpdate]</h3>
<div>Set to *true* if the colors array or a face3 color has been updated.</div>
<p>Set to *true* if the colors array or a face3 color has been updated.</p>
<h3>[property:Boolean groupsNeedUpdate]</h3>
<div>Set to *true* if a face3 materialIndex has been updated.</div>
<p>Set to *true* if a face3 materialIndex has been updated.</p>
<h3>[property:Boolean lineDistancesNeedUpdate]</h3>
<div>Set to *true* if the linedistances array has been updated.</div>
<p>Set to *true* if the linedistances array has been updated.</p>
<h2>Methods</h2>
......@@ -214,128 +214,128 @@
<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<div>Bakes matrix transform directly into vertex coordinates.</div>
<p>Bakes matrix transform directly into vertex coordinates.</p>
<h3>[method:Geometry center] ()</h3>
<div>Center the geometry based on the bounding box.</div>
<p>Center the geometry based on the bounding box.</p>
<h3>[method:Geometry clone]()</h3>
<div>
<p>
Creates a new clone of the Geometry.<br /><br />
This method copies only vertices, faces and uvs. It does not copy any other properties of the geometry.
</div>
</p>
<h3>[method:null computeBoundingBox]()</h3>
<div>Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.</div>
<p>Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.</p>
<h3>[method:null computeBoundingSphere]()</h3>
<div>Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.</div>
<p>Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.</p>
<div>
<p>
Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed,
otherwise they are *null*.
</div>
</p>
<h3>[method:null computeFaceNormals]()</h3>
<div>Computes [page:Face3.normal face normals].</div>
<p>Computes [page:Face3.normal face normals].</p>
<h3>[method:null computeFlatVertexNormals]()</h3>
<div>Computes flat [page:Face3.vertexNormals vertex normals]. Sets the vertex normal of each vertex of each face to be the same as the face's normal.</div>
<p>Computes flat [page:Face3.vertexNormals vertex normals]. Sets the vertex normal of each vertex of each face to be the same as the face's normal.</p>
<h3>[method:null computeMorphNormals]()</h3>
<div>Computes [page:.morphNormals].</div>
<p>Computes [page:.morphNormals].</p>
<h3>[method:null computeVertexNormals]( [param:Boolean areaWeighted] )</h3>
<div>
<p>
areaWeighted - If true the contribution of each face normal to the vertex normal is
weighted by the area of the face. Default is true.<br /><br />
Computes vertex normals by averaging face normals.
</div>
</p>
<h3>[method:Geometry copy]( [param:Geometry geometry] )</h3>
<div>
<p>
Copies vertices, faces and uvs into this geometry. It does not copy any other properties of the geometry.
</div>
</p>
<h3>[method:null dispose]()</h3>
<div>
<p>
Removes The object from memory. <br />
Don't forget to call this method when you remove a geometry because it can cause memory leaks.
</div>
</p>
<h3>[method:Geometry fromBufferGeometry]( [param:BufferGeometry geometry] )</h3>
<div>Convert a [page:BufferGeometry] to a Geometry.</div>
<p>Convert a [page:BufferGeometry] to a Geometry.</p>
<h3>[method:Geometry lookAt] ( [param:Vector3 vector] )</h3>
<div>
<p>
vector - A world vector to look at.<br /><br />
Rotates the geometry to face point in space. This is typically done as a one time operation but not during the render loop.<br>
Use [page:Object3D.lookAt] for typical real-time mesh usage.
</div>
</p>
<h3>[method:null merge]( [param:Geometry geometry], [param:Matrix4 matrix], [param:Integer materialIndexOffset] )</h3>
<div>Merge two geometries or geometry and geometry from object (using object's transform)</div>
<p>Merge two geometries or geometry and geometry from object (using object's transform)</p>
<h3>[method:null mergeMesh]( [param:Mesh mesh] )</h3>
<div>Merge the mesh's geometry with this, also applying the mesh's transform.</div>
<p>Merge the mesh's geometry with this, also applying the mesh's transform.</p>
<h3>[method:null mergeVertices]()</h3>
<div>
<p>
Checks for duplicate vertices using hashmap.<br />
Duplicated vertices are removed and faces' vertices are updated.
</div>
</p>
<h3>[method:null normalize]()</h3>
<div>
<p>
Normalize the geometry. <br />
Make the geometry centered and have a bounding sphere of radius *1.0*.
</div>
</p>
<h3>[method:Geometry rotateX] ( [param:Float radians] )</h3>
<div>
<p>
Rotate the geometry about the X axis. This is typically done as a one time operation but not during the render loop.<br>
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</p>
<h3>[method:Geometry rotateY] ( [param:Float radians] )</h3>
<div>
<p>
Rotate the geometry about the Y axis. This is typically done as a one time operation but not during the render loop.<br>
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</p>
<h3>[method:Geometry rotateZ] ( [param:Float radians] )</h3>
<div>
<p>
Rotate the geometry about the Z axis. This is typically done as a one time operation but not during the render loop.<br>
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</p>
<h3>[method:Geometry setFromPoints] ( [param:Array points] )</h3>
<div>Sets the vertices for this Geometry from an array of points.</div>
<p>Sets the vertices for this Geometry from an array of points.</p>
<h3>[method:null sortFacesByMaterialIndex] ( )</h3>
<div>
<p>
Sorts the faces array according to material index. For complex geometries with several materials,
this can result in reduced draw calls and improved performance.
</div>
</p>
<h3>[method:Geometry scale] ( [param:Float x], [param:Float y], [param:Float z] )</h3>
<div>
<p>
Scale the geometry data. This is typically done as a one time operation but not during the render loop.<br>
Use [page:Object3D.scale] for typical real-time mesh scaling.
</div>
</p>
<h3>[method:JSON toJSON] ( )</h3>
<div>Convert the geometry to JSON format.</div>
<p>Convert the geometry to JSON format.</p>
<h3>[method:Geometry translate] ( [param:Float x], [param:Float y], [param:Float z] )</h3>
<div>
<p>
Translate the geometry. This is typically done as a one time operation but not during the render loop.<br>
Use [page:Object3D.position] for typical real-time mesh translation.
</div>
</p>
<h2>Source</h2>
......
......@@ -12,30 +12,30 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
An instanced version of [page:BufferAttribute].
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Number meshPerAttribute] )</h3>
<div>
</div>
<p>
</p>
<h2>Properties</h2>
See [page:BufferAttribute] for inherited properties.
<h3>[property:Number meshPerAttribute]</h3>
<div>
<p>
Default is *1*.
</div>
</p>
<h3>[property:Boolean isInstancedBufferAttribute]</h3>
<div>
<p>
Default is *true*.
</div>
</p>
<h2>Methods</h2>
See [page:BufferAttribute] for inherited methods.
<p>See [page:BufferAttribute] for inherited methods.</p>
<h2>Source</h2>
......
......@@ -12,35 +12,35 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
An instanced version of [page:BufferGeometry].
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( )</h3>
<div>
</div>
<p>
</p>
<h2>Properties</h2>
See [page:BufferGeometry] for inherited properties.
<h3>[property:Number maxInstancedCount]</h3>
<div>
<p>
Default is *undefined*.
</div>
</p>
<h3>[property:Boolean isInstancedBufferGeometry]</h3>
<div>
<p>
Default is *true*.
</div>
</p>
<h2>Methods</h2>
See [page:BufferAttribute] for inherited methods.
<p>See [page:BufferAttribute] for inherited methods.</p>
<h3>[property:Number addGroup]( start, count, materialIndex )</h3>
<div>
<p>
</div>
</p>
<h2>Source</h2>
......
......@@ -12,30 +12,34 @@
<h1>[name]</h1>
<div class="desc">
<p class="desc">
An instanced version of [page:InterleavedBuffer].
</div>
</p>
<h2>Constructor</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Number meshPerAttribute] )</h3>
<div>
</div>
<p>
</p>
<h2>Properties</h2>
See [page:InterleavedBuffer] for inherited properties.
<p>
See [page:InterleavedBuffer] for inherited properties.
</p>
<h3>[property:Number meshPerAttribute]</h3>
<div>
<p>
Default is *1*.
</div>
</p>
<h3>[property:Boolean isInstancedInterleavedBuffer]</h3>
<div>
<p>
Default is *true*.
</div>
</p>
<h2>Methods</h2>
See [page:InterleavedBuffer] for inherited methods.
<p>
See [page:InterleavedBuffer] for inherited methods.
</p>
<h2>Source</h2>
......
......@@ -10,107 +10,107 @@
<body>
<h1>[name]</h1>
<div class="desc">
<p class="desc">
"Interleaved" means that multiple attributes, possibly of different types, (e.g., position, normal, uv, color) are packed into a single array buffer.
<br/><br/>
An introduction into interleaved arrays can be found here: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
</div>
</p>
<h2>Example</h2>
<div>[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]</div>
<p>[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]</p>
<h2>Constructor</h2>
<h3>[name]( [param:TypedArray array], [param:Integer stride] )</h3>
<div>
<p>
[page:TypedArray array] -- A typed array with a shared buffer. Stores the geometry data.<br/>
[page:Integer stride] -- The number of typed-array elements per vertex.
</div>
</p>
<h2>Properties</h2>
<h3>[property:Array array]</h3>
<div>
<p>
A typed array with a shared buffer. Stores the geometry data.
</div>
</p>
<h3>[property:Integer stride]</h3>
<div>
<p>
The number of typed-array elements per vertex.
</div>
</p>
<h3>[property:Integer count]</h3>
<div>
<p>
Gives the total number of elements in the array.
</div>
</p>
<h3>[property:Boolean dynamic]</h3>
<div>
<p>
Default is *false*.
</div>
</p>
<h3>[property:Object updateRange]</h3>
<div>
<p>
Object containing offset and count.
</div>
</p>
<h3>[property:Number updateRange.offset]</h3>
<div>
<p>
Default is *0*.
</div>
</p>
<h3>[property:Number updateRange.count]</h3>
<div>
<p>
Default is *-1*.
</div>
</p>
<h3>[property:Integer version]</h3>
<div>
<p>
A version number, incremented every time the needsUpdate property is set to true.
</div>
</p>
<h3>[property:Integer isInterleavedBuffer]</h3>
<div>
<p>
Default is *true*.
</div>
</p>
<h3>[property:Integer needsUpdate]</h3>
<div>
<p>
Default is *false*. Setting this to true increments [page:InterleavedBuffer.version version].
</div>
</p>
<h2>Methods</h2>
<h3>[method:null setArray] ( [param:TypedArray array] ) </h3>
<div>
<p>
array - must be a Typed Array.
</div>
</p>
<h3>[method:InterleavedBuffer setDynamic] ( [param:Boolean value] ) </h3>
<div>
<p>
Set [page:InterleavedBuffer.dynamic dynamic] to value.
</div>
</p>
<h3>[method:InterleavedBuffer copy]( source ) </h3>
<div>
<p>
Copies another [name] to this [name].
</div>
</p>
<h3>[method:InterleavedBuffer copyAt]( index1, attribute, index2 ) </h3>
<div>Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].</div>
<p>Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].</p>
<h3>[method:InterleavedBuffer set]( value, offset ) </h3>
<div>
<p>
value - The source (typed) array.<br/>
offset - The offset into the target array at which to begin writing values from the source array. Default is *0*.<br/><br />
Stores multiple values in the buffer, reading input values from a specified array.
</div>
</p>
<h3>[method:InterleavedBuffer clone]() </h3>
<div>
<p>
Creates a clone of this [name].
</div>
</p>
<h2>Source</h2>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册