提交 6b0f1a2f 编写于 作者: T Takahiro

Merge remote-tracking branch 'upstream/dev' into MMDExporter

three.js
========
[![Latest NPM release][npm-badge]][npm-badge-url]
[![License][license-badge]][license-badge-url]
[![Dependencies][dependencies-badge]][dependencies-badge-url]
[![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url]
#### JavaScript 3D library ####
The aim of the project is to create an easy to use, lightweight, 3D library. The library provides <canvas>, <svg>, CSS3D and WebGL renderers.
......@@ -66,3 +71,14 @@ If everything went well you should see [this](http://jsfiddle.net/hfj7gm6t/).
### Change log ###
[releases](https://github.com/mrdoob/three.js/releases)
[npm-badge]: https://img.shields.io/npm/v/three.svg
[npm-badge-url]: https://www.npmjs.com/package/three
[license-badge]: https://img.shields.io/npm/l/three.svg
[license-badge-url]: ./LICENSE
[dependencies-badge]: https://img.shields.io/david/mrdoob/three.js.svg
[dependencies-badge-url]: https://david-dm.org/mrdoob/three.js
[devDependencies-badge]: https://img.shields.io/david/dev/mrdoob/three.js.svg
[devDependencies-badge-url]: https://david-dm.org/mrdoob/three.js#info=devDependencies
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>Polyfills</h1>
<div class="desc">Three includes polyfills for the following functions and constants.</div>
<h3>[page:Number.EPSILON Number.EPSILON]</h3>
<div>
The difference between one and the smallest value greater than one that can be represented as a Number.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON MDN reference].
</div>
<h3>[page:Math.sign Math.sign]( [page:Number x] )</h3>
<div>
If the argument is a positive number, negative number, positive zero or negative zero,
the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign MDN reference].
</div>
<h3>[page:Function.prototype.name Function.prototype.name]( [page:Number x] )</h3>
<div>
Returns the name of a function, or (before ES6 implementations) an empty string for anonymous functions.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name MDN reference].
</div>
<h3>[page:Object.assign Object.assign]( [page:Object target], [page:Object ...sources] )</h3>
<div>
The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object.
It will return the target object.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign MDN reference].
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">A group of objects that receives a shared animation state.</div>
<h2>Usage:</h2>
<div>
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>
<h2>Limitations</h2>
<div>
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>
<h2>Constructor</h2>
<h3>[name]( [page:object obj1], [page:object obj2], [page:object obj3], ... )</h3>
<h2>Properties</h2>
<h3>[property:object stats]</h3>
<div>
</div>
<h3>[property:Number timeScale]</h3>
<h2>Methods</h2>
<h3>[method:null add]( [page:object obj1], [page:object obj2], [page:object obj3], ... )</h3>
<div>
</div>
<h3>[method:null remove]( [page:object obj1], [page:object obj2], [page:object obj3], ... )</h3>
<div>
</div>
<h3>[method:null uncache]( [page:object obj1], [page:object obj2], [page:object obj3], ... )</h3>
<div>
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">
An object with various functions to assist with animations.
</div>
<h2>Methods</h2>
<h3>[method:Array arraySlice]( array, from, to )</h3>
<div>
Convert an array to a specific type.
</div>
<h3>[method:Array convertArray]( array, type, forceClone )</h3>
<div>
This is the same as Array.prototype.slice, but also works on typed arrays.
</div>
<h3>[method:Boolean isTypedArray]( object )</h3>
<div>
Return *true* if the object is a typed array.
</div>
<h3>[method:Array getKeyframeOrder]( times )</h3>
<div>
Returns an array by which times and values can be sorted.
</div>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
<div>
Sort the array previously returned by [page:AnimationUtils.getKeyframeOrder getKeyframeOrder].
</div>
<h3>[method:Array flattenJSON]( jsonKeys, times, values, valuePropertyName )</h3>
<div>
Used for parsing AOS keyframe formats
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">
A timed sequence of [link:https://en.wikipedia.org/wiki/Key_frame keyframes] for animating
a specific property of an object.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values], [page:Constant interpolation] )</h3>
<div>
-- [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>
<h2>Properties</h2>
<h3>[property:String name]</h3>
<div>
The name given to the KeyframeTrack in the constructor.
</div>
<h3>[property:Float32Array times]</h3>
<div>
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array]
of keyframe times.
</div>
<h3>[property:Float32Array values]</h3>
<div>
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array]
of keyframe values, corresponding to the [page:KeyframeTrack.times times].
</div>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
The default tnterpolation type to use, [page:Animation InterpolateLinear].
</div>
<h2>Methods</h2>
<h3>[method:null createInterpolant ]( )</h3>
<div>
Create a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant]
or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter
passed in the constructor.
</div>
<h3>[method:null getInterpolation ]( )</h3>
<div>
Get the interpolation type.
</div>
<h3>[method:Number getValueSize ]( )</h3>
<div>
The the size of each value (length of the values array divied by length of times array).
</div>
<h3>[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete ]( result )</h3>
<div>
Create a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times]
and [page:KeyframeTrack.times values].
</div>
<h3>[method:null InterpolantFactoryMethodLinear ]( )</h3>
<div>
Create a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times]
and [page:KeyframeTrack.times values].
</div>
<h3>[method:null InterpolantFactoryMethodSmooth ]( )</h3>
<div>
Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times]
and [page:KeyframeTrack.times values].
</div>
<h3>[method:null optimize ]( )</h3>
<div>
Remove equivalent sequential keys, which are common in morph target sequences. <br />
Called automatically by the constructor.
</div>
<h3>[method:KeyframeTrack parse]( [page:JSON json] )</h3>
<div>
Parse json and return new keyframe track of the correct type.
</div>
<h3>[method:null scale ]( )</h3>
<div>
Scale all keyframe times by a factor (useful for frame <-> seconds conversions).
</div>
<h3>[method:null setInterpolation ]( [page:Constant interpolation] )</h3>
<div>
Set the interpolation type. See [page:Animation animation constants] for choices.
</div>
<h3>[method:null shift ]( [page:Number timeOffset] )</h3>
<div>
Move all keyframes either forwards or backwards in time.
</div>
<h3>[method:null TimeBufferType ]( )</h3>
<div>
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
used to convert the times array passed in the constructor to a Float32Array.
</div>
<h3>[method:JSON toJSON]( [page:KeyframeTrack track] )</h3>
<div>
Convert the track to JSON.
</div>
<h3>[method:null trim ]( [page:Number startTime], [page:Number endTime] )</h3>
<div>
Removes keyframes before [page:Number startTime] and after [page:Number endTime]
without changing any values within the range [[page:Number startTime], [page:Number endTime]].
</div>
<h3>[method:null validate ]( )</h3>
<div>
Perform minimal validation on the tracks. Called automatically by the constructor.
</div>
<h3>[method:null ValueBufferType ]( )</h3>
<div>
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
used to convert the values array passed in the constructor to a Float32Array.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">
This holds a reference to a real property in the scene graph.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:Object3D rootNode], path, parsedPath )</h3>
<div>
-- [page:Object3D rootNode]:
-- path
-- parsedPath (optional)
</div>
<h2>Properties</h2>
<h3>[property:Number path]</h3>
<div>
</div>
<h3>[property:Number parsedPath]</h3>
<div>
</div>
<h3>[property:Number node]</h3>
<div>
</div>
<h3>[property:Number rootNode]</h3>
<div>
</div>
<h3>[property:Object BindingType]</h3>
<div>
</div>
<h3>[property:Object Versioning]</h3>
<div>
</div>
<h3>[property:Array GetterByBindingType]</h3>
<div>
</div>
<h3>[property:Array SetterByBindingTypeAndVersioning]</h3>
<div>
</div>
<h2>Methods</h2>
<h3>[method:null getValue]( [page:Array targetArray], [page:Number offset] )</h3>
<div>
</div>
<h3>[method:null setValue]( [page:Array sourceArray], [page:Number offset] )</h3>
<div>
</div>
<h3>[method:null bind]( )</h3>
<div>
Create getter / setter pair for a property in the scene graph. Used internally by
[page:PropertyBinding.getValue getValue] and [page:PropertyBinding.setValue setValue].
</div>
<h3>[method:null unbind]( )</h3>
<div>
Unbind getter / setter pair for a property in the scene graph.
</div>
<h3>[method:Constructor Composite]( targetGroup, path, optionalParsedPath )</h3>
<div>
Create a new Composite PropertyBinding.
</div>
<h3>[method:Constructor create]( root, path, parsedPath )</h3>
<div>
Create a new Composite PropertyBinding (if root is an [page:AnimationObjectGroup]) or PropertyBinding.
</div>
<h3>[method:Constructor parseTrackName]( trackName )</h3>
<div>
Matches strings in the following forms:<br />
-- nodeName.property<br />
-- nodeName.property[accessor]<br />
-- nodeName.material.property[accessor]<br />
-- uuid.property[accessor]<br />
-- uuid.objectName[objectIndex].propertyName[propertyIndex]<br />
-- parentName/nodeName.property<br />
-- parentName/parentName/nodeName.property[index]<br />
-- .bone[Armature.DEF_cog].position<br />
-- scene:helium_balloon_model:helium_balloon_model.position
</div>
<h3>[method:Constructor findNode]( root, nodeName )</h3>
<div>
Find a node in a node tree or [page:Skeleton Skeleton].
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">
Buffered scene graph property that allows weighted accumulation.
</div>
<h2>Constructor</h2>
<h3>[name]( binding, typeName, valueSize )</h3>
<div>
-- binding <br />
-- typeName <br />
-- valueSize <br />
</div>
<h2>Properties</h2>
<h3>[property:Number binding]</h3>
<div>
</div>
<h3>[property:Number buffer]</h3>
<div>
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 />
'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>
<h3>[property:Number cumulativeWeight]</h3>
<div>
Default is *0*.
</div>
<h3>[property:Number valueSize]</h3>
<div>
</div>
<h3>[property:Number referenceCount]</h3>
<div>
Default is *0*.
</div>
<h3>[property:Number useCount]</h3>
<div>
Default is *0*.
</div>
<h2>Methods</h2>
<h3>[method:null accumulate]( accuIndex, weight )</h3>
<div>
Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.<br />
If weight is *0* this does nothing.
</div>
<h3>[method:null apply]( accuIndex )</h3>
<div>
Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
</div>
<h3>[method:null saveOriginalState]( )</h3>
<div>
Remember the state of the bound property and copy it to both accus.
</div>
<h3>[method:null restoreOriginalState]( )</h3>
<div>
Apply the state previously taken via 'saveOriginalState' to the binding.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:KeyframeTrack] &rarr;
<h1>[name]</h1>
<div class="desc">
A Track of Boolean keyframe values.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values] )</h3>
<div>
-- [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>
<h2>Properties</h2>
See [page:KeyframeTrack] for inherited properties.
<h3>[property:String ValueTypeName]</h3>
<div>
String 'bool'.
</div>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
The default interpolation type to use, [page:Animation InterpolateDiscrete].
</div>
<h2>Methods</h2>
See [page:KeyframeTrack] for inherited methods.
<h3>[method:null InterpolantFactoryMethodLinear ]( )</h3>
<div>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
<h3>[method:null InterpolantFactoryMethodSmooth ]( )</h3>
<div>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
<h3>[method:null ValueBufferType ]( )</h3>
<div>
Used to convert the values array passed in the constructor to an Array.
Note: In this case this does nothing, other Track types may convert the array to a Typed Array.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:KeyframeTrack] &rarr;
<h1>[name]</h1>
<div class="desc">
A Track of keyframe values that represent color.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values] )</h3>
<div>
-- [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>
<h2>Properties</h2>
See [page:KeyframeTrack] for inherited properties.
<h3>[property:String ValueTypeName]</h3>
<div>
String 'color'.
</div>
<h2>Methods</h2>
See [page:KeyframeTrack] for inherited methods.
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:KeyframeTrack] &rarr;
<h1>[name]</h1>
<div class="desc">
A Track of numeric keyframe values.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values] )</h3>
<div>
-- [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>
<h2>Properties</h2>
See [page:KeyframeTrack] for inherited properties.
<h3>[property:String ValueTypeName]</h3>
<div>
String 'number'.
</div>
<h2>Methods</h2>
See [page:KeyframeTrack] for inherited methods.
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:KeyframeTrack] &rarr;
<h1>[name]</h1>
<div class="desc">
A Track of quaternion keyframe values.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values] )</h3>
<div>
-- [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>
<h2>Properties</h2>
See [page:KeyframeTrack] for inherited properties.
<h3>[property:String ValueTypeName]</h3>
<div>
String 'quaternion'.
</div>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
The default interpolation type to use, [page:Animation InterpolateLinear].
</div>
<h2>Methods</h2>
See [page:KeyframeTrack] for inherited methods.
<h3>[method:Number getValueSize ]( )</h3>
<div>
The the size of each value (length of the values array divied by length of times array).
</div>
<h3>[method:null InterpolantFactoryMethodLinear ]( )</h3>
<div>
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>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:KeyframeTrack] &rarr;
<h1>[name]</h1>
<div class="desc">
A Track of String keyframe values.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values] )</h3>
<div>
-- [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>
<h2>Properties</h2>
See [page:KeyframeTrack] for inherited properties.
<h3>[property:String ValueTypeName]</h3>
<div>
String 'string'.
</div>
<h3>[property:Constant DefaultInterpolation]</h3>
<div>
The default interpolation type to use, [page:Animation InterpolateDiscrete].
</div>
<h2>Methods</h2>
See [page:KeyframeTrack] for inherited methods.
<h3>[method:null InterpolantFactoryMethodLinear ]( )</h3>
<div>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
<h3>[method:null InterpolantFactoryMethodSmooth ]( )</h3>
<div>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
</div>
<h3>[method:null ValueBufferType ]( )</h3>
<div>
Used to convert the values array passed in the constructor to an Array.
Note: In this case this does nothing, other Track types may convert the array to a Typed Array.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:KeyframeTrack] &rarr;
<h1>[name]</h1>
<div class="desc">
A Track of Vector keyframe values.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:String name], [page:Array times], [page:Array values] )</h3>
<div>
-- [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>
<h2>Properties</h2>
See [page:KeyframeTrack] for inherited properties.
<h3>[property:String ValueTypeName]</h3>
<div>
String 'vector'.
</div>
<h2>Methods</h2>
See [page:KeyframeTrack] for inherited methods.
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Object3D] &rarr;
<h1>[name]</h1>
<div 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>
<h2>Example</h2>
<div>[example:misc_sound misc / sound ]</div>
<code>
//Create an AudioListener and add it to the camera
var listener = new THREE.AudioListener();
camera.add( listener );
// create a global audio source
var sound = new THREE.Audio( listener );
var audioLoader = new THREE.AudioLoader();
//Load a sound and set it as the Audio object's buffer
audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop(true);
sound.setVolume(0.5);
sound.play();
});
</code>
<h2>Constructor</h2>
<h3>[name]( [page:AudioListener listener] )</h3>
<div>
listener — (required) [page:AudioListener AudioListener] instance.
</div>
<h2>Properties</h2>
<h3>[property:Boolean autoplay]</h3>
<div>Whether to start playback automatically. Default is *false*.</div>
<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>
<h3>[property:Array filters]</h3>
<div>Whether the audio is currently playing. Default is empty array.</div>
<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>
</div>
<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>
<h3>[property:Number playbackRate]</h3>
<div>Speed of playback. Default is *1*.</div>
<h3>[property:Boolean isPlaying]</h3>
<div>Whether the audio is currently playing.</div>
<h3>[property:Number startTime]</h3>
<div>Point at which to start playback. Default is *0*.</div>
<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>
<h3>[property:String sourceType]</h3>
<div>Type of the audio source. Default is string 'empty'.</div>
<h3>[property:String type]</h3>
<div>String denoting the type, set to 'Audio'.</div>
<h2>Methods</h2>
<h3>[method:null connect]()</h3>
<div>
Connect to the [page:Audio.source]. This is used internally on initialisation and when
setting / removing filters.
</div>
<h3>[method:null disconnect]()</h3>
<div>
Disconnect from the [page:Audio.source]. This is used internally when
setting / removing filters.
</div>
<h3>[method:Array getFilter]()</h3>
<div>
Returns the first element of the [page:Audio.filters filters] array.
</div>
<h3>[method:null getFilters]()</h3>
<div>
Returns the [page:Audio.filters filters] array.
</div>
<h3>[method:Boolean getLoop]()</h3>
<div>
Return the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop]
(whether playback should loop).
</div>
<h3>[method:GainNode getOutput]()</h3>
<div>
Return the [page:Audio.gain gainNode].
</div>
<h3>[method:Number getPlaybackRate]()</h3>
<div>
Return the value of [page:Audio.playbackRate playbackRate].
</div>
<h3>[method:Number getVolume]( value )</h3>
<div>
Return the current volume.
</div>
<h3>[method:null play]()</h3>
<div>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, starts playback.
</div>
<h3>[method:null pause]()</h3>
<div>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, pauses playback.
</div>
<h3>[method:null onEnded]()</h3>
<div>
Called automatically when playback finished. Sets If [page:Audio.isPlaying isPlaying] to false.
</div>
<h3>[method:Audio setBuffer]( audioBuffer )</h3>
<div>
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>
<h3>[method:null setFilter]( filter )</h3>
<div>
Add the filter to the [page:Audio.filters filters] array.
</div>
<h3>[method:Audio setFilters]( [page:Array value] )</h3>
<div>
value - arrays of filters.<br />
Set the [page:Audio.filters filters] array to *value*.
</div>
<h3>[method:null setLoop]( [page:Boolean value] )</h3>
<div>
Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] to *value*
(whether playback should loop).
</div>
<h3>[method:null setNodeSource]( audioNode )</h3>
<div>
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>
<h3>[method:null setPlaybackRate]( [page:Number value] )</h3>
<div>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, set the [page:Audio.playbackRate playbackRate] to *value*.
</div>
<h3>[method:null setVolume]( [page:Number value] )</h3>
<div>
Set the volume.
</div>
<h3>[method:null stop]()</h3>
<div>
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>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">
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>
<h2>Example</h2>
<div>[example:misc_sound misc / sound ]</div>
<code>
//Create an AudioListener and add it to the camera
var listener = new THREE.AudioListener();
camera.add( listener );
// create an Audio source
var sound = new THREE.Audio( listener );
var audioLoader = new THREE.AudioLoader();
//Load a sound and set it as the Audio object's buffer
audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop(true);
sound.setVolume(0.5);
sound.play();
});
//Create an AudioAnalyser, passing in the sound and desired fftSize
var analyser = new THREE.AudioAnalyser( sound, 32 );
//Get the average frequency of the sound
analyser.getAverageFrequency();
</code>
<h2>Constructor</h2>
<h3>[name]( audio, [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize fftSize] )</h3>
<div>
Create a new [page:AudioAnalyser AudioAnalyser].
</div>
<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>
<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 />
See [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize this page] for details.
</div>
<h3>[property:Uint8Array data]</h3>
<div>
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>
<h2>Methods</h2>
<h3>[method:Uint8Array getFrequencyData]()</h3>
<div>
Uses the Web Audio's [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData getByteFrequencyData] method.
See that page.
</div>
<h3>[method:Number getAverageFrequency]()</h3>
<div>
Get the average of the frequencies returned by the [page:AudioAnalyser.getFrequencyData getFrequencyData] method.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">
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>
<h2>Methods</h2>
<h3>[method:AudioContext getContext]()</h3>
<div>
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>
<h3>[method:AudioContext setContext]( [page:AudioConetxt value] )</h3>
<div>
Set the variable *context* in the outer scope to *value*.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Object3D] &rarr;
<h1>[name]</h1>
<div 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>
<h2>Example</h2>
<div>[example:misc_sound misc / sound ]</div>
<code>
//Create an AudioListener and add it to the camera
var listener = new THREE.AudioListener();
camera.add( listener );
// create a global audio source
var sound = new THREE.Audio( listener );
var audioLoader = new THREE.AudioLoader();
//Load a sound and set it as the Audio object's buffer
audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop(true);
sound.setVolume(0.5);
sound.play();
});
</code>
<h2>Constructor</h2>
<h3>[name]( )</h3>
<div>
Create a new AudioListener.
</div>
<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>
<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>
</div>
<h3>[property:AudioNode filter]</h3>
<div>Default is *null*.</div>
<h2>Methods</h2>
<h3>[method:GainNode getInput]()</h3>
<div>
Return the [page:AudioListener.gain gainNode].
</div>
<h3>[method:null removeFilter]()</h3>
<div>
Set the [page:AudioListener.filter filter] property to *null*.
</div>
<h3>[method:AudioNode getFilter]()</h3>
<div>
Returns the value of the [page:AudioListener.filter filter] property.
</div>
<h3>[method:null setFilter]( [page:AudioNode value] )</h3>
<div>
Set the [page:AudioListener.filter filter] property to *value*.
</div>
<h3>[method:Number getMasterVolume]()</h3>
<div>
Return the volume.
</div>
<h3>[method:null getMasterVolume]( [page:Number value] )</h3>
<div>
Set the volume.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Object3D] &rarr; [page:Audio] &rarr;
<h1>[name]</h1>
<div 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>
<h2>Example</h2>
<div>[example:misc_sound misc / sound ]</div>
<code>
//Create an AudioListener and add it to the camera
var listener = new THREE.AudioListener();
camera.add( listener );
//Create the PositionalAudio object (passing in the listener)
var sound = new THREE.PositionalAudio( listener );
//Load a sound and set it as the PositionalAudio object's buffer
var audioLoader = new THREE.AudioLoader();
audioLoader.load( 'sounds/song.ogg', function( buffer ) {
sound1.setBuffer( buffer );
sound1.setRefDistance( 20 );
sound1.play();
});
//Create an object for the sound to play from
var sphere = new THREE.SphereGeometry( 20, 32, 16 );
var material = new THREE.MeshPhongMaterial( { color: 0xff2200 } );
var mesh = new THREE.Mesh( sphere, material );
scene.add( mesh );
//Finally add the sound to the mesh
mesh.add( sound );
</code>
<h2>Constructor</h2>
<h3>[name]( [page:AudioListener listener] )</h3>
<div>
listener — (required) [page:AudioListener AudioListener] instance.
</div>
<h2>Properties</h2>
<div>
See the [page:Audio Audio] class for inherited properties.
</div>
<h3>[property:PannerNode panner]</h3>
<div>The PositionalAudio's [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode PannerNode].</div>
<h2>Methods</h2>
<div>
See the [page:Audio Audio] class for inherited methods.
</div>
<h3>[method:PannerNode getOutput]()</h3>
<div>
Returns the [page:PositionalAudio.panner panner].
</div>
<h3>[method:Number getRefDistance]()</h3>
<div>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
</div>
<h3>[method:PannerNode setRefDistance]( [page:Number value] )</h3>
<div>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
</div>
<h3>[method:PannerNode getRolloffFactor]()</h3>
<div>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
</div>
<h3>[method:PannerNode setRolloffFactor]( [page:Number value] )</h3>
<div>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
</div>
<h3>[method:String getDistanceModel]()</h3>
<div>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
</div>
<h3>[method:String setDistanceModel]( [page:String value] )</h3>
<div>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
</div>
<h3>[method:PannerNode getMaxDistance]()</h3>
<div>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.distanceModel].
</div>
<h3>[method:PannerNode setMaxDistance]( [page:Number value] )</h3>
<div>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.distanceModel].
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>Core Constants</h1>
<h2>Revision Number</h2>
<code>
THREE.REV
</code>
<div id="rev">
The current Three.js [link:https://github.com/mrdoob/three.js/releases revision number].
</div>
<h2>Mouse Buttons</h2>
<code>
THREE.MOUSE.LEFT
THREE.MOUSE.MIDDLE
THREE.MOUSE.RIGHT
</code>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
</body>
</html>
......@@ -54,7 +54,7 @@
A version number, incremented every time the needsUpdate property is set to true.
</div>
<h3>[property:Function onUpload]</h3>
<h3>[property:Function onUploadCallback]</h3>
<div>
A callback function that is executed after the Renderer has transfered the attribute array data to the GPU.
</div>
......@@ -107,6 +107,12 @@
the value of the array at <code>index * itemSize + 3</code> to w.
</div>
<h3>[method:null onUpload]( [page:Function callback] ) </h3>
<div>
Sets the value of the onUploadCallback property.
</div>
<div>Example: [example:webgl_buffergeometry used to free memory after the buffer has been transfered to GPU].</div>
<h3>[method:BufferAttribute clone]() </h3>
<div>
Copies this attribute.
......
此差异已折叠。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:BufferAttribute] &rarr;
<h1>BufferAttribute Types</h1>
<div class="desc">
There are nine types of [page:BufferAttribute] available in Three. These correspond to the JavaScript
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#Syntax Typed Arrays].
</div>
<code>
THREE.Float64BufferAttribute
THREE.Float32BufferAttribute
THREE.Uint32BufferAttribute
THREE.Int32BufferAttribute
THREE.Uint16BufferAttribute
THREE.Int16BufferAttribute
THREE.Uint8ClampedBufferAttribute
THREE.Uint8BufferAttribute
THREE.Int8BufferAttribute
</code>
<h2>Constructor</h2>
All of the above are called in the same way.
<h3>TypedBufferAttribute( [page:Array array], [page:Integer itemSize] )</h3>
<div>
array -- this can be a typed or untyped (normal) array. It will be converted to the Type specified.<br /><br />
itemSize -- the number of values of the array that should be associated with a particular vertex.
</div>
<h2>Properties</h2>
See the [page:BufferAttribute] page for inherited properties.
<h2>Methods</h2>
See the [page:BufferAttribute] page for inherited methods.
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js src/core/BufferAttribute.js]
</body>
</html>
此差异已折叠。
此差异已折叠。
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<base href="../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<meta charset="utf-8">
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
The files under this directory are NOT under MIT license, but other licenses.
See Readme.txt for the summary, see each file's readme for the detail.
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册