|
11 | 11 | <h1>[name]</h1> |
12 | 12 |
|
13 | 13 | <p class="desc"> |
14 | | - An AnimationClip is a reusable set of keyframe tracks which represent an animation.<br /><br /> |
| 14 | + 动画剪辑(AnimationClip)是一个可重用的关键帧轨道集,它代表动画。<br /><br /> |
15 | 15 |
|
16 | | - For an overview of the different elements of the three.js animation system see the |
17 | | - "Animation System" article in the "Next Steps" section of the manual. |
| 16 | + 在使用手册的“下一步”章节中,“动画系统”一文对three.js动画系统中的不同元素作出了概述 |
18 | 17 | </p> |
19 | 18 |
|
20 | 19 |
|
21 | | - <h2>Constructor</h2> |
| 20 | + <h2>构造器</h2> |
22 | 21 |
|
23 | 22 |
|
24 | 23 | <h3>[name]( [param:String name], [param:Number duration], [param:Array tracks] )</h3> |
25 | 24 | <p> |
26 | | - [page:String name] - a name for this clip.<br /> |
27 | | - [page:Number duration] - the duration of this clip (in seconds). If a negative value is passed, |
28 | | - the duration will be calculated from the passed *tracks* array.<br /> |
29 | | - [page:Array tracks] - an array of [page:KeyframeTrack KeyframeTracks].<br /><br /> |
| 25 | + [page:String name] - 此剪辑的名称<br /> |
| 26 | + [page:Number duration] - 持续时间 (单位秒). 如果传入负数, 持续时间将会从传入的数组中计算得到。<br /> |
| 27 | + [page:Array tracks] - 一个由关键帧轨道([page:KeyframeTrack KeyframeTracks])组成的数组。<br /><br /> |
| 28 | + |
| 29 | + 说明: 与其直接调用构造函数实例化一个动画剪辑, 不如使用其静态方法中的一个来创建: |
| 30 | + 用JSON ([page:.parse parse]), 用变形目标序列([page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence], |
| 31 | + [page:.CreateClipsFromMorphTargetSequences CreateClipsFromMorphTargetSequences])或者用动画层级 ([page:.parseAnimation parseAnimation])来创建 - 如果你的模型中几何体的动画数组中还没有保存动画剪辑的话。 |
30 | 32 |
|
31 | | - Note: Instead of instantiating an AnimationClip directly with the constructor, you can use one |
32 | | - of its static methods to create AnimationClips: from JSON ([page:.parse parse]), from morph |
33 | | - target sequences ([page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence], |
34 | | - [page:.CreateClipsFromMorphTargetSequences CreateClipsFromMorphTargetSequences]) or from |
35 | | - animation hierarchies ([page:.parseAnimation parseAnimation]) - if your model doesn't already |
36 | | - hold AnimationClips in its geometry's animations array. |
37 | 33 | </p> |
38 | 34 |
|
39 | 35 |
|
40 | | - <h2>Properties</h2> |
| 36 | + <h2>属性</h2> |
41 | 37 |
|
42 | 38 |
|
43 | 39 | <h3>[property:Number duration]</h3> |
44 | 40 | <p> |
45 | | - The duration of this clip (in seconds). This can be calculated from the [page:.tracks tracks] |
46 | | - array via [page:.resetDuration resetDuration]. |
| 41 | + 剪辑的持续时间 (单位秒). 可以通过[page:.resetDuration resetDuration]从轨道数组([page:.tracks tracks])计算出来。 |
| 42 | + |
47 | 43 | </p> |
48 | 44 |
|
49 | 45 | <h3>[property:String name]</h3> |
50 | 46 | <p> |
51 | | - A name for this clip. A certain clip can be searched via [page:.findByName findByName]. |
| 47 | + 剪辑的名称. 调用[page:.findByName findByName]根据名称搜索某个剪辑 |
52 | 48 | </p> |
53 | 49 |
|
54 | 50 | <h3>[property:Array tracks]</h3> |
55 | 51 | <p> |
56 | | - An array containing a [page:KeyframeTrack] for each property that are animated by this clip. |
| 52 | + 一个包含该剪辑中有动画的所有属性的关键帧轨道([page:KeyframeTrack])的数组。 |
57 | 53 | </p> |
58 | 54 |
|
59 | 55 | <h3>[property:String uuid]</h3> |
60 | 56 | <p> |
61 | | - The [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this clip instance. |
62 | | - It gets automatically assigned and shouldn't be edited. |
| 57 | + 剪辑实例的[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID],自动分配且不可编辑。 |
| 58 | + |
63 | 59 | </p> |
64 | 60 |
|
65 | 61 |
|
66 | | - <h2>Methods</h2> |
| 62 | + <h2>方法</h2> |
67 | 63 |
|
68 | 64 |
|
69 | 65 | <h3>[method:this optimize]()</h3> |
70 | 66 | <p> |
71 | | - Optimizes each track by removing equivalent sequential keys (which are common in morph target |
72 | | - sequences). |
| 67 | + 通过移除等效的顺序键(在变形目标序列中很常见)来优化每一个轨道 |
| 68 | + |
73 | 69 | </p> |
74 | 70 |
|
75 | 71 | <h3>[method:this resetDuration]()</h3> |
76 | 72 | <p> |
77 | | - Sets the [page:.duration duration] of the clip to the duration of its longest |
78 | | - [page:KeyframeTrack]. |
| 73 | + 将剪辑的持续时间([page:.duration duration])设为最长的关键帧轨道([page:KeyframeTrack])的持续时间。 |
| 74 | + . |
79 | 75 | </p> |
80 | 76 |
|
81 | 77 | <h3>[method:this trim]()</h3> |
82 | 78 | <p> |
83 | | - Trims all tracks to the clip's duration. |
| 79 | + 修剪所有的轨道到该剪辑的持续时间。 |
84 | 80 | </p> |
85 | 81 |
|
86 | 82 | <h3>[method:Boolean validate]()</h3> |
87 | 83 | <p> |
88 | | - Performs minimal validation on each track in the clip. Returns true if all tracks are valid. |
| 84 | + 对剪辑中的每个轨道执行最小验证。如果所有轨道都有效,返回true。 |
89 | 85 | </p> |
90 | 86 |
|
91 | 87 |
|
92 | | - <h2>Static Methods</h2> |
| 88 | + <h2>静态方法</h2> |
93 | 89 |
|
94 | 90 |
|
95 | 91 | <h3>[method:Array CreateClipsFromMorphTargetSequences]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3> |
96 | 92 | <p> |
97 | | - Returns an array of new AnimationClips created from the [page:Geometry.morphTargets morph |
98 | | - target sequences] of a geometry, trying to sort morph target names into animation-group-based |
99 | | - patterns like "Walk_001, Walk_002, Run_001, Run_002 ..."<br /><br /> |
| 93 | + 返回从几何体的变形目标序列([page:Geometry.morphTargets morph |
| 94 | + target sequences])创建的新动画剪辑(AnimationClip)数组,并尝试将变形目标名称分类为基于动画组的模式,如“Walk_001、Walk_002、Run_001、Run_002……”。<br /><br /> |
100 | 95 |
|
101 | | - This method is called by the [page:JSONLoader] internally, and it uses |
| 96 | + 该方法被[page:JSONLoader]内部调用, 并且它使用了 |
102 | 97 | [page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence]. |
103 | 98 | </p> |
104 | 99 |
|
105 | 100 | <h3>[method:AnimationClip CreateFromMorphTargetSequence]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3> |
106 | 101 | <p> |
107 | | - Returns a new AnimationClip from the passed [page:Geometry.morphTargets morph targets array] |
108 | | - of a geometry, taking a name and the number of frames per second.<br /><br /> |
| 102 | + 返回一个由几何体变形目标数组([page:Geometry.morphTargets morph targets array])得到的新动画剪辑,接收名称和帧率参数。<br /><br /> |
| 103 | + |
| 104 | + 说明: 帧率是必须参数, 但是动画速度可能会在*AnimationAction*中被[page:AnimationAction.setDuration animationAction.setDuration]方法重写。 |
109 | 105 |
|
110 | | - Note: The fps parameter is required, but the animation speed can be overridden in an |
111 | | - *AnimationAction* via [page:AnimationAction.setDuration animationAction.setDuration]. |
112 | 106 | </p> |
113 | 107 |
|
114 | 108 | <h3>[method:AnimationClip findByName]( [param:Object objectOrClipArray], [param:String name] )</h3> |
115 | 109 | <p> |
116 | | - Searches for an AnimationClip by name, taking as its first parameter either an array of |
117 | | - AnimationClips, or a mesh or geometry that contains an array named "animations". |
| 110 | + 根据名称搜索动画剪辑(AnimationClip), 接收一个动画剪辑数组或者一个包含名为"animation"的数组的网格(或几何体)作为第一个参数。 |
118 | 111 | </p> |
119 | 112 |
|
120 | 113 | <h3>[method:AnimationClip parse]( [param:Object json] )</h3> |
121 | 114 | <p> |
122 | | - Parses a JSON representation of a clip and returns an AnimationClip. |
| 115 | + 解析剪辑的JSON表示,并返回一个动画剪辑(AnimationClip)。 |
123 | 116 | </p> |
124 | 117 |
|
125 | 118 | <h3>[method:AnimationClip parseAnimation]( [param:Object animation], [param:Array bones] )</h3> |
126 | 119 | <p> |
127 | | - Parses the animation.hierarchy format and returns an AnimationClip. |
| 120 | + 解析动画层级格式并返回动画剪辑。 |
128 | 121 | </p> |
129 | 122 |
|
130 | 123 | <h3>[method:Object toJSON]( [param:AnimationClip clip] )</h3> |
131 | 124 | <p> |
132 | | - Takes an AnimationClip and returns a JSON object. |
| 125 | + 接收一个动画剪辑为参数并返回一个JSON对象. |
133 | 126 | </p> |
134 | 127 |
|
135 | 128 |
|
136 | | - <h2>Source</h2> |
| 129 | + <h2>源码</h2> |
137 | 130 |
|
138 | 131 |
|
139 | 132 | [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] |
|
0 commit comments