提交 3e239215 编写于 作者: B Ben Houston

Merge branch 'dev' of git@github.com:mrdoob/three.js into phong_diffuseColor

Conflicts:
	examples/js/ShaderSkin.js
	examples/js/ShaderTerrain.js
	examples/js/shaders/NormalDisplacementShader.js
	src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl
	src/renderers/shaders/ShaderChunk/linear_to_gamma_fragment.glsl
	src/renderers/shaders/ShaderChunk/map_fragment.glsl
	src/renderers/shaders/ShaderChunk/map_particle_fragment.glsl
The MIT License
Copyright © 2010-2014 three.js authors
Copyright © 2010-2015 three.js authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
{
"name": "three.js",
"version": "0.0.69",
"version": "0.0.70",
"homepage": "http://threejs.org/",
"description": "JavaScript 3D library",
"main": "build/three.js",
......@@ -17,7 +17,8 @@
"*.md",
"docs",
"editor",
"examples",
"examples/*",
"!examples/js",
"src",
"test",
"utils",
......
此差异已折叠。
此差异已折叠。
......@@ -24,7 +24,7 @@
scene.add( cubeCamera );
//Create car
var chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, ambient: 0xffffff, envMap: cubeCamera.renderTarget } );
var chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cubeCamera.renderTarget } );
var car = new Mesh( carGeometry, chromeMaterial );
scene.add( car );
......
......@@ -13,7 +13,9 @@
<div>
THREE.AddEquation<br />
THREE.SubtractEquation<br />
THREE.ReverseSubtractEquation
THREE.ReverseSubtractEquation<br />
THREE.MinEquation<br />
THREE.MaxEquation
</div>
<h2>Destination Factors</h2>
......
......@@ -7,7 +7,7 @@
<link type="text/css" rel="stylesheet" href="../../page.css" />
</head>
<body>
<h1>GL State Conflicts</h1>
<h1>GL State Constants</h1>
<h2>Cull Face</h2>
<div>
......
......@@ -21,6 +21,8 @@
THREE.UVMapping<br />
THREE.CubeReflectionMapping<br />
THREE.CubeRefractionMapping<br />
THREE.EquirectangularReflectionMapping<br />
THREE.EquirectangularRefractionMapping<br />
THREE.SphericalReflectionMapping
</div>
......@@ -49,7 +51,8 @@
THREE.UnsignedShortType<br />
THREE.IntType<br />
THREE.UnsignedIntType<br />
THREE.FloatType
THREE.FloatType<br />
THREE.HalfFloatType
</div>
<h2>Pixel Types</h2>
......@@ -65,10 +68,11 @@
THREE.RGBFormat<br />
THREE.RGBAFormat<br />
THREE.LuminanceFormat<br />
THREE.LuminanceAlphaFormat
THREE.LuminanceAlphaFormat<br />
THREE.RGBEFormat
</div>
<h2>Compressed Texture Formats</h2>
<h2>DDS / ST3C Compressed Texture Formats</h2>
<div>
THREE.RGB_S3TC_DXT1_Format<br />
THREE.RGBA_S3TC_DXT1_Format<br />
......@@ -76,6 +80,13 @@
THREE.RGBA_S3TC_DXT5_Format
</div>
<h2>PVRTC Compressed Texture Formats</h2>
<div>
THREE.RGB_PVRTC_4BPPV1_Format<br />
THREE.RGB_PVRTC_2BPPV1_Format<br />
THREE.RGBA_PVRTC_4BPPV1_Format<br />
THREE.RGBA_PVRTC_2BPPV1_Format
</div>
<h2>Source</h2>
......
......@@ -25,7 +25,7 @@
<h3>[property:Integer id]</h3>
<div>
Unique number for this object instance.
readonly – Unique number for this object instance.
</div>
<h3>[property:String uuid]</h3>
......@@ -59,11 +59,6 @@
Object's local rotation (<a href="https://en.wikipedia.org/wiki/Euler_angles" target="_blank">Euler angles</a>), in radians.
</div>
<h3>[property:String eulerOrder]</h3>
<div>
Order of axis for Euler angles.
</div>
<h3>[property:Vector3 scale]</h3>
<div>
Object's local scale.
......@@ -81,48 +76,64 @@
<h3>[property:Quaternion quaternion]</h3>
<div>
Object's local rotation as [page:Quaternion Quaternion]. Only used when useQuaternion is set to true.
</div>
<h3>[property:Boolean useQuaternion]</h3>
<div>
Use quaternion instead of Euler angles for specifying local rotation.
Object's local rotation as [page:Quaternion Quaternion].
</div>
<h3>[property:Boolean visible]</h3>
<div>
Object gets rendered if *true*.
</div>
<div>
default – true
</div>
<h3>[property:Boolean castShadow]</h3>
<div>
Gets rendered into shadow map.
</div>
<div>
default – false
</div>
<h3>[property:Boolean receiveShadow]</h3>
<div>
Material gets baked in shadow receiving.
</div>
<div>
default – false
</div>
<h3>[property:Boolean frustumCulled]</h3>
<div>
When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible.
</div>
<div>
default – true
</div>
<h3>[property:Boolean matrixAutoUpdate]</h3>
<div>
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.
</div>
<div>
default – true
</div>
<h3>[property:Boolean matrixWorldNeedsUpdate]</h3>
<div>
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
</div>
<div>
default – false
</div>
<h3>[property:Boolean rotationAutoUpdate]</h3>
<div>
When this is set, then the rotationMatrix gets calculated every frame.
</div>
<div>
default – true
</div>
<h3>[property:object userData]</h3>
<div>
......@@ -195,29 +206,46 @@
Rotates object to face point in space.
</div>
<h3>[method:null add]( [page:Object3D object] )</h3>
<h3>[method:null add]( [page:Object3D object], ... )</h3>
<div>
object - An object.<br />
</div>
<div>
Adds *object* as child of this object.
Adds *object* as child of this object. An arbitrary number of objects may be added.
</div>
<h3>[method:null remove]( [page:Object3D object] )</h3>
<h3>[method:null remove]( [page:Object3D object], ... )</h3>
<div>
object - An object.<br />
</div>
<div>
Removes *object* as child of this object.
Removes *object* as child of this object. An arbitrary number of objects may be removed.
</div>
<h3>[method:null traverse]( [page:Function callback] )</h3>
<div>
callback - An Function with as first argument an object3D object.<br />
callback - A function with as first argument an object3D object.<br />
</div>
<div>
Executes the callback on this object and all descendants.
</div>
<h3>[method:null traverseVisible]( [page:Function callback] )</h3>
<div>
callback - A function with as first argument an object3D object.<br />
</div>
<div>
Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
</div>
<h3>[method:null traverseAncestors]( [page:Function callback] )</h3>
<div>
callback - A function with as first argument an object3D object.<br />
</div>
<div>
Executes the callback on this object and all ancestors.
</div>
<h3>[method:null updateMatrix]()</h3>
<div>
......@@ -235,22 +263,20 @@
</div>
<h3>[method:Object3D getObjectByName]([page:String name], [page:Boolean recursive])</h3>
<h3>[method:Object3D getObjectByName]([page:String name])</h3>
<div>
name -- String to match to the children's Object3d.name property. <br />
recursive -- Boolean whether to search through the children's children. Default is false.
</div>
<div>
Searches through the object's children and returns the first with a matching name, optionally recursive.
Searches through the object's children and returns the first with a matching name.
</div>
<h3>[method:Object3D getObjectById]([page:Integer id], [page:Boolean recursive])</h3>
<h3>[method:Object3D getObjectById]([page:Integer id])</h3>
<div>
id -- Unique number of the object instance<br />
recursive -- Boolean whether to search through the children's children. Default is false.
</div>
<div>
Searches through the object's children and returns the first with a matching id, optionally recursive.
Searches through the object's children and returns the first with a matching id.
</div>
<h3>[method:Object3D translateOnAxis]([page:Vector3 axis], [page:Float distance])</h3>
......@@ -271,6 +297,11 @@
Rotate an object along an axis in object space. The axis is assumed to be normalized.
</div>
<h3>[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])</h3>
<div>
Abstract method to get intersections between a casted ray and this object. Subclasses such as [page:Mesh], [page:Line], and [page:PointCloud] implement this method in order to participate in raycasting.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -11,18 +11,67 @@
<div class="desc">
This class makes raycasting easier. Raycasting is used for picking and more.
</div>
<h2>Example</h2>
<code>
var raycaster = new THREE.Raycaster();
var mouse = new THREE.Vector2();
function onMouseMove( event ) {
// calculate mouse position in normalized device coordinates
// (-1 to +1) for both components
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
}
function render() {
// update the picking ray with the camera and mouse position
raycaster.setFromCamera( mouse, camera );
// calculate objects intersecting the picking ray
var intersects = raycaster.intersectObjects( scene.children );
for ( var i = 0; i < intersects.length; i++ ) {
intersects[ i ].object.material.color.set( 0xff0000 );
}
renderer.render( scene, camera );
}
window.addEventListener( 'mousemove', onMouseMove, false );
window.requestAnimationFrame(render);
</code>
<div>Examples: [example:webgl_interactive_cubes Raycasting to a Mesh],
[example:webgl_interactive_cubes_ortho Raycasting to a Mesh in using an OrthographicCamera],
[example:webgl_interactive_buffergeometry Raycasting to a Mesh with BufferGeometry],
[example:webgl_interactive_lines Raycasting to a Line],
[example:webgl_interactive_raycasting_pointcloud Raycasting to a PointCloud],
[example:webgl_geometry_terrain_raycast Terrain raycasting],
[example:webgl_octree_raycasting Raycasting using an octree],
[example:webgl_interactive_voxelpainter Raycasting to paint voxels]</div>
<div>
</div>
<h2>Constructor</h2>
<h3>[name]( [page:Vector3 origin], [page:Vector3 direction], [page:Float near], [page:Float far] ) {</h3>
<div>
[page:Vector3 origin] — The origin vector where the ray casts from.<br />
[page:Vector3 direction] — The direction vector that gives direction to the ray.<br />
[page:Float near] — All results returned are further away then near. Near can't be negative. Default value is 0.<br />
[page:Float near] — All results returned are further away than near. Near can't be negative. Default value is 0.<br />
[page:Float far] — All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
</div>
<div>
......@@ -51,7 +100,12 @@
<h3>[property:float precision]</h3>
<div>
The precision factor of the raycaster.
The precision factor of the raycaster when intersecting [page:Mesh] objects.
</div>
<h3>.[page:float linePrecision]</h3>
<div>
The precision factor of the raycaster when intersecting [page:Line] objects.
</div>
<h2>Methods</h2>
......@@ -65,16 +119,45 @@
Updates the ray with a new origin and direction.
</div>
<h3>[method:null setFromCamera]( [page:Vector2 coords], [page:Camera camera] )</h3>
<div>
[page:Vector2 coords] — 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1.<br />
[page:Camera camera] — camera from which the ray should originate
</div>
<div>
Updates the ray with a new origin and direction.
</div>
<h3>[method:Array intersectObject]( [page:Object3D object], [page:Boolean recursive] )</h3>
<div>
<p>
[page:Object3D object] — The object to check for intersection with the ray.<br />
[page:Boolean recursive] — If set, it also checks all descendants. Otherwise it only checks intersecton with the object.
</p>
</div>
<div>
checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first. An array of intersections is returned...
<code>
[ { distance, point, face, faceIndex, object }, ... ]
[ { distance, point, face, faceIndex, indices, object }, ... ]
</code>
<p>
[page:Float distance] – distance between the origin of the ray and the intersection<br />
[page:Vector3 point] – point of intersection, in world coordinates<br />
[page:Face3 face] – intersected face<br />
[page:Integer faceIndex] – index of the intersected face<br />
[page:Array indices] – indices of vertices comprising the intersected face<br />
[page:Object3D object] – the intersected object
</p>
<p>
When intersecting a [page:Mesh] with a [page:BufferGeometry], the *faceIndex* will be *undefined*, and *indices* will be set; when intersecting a [page:Mesh] with a [page:Geometry], *indices* will be *undefined*.
</p>
<p>
*Raycaster* delegates to the [page:Object3D.raycast raycast] method of the passed object, when evaluating whether the ray intersects the object or not. This allows [page:Mesh meshes] to respond differently to ray casting than [page:Line lines] and [page:PointCloud pointclouds].
</p>
<p>
*Note* that for meshes, faces must be pointed towards the origin of the [page:.ray ray] in order to be detected; intersections of the ray passing through the back of a face will not be detected. To raycast against both faces of an object, you'll want to set the [page:Mesh.material material]'s [page:Material.side side] property to *THREE.DoubleSide*.
</p>
</div>
<h3>[method:Array intersectObjects]( [page:Array objects], [page:Boolean recursive] )</h3>
......@@ -83,10 +166,7 @@
[page:Boolean recursive] — If set, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects.
</div>
<div>
checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first.
<code>
[ { distance, point, face, faceIndex, object }, ... ]
</code>
Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by [page:.intersectObject].
</div>
......
......@@ -58,7 +58,7 @@
<h3>[method:todo loadTexture]([page:String url], [page:UVMapping mapping], [page:Function onLoad], [page:Function onError])</h3>
<div>
url -- the url of the texture<br />
mapping -- Can be an instance of [page:UVMapping THREE.UVMapping], [page:CubeReflectionMapping THREE.CubeReflectionMapping] or [page:SphericalReflectionMapping THREE.SphericalReflectionMapping]. Describes how the image is applied to the object.<br />Use undefined instead of null as a default value. See mapping property of [page:Texture texture] for more details.
mapping -- Can be an instance of [page:UVMapping THREE.UVMapping], [page:CubeReflectionMapping THREE.CubeReflectionMapping] or [page:SphericalReflectionMapping THREE.SphericalReflectionMapping]. Describes how the image is applied to the object.<br />Use undefined instead of null as a default value. See mapping property of [page:Texture texture] for more details. <br/>
onLoad -- callback function<br />
onError -- callback function
</div>
......
......@@ -8,7 +8,7 @@
</head>
<body>
[page:Geometry] &rarr;
<h1>[name]</h1>
<div class="desc">A class for generating cylinder geometries</div>
......@@ -26,21 +26,23 @@
<h2>Constructor</h2>
<h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded])</h3>
<h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
radiusTop — Radius of the cylinder at the top. Default is 20.<br />
radiusBottom — Radius of the cylinder at the bottom. Default is 20.<br />
height — Height of the cylinder. Default is 100.<br />
radiusSegments — Number of segmented faces around the circumference of the cylinder. Default is 8<br />
heightSegments — Number of rows of faces along the height of the cylinder. Default is 1.<br />
openEnded — A Boolean indicating whether the ends of the cylinder are open or capped. Default is false, meaning capped.
openEnded — A Boolean indicating whether the ends of the cylinder are open or capped. Default is false, meaning capped.<br />
thetaStart — Start angle for first segment, default = 0 (three o'clock position).<br />
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cylinder.
</div>
<h2>Properties</h2>
<div>
Each of the contructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
......
......@@ -74,15 +74,15 @@
<div>
length -- The desired length<br />
headLength -- The length of the head of the arrow<br />
headWidth -- The length of the width of the arrow
headWidth -- The length of the width of the arrow
</div>
<div>
Sets the length of the arrowhelper.
</div>
<h3>[method:null setDirection]([page:vector3 dir])</h3>
<h3>[method:null setDirection]([page:Vector3 dir])</h3>
<div>
dir -- The desired direction in euler format.
dir -- The desired direction. Must be a unit vector.
</div>
<div>
Sets the direction of the arrowhelper.
......
......@@ -26,7 +26,7 @@
bbox.update();
scene.add( bbox );
</code>
<div>Note that this helper will create a wireframe [page:Mesh] object with a [page:BoxGeometry]; the resulting bounding box object will therefore have face diagonals. You may want to use [page:BoxHelper], which generates a [page:Line] object without face diagonals.</div>
<h2>Constructor</h2>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="../../../list.js"></script>
<script src="../../../page.js"></script>
<link type="text/css" rel="stylesheet" href="../../../page.css" />
</head>
<body>
[page:Line] &rarr;
<h1>[name]</h1>
<div class="desc">Helper object to show a wireframe box (with no face diagonals) around an object</div>
<h2>Example</h2>
<code>var sphere = new THREE.SphereGeometry();
var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial(0xff0000) );
var box = new THREE.BoxHelper( object );
scene.add( box );
</code>
<h2>Constructor</h2>
<h3>[name]( [page:Object3D object] )</h3>
<div>Creates a new wireframe box matching the size of the passed box.</div>
<h2>Properties</h2>
<div>(none)</div>
<h2>Methods</h2>
<h3>[method:null update]( [page:Object3D object] )</h3>
<div>
Updates the helper's geometry to match the dimensions of the [page:Geometry.boundingBox bounding box] of the passed object's geometry.
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
......@@ -11,26 +11,26 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">Visualize a [page:DirectionalLight]'s effect on the scene</div>
<h2>Constructor</h2>
<h3>[name]([page:todo light], [page:todo sphereSize])</h3>
<h3>[name]([DirectionalLight:todo light], [page:Number size])</h3>
<div>
light -- todo <br />
sphereSize -- todo
light -- [page:DirectionalLight] -- Light to visualize <br />
size -- dimensions of the plane
</div>
<div>
todo
Creates a line and plane to visualize the light's position and direction
</div>
<h2>Properties</h2>
<h3>[property:Mesh lightSphere]</h3>
<h3>[property:Line lightPlane]</h3>
<div>
todo
</div>
......@@ -48,9 +48,9 @@
<h2>Methods</h2>
<h3>.update() [page:todo]</h3>
<h3>.[method:null update]()</h3>
<div>
todo
Updates the helper to match the position and direction of the [page:.light].
</div>
<h2>Source</h2>
......
......@@ -11,36 +11,42 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">Creates a wireframe object that shows the "hard" edges of another object's geometry. To draw a full wireframe image of an object, see [page:WireframeHelper].</div>
<h2>Example</h2>
<code>todo</code>
<code>
geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
object = new THREE.Mesh( geometry, material );
<h2>Constructor</h2>
edges = new THREE.EdgesHelper( object, 0x00ff00 );
scene.add( object );
scene.add( edges );
</code>
<h3>todo</h3>
<div></div>
<h2>Constructor</h2>
<h3>[name]( [page:Object3D object], [page:Color color] )</h3>
<div>
object -- Object of which to draw edges <br />
color -- Color of the edges.
</div>
<div>
Creates a [page:Line], showing only the "hard" edges of the passed object; specifically, no edge will be drawn between faces which are adjacent and coplanar (or nearly coplanar).
</div>
<h2>Properties</h2>
<h3>todo</h3>
<div>
todo
</div>
<div>none</div>
<h2>Methods</h2>
<h3>todo</h3>
<div>todo</div>
<div>
todo
</div>
<div>none</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -11,35 +11,47 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's [page:Face3 face] normals. Requires that the object's geometry be an instance of [page:Geometry] (does not work with [page:BufferGeometry]), and that face normals have been specified on all [page:Face3 faces] or calculated with [page:Geometry.computeFaceNormals computeFaceNormals].</div>
<h2>Example</h2>
<code>todo</code>
<code>
geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
object = new THREE.Mesh( geometry, material );
edges = new THREE.FaceNormalsHelper( object, 2, 0x00ff00, 1 );
scene.add( object );
scene.add( edges );
</code>
[example:webgl_helpers Example using various helpers]
<h2>Constructor</h2>
<h3>todo</h3>
<div></div>
<h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
<div>object -- object for which to render face normals
size -- size (length) of the arrows
color -- color of the arrows
linewidth -- width of the arrow lines
</div>
<h2>Properties</h2>
<h3>todo</h3>
<h3>[property:Object3D object]</h3>
<div>
todo
The attached object
</div>
<h2>Methods</h2>
<h3>todo</h3>
<div>todo</div>
<div>
todo
</div>
<h3>[method:null update]()</h3>
<div>Updates the face normal preview based on movement of the object.</div>
<h2>Source</h2>
......
......@@ -22,6 +22,7 @@
var gridHelper = new THREE.GridHelper( size, step );
scene.add( gridHelper );
</code>
[example:webgl_helpers Example using various helpers]
<h2>Constructor</h2>
......
......@@ -24,6 +24,7 @@
var pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );
scene.add( pointLightHelper );
</code>
[example:webgl_helpers Example using various helpers]
<h2>Constructor</h2>
......
......@@ -11,35 +11,47 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's vertex normal vectors. Requires that normals have been specified in a [page:BufferAttribute custom attribute] or have been calculated using [page:Geometry.computeVertexNormals computeVertexNormals]. </div>
<h2>Example</h2>
<code>todo</code>
<code>
geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
object = new THREE.Mesh( geometry, material );
edges = new THREE.VertexNormalsHelper( object, 2, 0x00ff00, 1 );
scene.add( object );
scene.add( edges );
</code>
[example:webgl_helpers Example using various helpers]
<h2>Constructor</h2>
<h3>todo</h3>
<div></div>
<h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
<div>object -- object for which to render vertex normals
size -- size (length) of the arrows
color -- color of the arrows
linewidth -- width of the arrow lines
</div>
<h2>Properties</h2>
<h3>todo</h3>
<h3>[property:Object3D object]</h3>
<div>
todo
The attached object
</div>
<h2>Methods</h2>
<h3>todo</h3>
<div>todo</div>
<div>
todo
</div>
<h3>[method:null update]()</h3>
<div>Updates the vertex normal preview based on movement of the object.</div>
<h2>Source</h2>
......
......@@ -11,36 +11,46 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's vertex tangent vectors. Requires that tangents have been specified in a [page:BufferAttribute custom attribute] or have been computed using [page:Geometry.computeTangents computeTangents]. </div>
<h2>Example</h2>
<code>todo</code>
<code>
geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
object = new THREE.Mesh( geometry, material );
edges = new THREE.VertexTangentsHelper( object, 2, 0x00ff00, 1 );
scene.add( object );
scene.add( edges );
</code>
<h2>Constructor</h2>
<h3>todo</h3>
<div></div>
<h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
<div>object -- object for which to render vertex tangents
size -- size (length) of the arrows
color -- color of the arrows
linewidth -- width of the arrow lines
</div>
<h2>Properties</h2>
<h3>todo</h3>
<h3>[property:Object3D object]</h3>
<div>
todo
The attached object
</div>
<h2>Methods</h2>
<h3>todo</h3>
<div>todo</div>
<div>
todo
</div>
<h3>[method:null update]()</h3>
<div>Updates the vertex tangent preview arrows based on the new position and tangents of the object.</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -11,36 +11,45 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">Creates a wireframe object that shows the edges of another object's geometry. To draw a wireframe image showing only "hard" edges (edges between non-coplanar faces), see [page:EdgesHelper].</div>
<h2>Example</h2>
<code>todo</code>
<code>
geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
object = new THREE.Mesh( geometry, material );
<h2>Constructor</h2>
wireframe = new THREE.WireframeHelper( object, 0x00ff00 );
scene.add( object );
scene.add( wireframe );
</code>
[example:webgl_helpers Example using various helpers], [example:webgl_materials_wireframe Alternative approach using a shader.]
<h3>todo</h3>
<div></div>
<h2>Constructor</h2>
<h3>[name]( [page:Object3D object], [page:Color color] )</h3>
<div>
object -- Object of which to draw edges <br />
color -- Color of the edges.
</div>
<div>
Creates a [page:Line], showing only the edges between vertices of an object.
</div>
<h2>Properties</h2>
<h3>todo</h3>
<div>
todo
</div>
<div>none</div>
<h2>Methods</h2>
<h3>todo</h3>
<div>todo</div>
<div>
todo
</div>
<div>none</div>
<h2>Source</h2>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -103,7 +103,7 @@ scene.add( directionalLight );</code>
<h3>[property:Float shadowBias]</h3>
<div>
Shadow map bias.<br />
Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.<br />
Default — *0*.
</div>
......@@ -127,81 +127,76 @@ scene.add( directionalLight );</code>
<h3>[property:Boolean shadowCascade]</h3>
<div>
??? <br />
**Experimental** If true, use a series of shadow maps in a cascade. This can give better z-depth resolution for a directional light. <br />
Default — *false*.
</div>
<h3>[property:Vector3 shadowCascadeOffset]</h3>
<h3>[property:Integer shadowCascadeCount]</h3>
<div>
??? <br />
Default — *Three.Vector3( 0, 0, -1000 )*.
Number of shadow maps to allocate in a cascade (one after another). <br />
Default — *2*.
</div>
<h3>[property:Integer shadowCascadeCount]</h3>
<h3>[property:Vector3 shadowCascadeOffset]</h3>
<div>
??? <br />
Default — *2*.
A relative position to real camera where virtual shadow cameras are attached. A magic vector; scene and light orientation dependent. <br />
Default — *Three.Vector3( 0, 0, -1000 )*.
</div>
<h3>[property:Array shadowCascadeBias]</h3>
<div>
??? <br />
An array of shadowMapBias values for the corresponding shadow map in the cascade, near to far. <br />
Default — <strong>[ 0, 0, 0 ]</strong>.
</div>
<h3>[property:Array shadowCascadeWidth]</h3>
<div>
??? <br />
An array of shadowMapWidth values for the corresponding shadow map in the cascade, near to far. <br />
Default — <strong>[ 512, 512, 512 ]</strong>.
</div>
<h3>[property:Array shadowCascadeHeight]</h3>
<div>
??? <br />
An array of shadowMapHeight values for the corresponding shadow map in the cascade, near to far. <br />
Default — <strong>[ 512, 512, 512 ]</strong>.
</div>
<h3>[property:Array shadowCascadeNearZ]</h3>
<div>
??? <br />
An array of shadowMapNear values for the corresponding shadow map in the cascade, near to far. These typically start with -1.0 (near plane) and match with the previous shadowCascadeFarZ array value.<br />
Default — <strong>[ -1.000, 0.990, 0.998 ]</strong>.
</div>
<h3>[property:Array shadowCascadeFarZ]</h3>
<div>
??? <br />
An array of shadowMapFar values for the corresponding shadow map in the cascade, near to far. These typically match with the next shadowCascadeNearZ array value, ending in 1.0.<br />
Default — <strong>[ 0.990, 0.998, 1.000 ]</strong>.
</div>
<h3>[property:Array shadowCascadeArray]</h3>
<div>
??? <br />
Default — <strong>[ ]</strong>.
Array of size shadowCascadeCount of [page:DirectionalLight THREE.DirectionalLight] objects. This holds the series of separate shadow maps in a cascade, near to far. Created internally.
</div>
<h3>[property:RenderTarget shadowMap]</h3>
<h3>[property:Vector2 shadowMapSize]</h3>
<div>
??? <br />
Default — *null*.
</div>
The shadowMapWidth and shadowMapHeight stored in a [page:Vector2 THREE.Vector2]. Set internally during rendering.
</div>
<h3>[property:Integer shadowMapSize]</h3>
<h3>[property:OrthographicCamera shadowCamera]</h3>
<div>
??? <br />
Default — *null*.
</div>
The shadow's view of the world. Computed internally during rendering from the shadowCamera* settings.
</div>
<h3>[property:Camera shadowCamera]</h3>
<h3>[property:Matrix4 shadowMatrix]</h3>
<div>
??? <br />
Default — *null*.
</div>
Model to shadow camera space, to compute location and depth in shadow map. Computed internally during rendering.
</div>
<h3>[property:Matrix shadowMatrix]</h3>
<h3>[property:WebGLRenderTarget shadowMap]</h3>
<div>
??? <br />
Default — *null*.
</div>
The depth map generated using the shadowCamera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
</div>
<h2>Methods</h2>
......
......@@ -121,7 +121,7 @@ scene.add( spotLight );</code>
<h3>[property:Float shadowBias]</h3>
<div>
Shadow map bias.<br />
Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.<br />
Default — *0*.
</div>
......@@ -143,49 +143,24 @@ scene.add( spotLight );</code>
Default — *512*.
</div>
<h3>[property:Float shadowBias]</h3>
<div>
Shadow map bias.<br />
Default — *0*.
</div>
<h3>[property:Float shadowDarkness]</h3>
<div>
Darkness of shadow casted by this light (from *0* to *1*).<br />
Default — *0.5*.
</div>
<h3>[property:Integer shadowMapWidth]</h3>
<div>
Shadow map texture width in pixels.<br />
Default — *512*.
</div>
<h3>[property:Integer shadowMapHeight]</h3>
<div>
Shadow map texture height in pixels.<br />
Default — *512*.
</div>
<h3>[property:object shadowMatrix]</h3>
<h3>[property:Vector2 shadowMapSize]</h3>
<div>
todo
The shadowMapWidth and shadowMapHeight stored in a [page:Vector2 THREE.Vector2]. Set internally during rendering.
</div>
<h3>[property:object shadowMapSize]</h3>
<h3>[property:PerspectiveCamera shadowCamera]</h3>
<div>
todo
The shadow's view of the world. Computed internally during rendering from the shadowCamera* settings.
</div>
<h3>[property:object shadowCamera]</h3>
<h3>[property:Matrix4 shadowMatrix]</h3>
<div>
todo
Model to shadow camera space, to compute location and depth in shadow map. Computed internally during rendering.
</div>
<h3>[property:object shadowMap]</h3>
<h3>[property:WebGLRenderTarget shadowMap]</h3>
<div>
todo
The depth map generated using the shadowCamera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
</div>
<h2>Methods</h2>
......
......@@ -10,7 +10,7 @@
<h1>[name]</h1>
<div class="desc">A loader for loading an <em>.babylon</em> resource.</div>
<div class="desc">A loader for <em>Collada</em> files.</div>
<h2>Constructor</h2>
......@@ -86,7 +86,6 @@
// instantiate a loader
var loader = new THREE.ColladaLoader();
// load a Babylon resource
loader.load(
// resource URL
'models/collada/monster/monster.dae',
......@@ -109,6 +108,6 @@
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/BabylonLoader.js]
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/ColladaLoader.js examples/js/loaders/ColladaLoader.js]
</body>
</html>
......@@ -47,7 +47,7 @@
</div>
<div>
Parse an <em>obj</em> text structure and return an [page:Object3D].<br />
Found objects are converted to [page:Mesh] with a [page:BufferGeometry] and materials are converted to [page:MeshLambertMaterial].
Found objects are converted to a [page:Mesh] and materials are converted to [page:MeshLambertMaterial].
</div>
<h2>Example</h2>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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 loader for loading a [page:Scene] from a <em>JSON</em> resource.</div>
<h2>Constructor</h2>
<h3>[name]( [page:LoadingManager manager] )</h3>
<div>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
</div>
<div>
Creates a new [name].
</div>
<h2>Properties</h2>
<h2>Methods</h2>
<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
<div>
[page:String url] — required<br />
[page:Function onLoad] — Will be called when load completes. The argument will be an [page:Object] containing the loaded components.<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
[page:Function onError] — Will be called when load errors.<br />
</div>
<div>
Begin loading from url and call onLoad with the parsed scene.
</div>
<h3>[method:Object parse]( [page:Object json], [page:Function callbackFinished], [page:String url] )</h3>
<div>
[page:Object json] — The <em>JSON</em> structure to parse.<br />
[page:Function callbackFinished] — Will be called when parse completes.<br />
[page:String url] — Will be used as base for assets' relative URLs.<br />
</div>
<div>
Parse a <em>JSON</em> scene description and return a new [page:Object] with fully instantiated Three.js objects.
</div>
<h3>[method:null setCrossOrigin]( [page:String value] )</h3>
<div>
[page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
</div>
<h3>[method:null addGeometryHandler]( [page:String typeID], [page:Function loaderClass] )</h3>
<div>
[page:String typeID] — The type to handle.<br />
[page:Function loaderClass] — The handler class.<br />
</div>
<div>
Add an handler for a specific geometry type.
</div>
<h3>[method:null addHierarchyHandler]( [page:String typeID], [page:Function loaderClass] )</h3>
<div>
[page:String typeID] — The type to handle.<br />
[page:Function loaderClass] — The handler class.<br />
</div>
<div>
Add an handler for a specific object type.
</div>
<h2>Example</h2>
<code>
// instantiate a loader
var loader = new THREE.SceneLoader();
// Handle STL geometries
loader.addGeometryHandler( "stl", THREE.STLLoader );
// Handle OBJ objects
loader.addHierarchyHandler( "obj", THREE.OBJLoader );
// load a JSON resource
loader.load(
// resource URL
'scenes/test_scene.js',
// Function when resource is loaded
function ( result ) {
scene.add( result.scene );
},
// Function called when download progresses
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// Function called when download errors
function ( xhr ) {
console.log( 'An error happened' );
}
);
</code>
[example:webgl_loader_scene]
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/SceneLoader.js examples/js/loaders/SceneLoader.js]
</body>
</html>
......@@ -29,7 +29,7 @@
specularMap — Set specular map. Default is null.<br />
alphaMap — Set alpha map. Default is null.<br />
envMap — Set env map. Default is null.<br />
fog — Define whether the material color is affected by global fog settings. Default is false.
fog — Define whether the material color is affected by global fog settings. Default is false.<br />
shading — How the triangles of a curved surface are rendered. Default is [page:Materials THREE.SmoothShading].<br/>
wireframe — Render geometry as wireframe. Default is false (i.e. render as smooth shaded).<br/>
wireframeLinewidth — Controls wireframe thickness. Default is 1.<br/>
......@@ -49,11 +49,6 @@
Diffuse color of the material. Default is white.<br />
</div>
<h3>[property:Color ambient]</h3>
<div>
Ambient color of the material, multiplied by the color of the [page:AmbientLight]. Default is white.<br />
</div>
<h3>[property:Color emissive]</h3>
<div>
Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
......
......@@ -41,7 +41,7 @@
</div>
<div>
Example:<br>
materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.FlatShading } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.FlatShading } ) );
</div>
......@@ -54,11 +54,6 @@
Diffuse color of the material. Default is white.<br />
</div>
<h3>[property:Color ambient]</h3>
<div>
Ambient color of the material, multiplied by the color of the [page:AmbientLight]. Default is white.<br />
</div>
<h3>[property:Color emissive]</h3>
<div>
Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
......@@ -70,7 +65,7 @@
</div>
<h3>[property:Float shininess]</h3>
<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*.</div>
<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*. It should not be set to 0.</div>
<h3>[property:boolean metal]</h3>
<div>
......
......@@ -24,7 +24,7 @@
<div>
color - color of the sprite<br/>
map - the texture map<br/>
rotation - the rotation of the sprite
rotation - the rotation of the sprite<br/>
fog - whether or not to use the scene fog<br/>
</div>
......
......@@ -176,6 +176,14 @@
Linear interpolation of this colors rgb values and the rgb values of the first argument. The alpha argument can be thought of as the percent between the two colors, where 0 is this color and 1 is the first argument.
</div>
<h3>[method:Array toArray]( [page:Array array] )</h3>
<div>
array -- Optional array to store the color.
</div>
<div>
Returns an array [r,g,b]
</div>
<h3>[method:Color equals]( [page:Color c] ) [page:Color this]</h3>
<div>
Compares this color and c and returns true if they are the same, false otherwise.
......
此差异已折叠。
......@@ -71,6 +71,16 @@
Copies the translation component of the supplied matrix *m* into this matrix translation component.
</div>
<h3>[method:Matrix4 makeBasis]( [page:Vector3 xAxis], [page:Vector3 zAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]</h3>
<div>
Creates the basis matrix consisting of the three provided axis vectors. Returns the current matrix.
</div>
<h3>[method:Matrix4 extractBasis]( [page:Vector3 xAxis], [page:Vector3 zAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]</h3>
<div>
Extracts basis of into the three axis vectors provided. Returns the current matrix.
</div>
<h3>[method:Matrix4 extractRotation]( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
<div>
Extracts the rotation of the supplied matrix *m* into this matrix rotation component.
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*! Sortable 1.0.1 - MIT | git://github.com/rubaxa/Sortable.git */
!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():"undefined"!=typeof Package?Sortable=a():window.Sortable=a()}(function(){"use strict";function a(a,b){this.el=a,this.options=b=b||{};var d={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",ignore:"a, img",filter:null,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1};for(var e in d)!(e in b)&&(b[e]=d[e]);var g=b.group;g&&"object"==typeof g||(g=b.group={name:g}),["pull","put"].forEach(function(a){a in g||(g[a]=!0)}),L.forEach(function(d){b[d]=c(this,b[d]||M),f(a,d.substr(2).toLowerCase(),b[d])},this),a[E]=g.name+" "+(g.put.join?g.put.join(" "):"");for(var h in this)"_"===h.charAt(0)&&(this[h]=c(this,this[h]));f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),I&&f(a,"selectstart",this._onTapStart),f(a,"dragover",this._onDragOver),f(a,"dragenter",this._onDragOver),P.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a){s&&s.state!==a&&(i(s,"display",a?"none":""),!a&&s.state&&t.insertBefore(s,q),s.state=a)}function c(a,b){var c=O.call(arguments,2);return b.bind?b.bind.apply(b,[a].concat(c)):function(){return b.apply(a,c.concat(O.call(arguments)))}}function d(a,b,c){if(a){c=c||G,b=b.split(".");var d=b.shift().toUpperCase(),e=new RegExp("\\s("+b.join("|")+")\\s","g");do if(">*"===d&&a.parentNode===c||(""===d||a.nodeName.toUpperCase()==d)&&(!b.length||((" "+a.className+" ").match(e)||[]).length==b.length))return a;while(a!==c&&(a=a.parentNode))}return null}function e(a){a.dataTransfer.dropEffect="move",a.preventDefault()}function f(a,b,c){a.addEventListener(b,c,!1)}function g(a,b,c){a.removeEventListener(b,c,!1)}function h(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(/\s+/g," ").replace(" "+b+" ","");a.className=d+(c?" "+b:"")}}function i(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return G.defaultView&&G.defaultView.getComputedStyle?c=G.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function j(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;f>e;e++)c(d[e],e);return d}return[]}function k(a){a.draggable=!1}function l(){J=!1}function m(a,b){var c=a.lastElementChild,d=c.getBoundingClientRect();return b.clientY-(d.top+d.height)>5&&c}function n(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function o(a){for(var b=0;a&&(a=a.previousElementSibling)&&"TEMPLATE"!==a.nodeName.toUpperCase();)b++;return b}function p(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}var q,r,s,t,u,v,w,x,y,z,A,B,C,D={},E="Sortable"+(new Date).getTime(),F=window,G=F.document,H=F.parseInt,I=!!G.createElement("div").dragDrop,J=!1,K=function(a,b,c,d,e,f){var g=G.createEvent("Event");g.initEvent(b,!0,!0),g.item=c||a,g.from=d||a,g.clone=s,g.oldIndex=e,g.newIndex=f,a.dispatchEvent(g)},L="onAdd onUpdate onRemove onStart onEnd onFilter onSort".split(" "),M=function(){},N=Math.abs,O=[].slice,P=[];return a.prototype={constructor:a,_dragStarted:function(){h(q,this.options.ghostClass,!0),a.active=this,K(t,"start",q,t,y)},_onTapStart:function(a){var b=a.type,c=a.touches&&a.touches[0],e=(c||a).target,g=e,h=this.options,i=this.el,l=h.filter;if(!("mousedown"===b&&0!==a.button||h.disabled)){if(h.handle&&(e=d(e,h.handle,i)),e=d(e,h.draggable,i),y=o(e),"function"==typeof l){if(l.call(this,a,e,this))return K(g,"filter",e,i,y),void a.preventDefault()}else if(l&&(l=l.split(",").some(function(a){return a=d(g,a.trim(),i),a?(K(a,"filter",e,i,y),!0):void 0})))return void a.preventDefault();if(e&&!q&&e.parentNode===i){"selectstart"===b&&e.dragDrop(),B=a,t=this.el,q=e,v=q.nextSibling,A=this.options.group,q.draggable=!0,h.ignore.split(",").forEach(function(a){j(e,a.trim(),k)}),c&&(B={target:e,clientX:c.clientX,clientY:c.clientY},this._onDragStart(B,!0),a.preventDefault()),f(G,"mouseup",this._onDrop),f(G,"touchend",this._onDrop),f(G,"touchcancel",this._onDrop),f(q,"dragend",this),f(t,"dragstart",this._onDragStart),f(G,"dragover",this);try{G.selection?G.selection.empty():window.getSelection().removeAllRanges()}catch(m){}}}},_emulateDragOver:function(){if(C){i(r,"display","none");var a=G.elementFromPoint(C.clientX,C.clientY),b=a,c=this.options.group.name,d=P.length;if(b)do{if((" "+b[E]+" ").indexOf(c)>-1){for(;d--;)P[d]({clientX:C.clientX,clientY:C.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);i(r,"display","")}},_onTouchMove:function(a){if(B){var b=a.touches[0],c=b.clientX-B.clientX,d=b.clientY-B.clientY,e="translate3d("+c+"px,"+d+"px,0)";C=b,i(r,"webkitTransform",e),i(r,"mozTransform",e),i(r,"msTransform",e),i(r,"transform",e),this._onDrag(b),a.preventDefault()}},_onDragStart:function(a,b){var c=a.dataTransfer,d=this.options;if(this._offUpEvents(),"clone"==A.pull&&(s=q.cloneNode(!0),i(s,"display","none"),t.insertBefore(s,q)),b){var e,g=q.getBoundingClientRect(),h=i(q);r=q.cloneNode(!0),i(r,"top",g.top-H(h.marginTop,10)),i(r,"left",g.left-H(h.marginLeft,10)),i(r,"width",g.width),i(r,"height",g.height),i(r,"opacity","0.8"),i(r,"position","fixed"),i(r,"zIndex","100000"),t.appendChild(r),e=r.getBoundingClientRect(),i(r,"width",2*g.width-e.width),i(r,"height",2*g.height-e.height),f(G,"touchmove",this._onTouchMove),f(G,"touchend",this._onDrop),f(G,"touchcancel",this._onDrop),this._loopId=setInterval(this._emulateDragOver,150)}else c&&(c.effectAllowed="move",d.setData&&d.setData.call(this,c,q)),f(G,"drop",this);if(u=d.scroll,u===!0){u=t;do if(u.offsetWidth<u.scrollWidth||u.offsetHeight<u.scrollHeight)break;while(u=u.parentNode)}setTimeout(this._dragStarted,0)},_onDrag:p(function(a){if(t&&this.options.scroll){var b,c,d=this.options,e=d.scrollSensitivity,f=d.scrollSpeed,g=a.clientX,h=a.clientY,i=window.innerWidth,j=window.innerHeight,k=(e>=i-g)-(e>=g),l=(e>=j-h)-(e>=h);k||l?b=F:u&&(b=u,c=u.getBoundingClientRect(),k=(N(c.right-g)<=e)-(N(c.left-g)<=e),l=(N(c.bottom-h)<=e)-(N(c.top-h)<=e)),(D.vx!==k||D.vy!==l||D.el!==b)&&(D.el=b,D.vx=k,D.vy=l,clearInterval(D.pid),b&&(D.pid=setInterval(function(){b===F?F.scrollTo(F.scrollX+k*f,F.scrollY+l*f):(l&&(b.scrollTop+=l*f),k&&(b.scrollLeft+=k*f))},24)))}},30),_onDragOver:function(a){var c,e,f,g=this.el,h=this.options,j=h.group,k=j.put,n=A===j,o=h.sort;if(void 0!==a.preventDefault&&(a.preventDefault(),!h.dragoverBubble&&a.stopPropagation()),!J&&A&&(n?o||(f=!t.contains(q)):A.pull&&k&&(A.name===j.name||k.indexOf&&~k.indexOf(A.name)))&&(void 0===a.rootEl||a.rootEl===this.el)){if(c=d(a.target,h.draggable,g),e=q.getBoundingClientRect(),f)return b(!0),void(s||v?t.insertBefore(q,s||v):o||t.appendChild(q));if(0===g.children.length||g.children[0]===r||g===a.target&&(c=m(g,a))){if(c){if(c.animated)return;u=c.getBoundingClientRect()}b(n),g.appendChild(q),this._animate(e,q),c&&this._animate(u,c)}else if(c&&!c.animated&&c!==q&&void 0!==c.parentNode[E]){w!==c&&(w=c,x=i(c));var p,u=c.getBoundingClientRect(),y=u.right-u.left,z=u.bottom-u.top,B=/left|right|inline/.test(x.cssFloat+x.display),C=c.offsetWidth>q.offsetWidth,D=c.offsetHeight>q.offsetHeight,F=(B?(a.clientX-u.left)/y:(a.clientY-u.top)/z)>.5,G=c.nextElementSibling;J=!0,setTimeout(l,30),b(n),p=B?c.previousElementSibling===q&&!C||F&&C:G!==q&&!D||F&&D,p&&!G?g.appendChild(q):c.parentNode.insertBefore(q,p?G:c),this._animate(e,q),this._animate(u,c)}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();i(b,"transition","none"),i(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,i(b,"transition","all "+c+"ms"),i(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){i(b,"transition",""),b.animated=!1},c)}},_offUpEvents:function(){g(G,"mouseup",this._onDrop),g(G,"touchmove",this._onTouchMove),g(G,"touchend",this._onDrop),g(G,"touchcancel",this._onDrop)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(D.pid),g(G,"drop",this),g(G,"dragover",this),g(c,"dragstart",this._onDragStart),this._offUpEvents(),b&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation(),r&&r.parentNode.removeChild(r),q&&(g(q,"dragend",this),k(q),h(q,this.options.ghostClass,!1),t!==q.parentNode?(z=o(q),K(q.parentNode,"sort",q,t,y,z),K(t,"sort",q,t,y,z),K(q,"add",q,t,y,z),K(t,"remove",q,t,y,z)):(s&&s.parentNode.removeChild(s),q.nextSibling!==v&&(z=o(q),K(t,"update",q,t,y,z),K(t,"sort",q,t,y,z))),a.active&&K(t,"end",q,t,y,z)),t=q=r=v=s=B=C=w=x=A=a.active=null,this.save())},handleEvent:function(a){var b=a.type;"dragover"===b?(this._onDrag(a),e(a)):("drop"===b||"dragend"===b)&&this._onDrop(a)},toArray:function(){for(var a,b=[],c=this.el.children,e=0,f=c.length;f>e;e++)a=c[e],d(a,this.options.draggable,this.el)&&b.push(a.getAttribute("data-id")||n(a));return b},sort:function(a){var b={},c=this.el;this.toArray().forEach(function(a,e){var f=c.children[e];d(f,this.options.draggable,c)&&(b[a]=f)},this),a.forEach(function(a){b[a]&&(c.removeChild(b[a]),c.appendChild(b[a]))})},save:function(){var a=this.options.store;a&&a.set(this)},closest:function(a,b){return d(a,b||this.options.draggable,this.el)},option:function(a,b){var c=this.options;return void 0===b?c[a]:void(c[a]=b)},destroy:function(){var a=this.el,b=this.options;L.forEach(function(c){g(a,c.substr(2).toLowerCase(),b[c])}),g(a,"mousedown",this._onTapStart),g(a,"touchstart",this._onTapStart),g(a,"selectstart",this._onTapStart),g(a,"dragover",this._onDragOver),g(a,"dragenter",this._onDragOver),Array.prototype.forEach.call(a.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),P.splice(P.indexOf(this._onDragOver),1),this._onDrop(),this.el=null}},a.utils={on:f,off:g,css:i,find:j,bind:c,is:function(a,b){return!!d(a,b,a)},throttle:p,closest:d,toggleClass:h,dispatchEvent:K,index:o},a.version="1.0.1",a.create=function(b,c){return new a(b,c)},a});
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册