提交 09f248da 编写于 作者: R Ricardo Cabello

Merge pull request #6523 from TatumCreative/docs-updates-misc2

Docs: only 97 todos left
......@@ -11,23 +11,26 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">An Object3d that rotates independently of its parent objects, but keeps the position and scale.</div>
<code>
var root = new THREE.Group();
var gyro = new THREE.Gyroscope();
var cube = new THREE.Mesh( geometry, material );
root.add( gyro )
gyro.add( cube )
cube.position.x = 10;
root.rotation.y = Math.PI;
// The cube will have changed its position but maintained its orientation
</code>
<h2>Constructor</h2>
<h3>[name]()</h3>
<div>
todo
</div>
<h2>Properties</h2>
<h2>Methods</h2>
<h2>Source</h2>
......
......@@ -11,16 +11,43 @@
<h1>[name]</h1>
<div class="desc">Defines a 2d shape plane using paths.</div>
<div class="desc">
Defines an arbitrary 2d shape plane using paths with optional holes. It can be used with [page:ExtrudeGeometry],
[page:ShapeGeometry], to get points, or to get triangulated faces.
</div>
<code>
var heartShape = new THREE.Shape();
heartShape.moveTo( 25, 25 );
heartShape.bezierCurveTo( 25, 25, 20, 0, 0, 0 );
heartShape.bezierCurveTo( 30, 0, 30, 35,30,35 );
heartShape.bezierCurveTo( 30, 55, 10, 77, 25, 95 );
heartShape.bezierCurveTo( 60, 77, 80, 55, 80, 35 );
heartShape.bezierCurveTo( 80, 35, 80, 0, 50, 0 );
heartShape.bezierCurveTo( 35, 0, 25, 25, 25, 25 );
var extrudeSettings = { amount: 8, bevelEnabled: true, bevelSegments: 2, steps: 2, bevelSize: 1, bevelThickness: 1 };
var geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
</code>
<h2>Examples</h2>
<div>
[example:webgl_geometry_shapes geometry / shapes ]<br/>
[example:webgl_geometry_extrude_shapes geometry / extrude / shapes ]<br/>
[example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2 ]<br/>
[example:webgl_particles_shapes particles / shapes ]
</div>
<h2>Constructor</h2>
<h3>[name]()</h3>
<div>
todo
</div>
<h2>Properties</h2>
......@@ -28,66 +55,67 @@
<h3>[property:array holes]</h3>
<div>
todo
An array of [page:Path paths] that define the holes in the shape.
</div>
<h2>Methods</h2>
<h3>[method:todo makeGeometry]([page:todo options])</h3>
<h3>[method:ShapeGeometry makeGeometry]([page:Object options])</h3>
<div>
options -- The options passed as the second argument to [page:ShapeGeometry ShapeGeometry]
options -- This is passed as the second argument to [page:ShapeGeometry ShapeGeometry]
</div>
<div>
Convenience method to return ShapeGeometry
</div>
<h3>[method:todo extractAllPoints]([page:todo divisions])</h3>
<h3>[method:Array extractAllPoints]([page:Integer divisions])</h3>
<div>
divisions -- todo
divisions -- The number of divisions to create on the shape
</div>
<div>
Get points of shape and holes (keypoints based on segments parameter)
</div>
<h3>[method:todo extrude]([page:todo options])</h3>
<h3>[method:ExtrudeGeometry extrude]([page:Object options])</h3>
<div>
options -- The options passed as the second argument to [page:ExtrudeGeometry ExtrudeGeometry]
options -- This is passed as the second argument to [page:ExtrudeGeometry ExtrudeGeometry]
</div>
<div>
Convenience method to return ExtrudeGeometry
</div>
<h3>[method:todo extractPoints]([page:todo divisions])</h3>
<h3>[method:Object extractPoints]([page:Integer divisions])</h3>
<div>
divisions -- todo
divisions -- The number of divisions to create on the shape
</div>
<div>
todo
Returns an object with a *shape* and *holes* property that each reference an array of [page:Vector2 Vector2s].
</div>
<h3>[method:todo extractAllSpacedPoints]([page:todo divisions])</h3>
<h3>[method:Object extractAllSpacedPoints]([page:Integer divisions])</h3>
<div>
divisions -- todo
divisions -- The number of divisions to create on the shape
</div>
<div>
todo
Returns an object with a *shape* and *holes* property that each reference an array of [page:Vector2 Vector2s]. The
points will all be equally spaced along the shape.
</div>
<h3>[method:todo getPointsHoles]([page:todo divisions])</h3>
<h3>[method:Array getPointsHoles]([page:Integer divisions])</h3>
<div>
divisions -- todo
divisions -- The number of divisions to create on the shape
</div>
<div>
Get points of holes
Get an array of [page Vector2 Vector2s] that represent the holes in the shape.
</div>
<h3>[method:todo getSpacedPointsHoles]([page:todo divisions])</h3>
<h3>[method:Array getSpacedPointsHoles]([page:Integer divisions])</h3>
<div>
divisions -- todo
divisions -- The number of divisions to create on the shape
</div>
<div>
Get points of holes (spaced by regular distance)
Get an array of equally spaced [page Vector2 Vector2s] that represent the holes in the shape.
</div>
<h2>Source</h2>
......
......@@ -11,7 +11,7 @@
<h1>[name]</h1>
<div class="desc">This display a helper for a pointLight </div>
<div class="desc">This displays a helper object for a [page:PointLight] </div>
<h2>Example</h2>
......@@ -29,34 +29,26 @@
<h2>Constructor</h2>
<h3>[name]([page:todo light], [page:todo sphereSize])</h3>
<h3>[name]([page:PointLight light], [page:Float sphereSize])</h3>
<div>
light -- todo <br />
sphereSize -- todo
</div>
<div>
todo
light -- The [page:PointLight] to display. <br />
sphereSize -- The size of the sphere helper
</div>
<h2>Properties</h2>
<h3>[property:Mesh lightSphere]</h3>
<div>
todo
</div>
<h3>[property:PointLight light]</h3>
<div>
todo
The [page:PointLight] that is being represented.
</div>
<h2>Methods</h2>
<h3>[method:todo update]()</h3>
<h3>[method:null update]()</h3>
<div>
todo
Updates the light helper.
</div>
<h2>Source</h2>
......
......@@ -11,46 +11,45 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">This displays a cylinder helper object for a [page:SpotLight] </div>
<h2>Example</h2>
<code>
var spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 10, 10, 10 );
scene.add( spotLight );
var spotLightHelper = new THREE.SpotLightHelper( spotLight );
scene.add( spotLightHelper );
</code>
<h2>Constructor</h2>
<h3>[name]([page:todo light], [page:todo sphereSize])</h3>
<div>
light -- todo <br />
sphereSize -- todo
</div>
<h3>[name]([page:SpotLight light])</h3>
<div>
todo
light -- The [page:SpotLight] to display
</div>
<h2>Properties</h2>
<h3>[property:Mesh lightSphere]</h3>
<div>
todo
</div>
<h3>[property:SpotLight light]</h3>
<div>
todo
The [page:SpotLight]
</div>
<h3>[property:Mesh lightCone]</h3>
<div>
todo
</div>
<h2>Methods</h2>
<h3>[method:todo update]()</h3>
<h3>[method:null update]()</h3>
<div>
todo
Updates the light helper.
</div>
<h2>Source</h2>
......
......@@ -11,148 +11,165 @@
<h1>[name]</h1>
<div class="desc">todo</div>
<div class="desc">A mesh that can blend together multiple animated morph targets.</div>
<h2>Example</h2>
<div>
[example:webgl_morphtargets_md2_control morphtargets / md2 / controll]
<h2>Constructor</h2>
<h3>[name]([page:todo geometry], [page:todo material])</h3>
<div>
geometry -- todo <br />
material -- todo
</div>
<h3>[name]([page:Geometry geometry], [page:Material material])</h3>
<div>
todo
geometry — An instance of [page:Geometry].<br />
material — An instance of [page:Material] (optional).
</div>
<h2>Properties</h2>
<h3>[property:object animationsMap]</h3>
<div>
todo
An object of named animations as added by [page:MorphBlendMesh.createAnimation].
</div>
<h3>[property:array animationsList]</h3>
<div>
todo
The list of animations as added by [page:MorphBlendMesh.createAnimation].
</div>
<h2>Methods</h2>
<h3>[method:todo setAnimationWeight]([page:todo name], [page:todo weight])</h3>
<h3>[method:null setAnimationWeight]([page:String name], [page:Float weight])</h3>
<div>
name -- todo <br />
weight -- todo
name -- The name of the animation<br />
weight -- Weight of the animation, typically 0-1
</div>
<div>
todo
Set the weight of how much this animation will apply to the overall morph. 0 is off, 1 is full weight.
</div>
<h3>[method:todo setAnimationFPS]([page:todo name], [page:todo fps])</h3>
<h3>[method:null setAnimationFPS]([page:String name], [page:Float fps])</h3>
<div>
name -- todo <br />
fps -- todo
name -- The name of the animation <br />
fps -- The number of frames (morphTargets) per second
</div>
<div>
todo
A frame is typically 1 morph target.
</div>
<h3>[method:todo createAnimation]([page:todo name], [page:todo start], [page:todo end], [page:todo fps])</h3>
<h3>[method:null createAnimation]([page:String name], [page:Integer start], [page:Integer end], [page:Float fps])</h3>
<div>
name -- todo <br />
start -- todo <br />
end -- todo <br />
fps -- todo
name -- The name of the animation <br />
start -- The starting frame (morph)<br />
end -- The ending frame (morph)<br />
fps -- How many frames (morphs) to play per second
</div>
<div>
todo
Creates an animation object that gets added to both the [page:MorphBlendMesh.animationsMap animationsMap] and
[page:MorphBlendMesh.animationsList animationsList].<br/><br/>
Animation object:<br/><br/>
startFrame -- Starting frame<br/>
endFrame -- Ending frame<br/>
length -- The number of frames<br/>
fps -- The frames per second<br/>
duration -- The length of the animation in seconds<br/>
lastFrame -- The previous frame that was played<br/>
currentFrame -- The current frame<br/>
active -- Whether or not the animation is being played<br/>
time -- The time in seconds of the animation<br/>
direction -- Which way to play the animation<br/>
weight -- The weight of the animation<br/>
directionBackwards -- Is playing backwards<br/>
mirroredLoop -- Loop back and forth
</div>
<h3>[method:todo playAnimation]([page:todo name])</h3>
<h3>[method:null playAnimation]([page:String name])</h3>
<div>
name -- todo
name -- The name of the animation
</div>
<div>
todo
Sets the animation to active and animation time to 0
</div>
<h3>[method:todo update]([page:todo delta])</h3>
<h3>[method:null update]([page:Float delta])</h3>
<div>
delta -- todo
delta -- Time in seconds
</div>
<div>
todo
Updates and plays the animation
</div>
<h3>[method:todo autoCreateAnimations]([page:todo fps])</h3>
<h3>[method:null autoCreateAnimations]([page:Float fps])</h3>
<div>
fps -- todo
fps -- Frames per second
</div>
<div>
todo
Goes through the geometry's morphTargets and generates animations based on the morphTargets' names. Names
are of the form "walk_01", "walk_02", "walk_03", etc or "run001", "run002", "run003".
</div>
<h3>[method:todo setAnimationDuration]([page:todo name], [page:todo duration])</h3>
<h3>[method:null setAnimationDuration]([page:String name], [page:Float duration])</h3>
<div>
name -- todo <br />
duration -- todo
name -- The name of the animation <br />
duration -- How long in seconds to play the animation
</div>
<div>
todo
Updates the animation object with proper values to update the duration.
</div>
<h3>[method:todo setAnimationDirectionForward]([page:todo name])</h3>
<h3>[method:null setAnimationDirectionForward]([page:String name])</h3>
<div>
name -- todo
name -- The name of the animation
</div>
<div>
todo
Sets the animation to play forwards
</div>
<h3>[method:todo getAnimationDuration]([page:todo name])</h3>
<h3>[method:null setAnimationDirectionBackward]([page:String name])</h3>
<div>
name -- todo
name -- The name of the animation
</div>
<div>
todo
Sets the animation to play backwards
</div>
<h3>[method:todo getAnimationTime]([page:todo name])</h3>
<h3>[method:Float getAnimationDuration]([page:String name])</h3>
<div>
name -- todo
name -- The name of the animation
</div>
<div>
todo
Returns the duration in seconds of the animation. Returns -1 if it can't be found.
</div>
<h3>[method:todo setAnimationDirectionBackward]([page:todo name])</h3>
<h3>[method:Float getAnimationTime]([page:String name])</h3>
<div>
name -- todo
name -- The name of the animation
</div>
<div>
todo
Returns the current time position of the animation.
</div>
<h3>[method:todo setAnimationTime]([page:todo name], [page:todo time])</h3>
<h3>[method:null setAnimationTime]([page:String name], [page:Float time])</h3>
<div>
name -- todo <br />
time -- todo
name -- The name of the animation <br />
time -- The time in seconds
</div>
<div>
todo
Sets the current time position of the animation
</div>
<h3>[method:todo stopAnimation]([page:todo name])</h3>
<h3>[method:null stopAnimation]([page:String name])</h3>
<div>
name -- todo
name -- The name of the animation
</div>
<div>
todo
Stops the playback of the animation
</div>
<h2>Source</h2>
......
......@@ -18,38 +18,45 @@
<h2>Example</h2>
<code>// white spotlight shining from the side, casting shadow
<code>
// white spotlight shining from the side, casting shadow
var spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 100, 1000, 100 );
var spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 100, 1000, 100 );
spotLight.castShadow = true;
spotLight.castShadow = true;
spotLight.shadowMapWidth = 1024;
spotLight.shadowMapHeight = 1024;
spotLight.shadowMapWidth = 1024;
spotLight.shadowMapHeight = 1024;
spotLight.shadowCameraNear = 500;
spotLight.shadowCameraFar = 4000;
spotLight.shadowCameraFov = 30;
spotLight.shadowCameraNear = 500;
spotLight.shadowCameraFar = 4000;
spotLight.shadowCameraFov = 30;
scene.add( spotLight );</code>
scene.add( spotLight );
</code>
<div>
[example:webgl_materials_bumpmap materials / bumpmap]<br/>
[example:webgl_shading_physical shading / physical]<br/>
[example:webgl_shadowmap shadowmap]<br/>
[example:webgl_shadowmap_viewer shadowmap / performance]<br/>
[example:webgl_shadowmap_viewer shadowmap / viewer]
</div>
<h2>Constructor</h2>
<h3>[name]([page:Integer hex], [page:Float intensity], [page:todo distance], [page:todo angle], [page:todo exponent])</h3>
<h3>[name]([page:Integer hex], [page:Float intensity], [page:Float distance], [page:Radians angle], [page:Float exponent], [page:Float decay])</h3>
<div>
[page:Integer hex] — Numeric value of the RGB component of the color. <br />
[page:Float intensity] — Numeric value of the light's strength/intensity. <br />
distance -- Maximum distance from origin where light will shine whose intensity is attenuated linearly based on distance from origin. <br />
angle -- Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2. <br />
exponent -- todo
</div>
<div>
todo
[page:Float distance] -- Maximum distance from origin where light will shine whose intensity is attenuated linearly based on distance from origin. <br />
[page:Radians angle] -- Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2.<br />
[page:Float exponent] -- Rapidity of the falloff of light from its target direction.<br />
[page:Float decay] -- The amount the light dims along the distance of the light.
</div>
<h2>Properties</h2>
......@@ -79,9 +86,16 @@ scene.add( spotLight );</code>
<h3>[property:Float exponent]</h3>
<div>
Rapidity of the falloff of light from its target direction.<br />
Rapidity of the falloff of light from its target direction. A lower value spreads out the light, while a higher
focuses it towards the center.<br />
Default — *10.0*.
</div>
<h3>[property:Float decay]</h3>
<div>
The amount the light dims along the distance of the light<br />
Default — *1*.
</div>
<h3>[property:Boolean castShadow]</h3>
<div>
......
......@@ -11,7 +11,7 @@
<h1>[name]</h1>
<div class="desc">A bone which is part of a SkinnedMesh.</div>
<div class="desc">A bone which is part of a [page:SkinnedMesh].</div>
<h2>Constructor</h2>
......@@ -27,28 +27,11 @@
<h2>Properties</h2>
<h3>[property:Matrix4 skinMatrix]</h3>
<div>
The matrix of the bone.
</div>
<h3>[property:SkinnedMesh skin]</h3>
<div>
The skin that contains this bone.
</div>
<h2>Methods</h2>
<h3>[method:todo update]([page:Matrix4 parentSkinMatrix], [page:boolean forceUpdate])</h3>
<div>
parentSkinMatrix -- the matrix of the parent bone.<br />
forceUpdate -- force the update of the skinmatrix.
</div>
<div>
This updates the matrix of the bone and the matrices of its children.
</div>
<h2>Source</h2>
......
......@@ -80,6 +80,9 @@ var constants = {
function updateGroupGeometry( mesh, geometry ) {
mesh.children[0].geometry.dispose();
mesh.children[1].geometry.dispose();
mesh.children[0].geometry = geometry
mesh.children[1].geometry = geometry.clone()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册