Last change
on this file since 28897 was 28897, checked in by davidb, 10 years ago |
GUI front-end to server base plus web page content
|
File size:
950 bytes
|
Line | |
---|
1 | /**
|
---|
2 | * @author mikael emtinger / http://gomo.se/
|
---|
3 | * @author alteredq / http://alteredqualia.com/
|
---|
4 | */
|
---|
5 |
|
---|
6 | THREE.Bone = function( belongsToSkin ) {
|
---|
7 |
|
---|
8 | THREE.Object3D.call( this );
|
---|
9 |
|
---|
10 | this.skin = belongsToSkin;
|
---|
11 | this.skinMatrix = new THREE.Matrix4();
|
---|
12 |
|
---|
13 | };
|
---|
14 |
|
---|
15 | THREE.Bone.prototype = Object.create( THREE.Object3D.prototype );
|
---|
16 |
|
---|
17 | THREE.Bone.prototype.update = function ( parentSkinMatrix, forceUpdate ) {
|
---|
18 |
|
---|
19 | // update local
|
---|
20 |
|
---|
21 | if ( this.matrixAutoUpdate ) {
|
---|
22 |
|
---|
23 | forceUpdate |= this.updateMatrix();
|
---|
24 |
|
---|
25 | }
|
---|
26 |
|
---|
27 | // update skin matrix
|
---|
28 |
|
---|
29 | if ( forceUpdate || this.matrixWorldNeedsUpdate ) {
|
---|
30 |
|
---|
31 | if( parentSkinMatrix ) {
|
---|
32 |
|
---|
33 | this.skinMatrix.multiplyMatrices( parentSkinMatrix, this.matrix );
|
---|
34 |
|
---|
35 | } else {
|
---|
36 |
|
---|
37 | this.skinMatrix.copy( this.matrix );
|
---|
38 |
|
---|
39 | }
|
---|
40 |
|
---|
41 | this.matrixWorldNeedsUpdate = false;
|
---|
42 | forceUpdate = true;
|
---|
43 |
|
---|
44 | }
|
---|
45 |
|
---|
46 | // update children
|
---|
47 |
|
---|
48 | var child, i, l = this.children.length;
|
---|
49 |
|
---|
50 | for ( i = 0; i < l; i ++ ) {
|
---|
51 |
|
---|
52 | this.children[ i ].update( this.skinMatrix, forceUpdate );
|
---|
53 |
|
---|
54 | }
|
---|
55 |
|
---|
56 | };
|
---|
57 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.