Skip to content

Commit

Permalink
Added support for picking up <double_sided> flags inside <effect>/<ex…
Browse files Browse the repository at this point in the history
…tra>, applying it to the Material. This is half of Issue mrdoob#2280.
  • Loading branch information
jterrace committed Aug 4, 2012
1 parent ee7d002 commit 3fd4f8e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/js/loaders/ColladaLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3158,6 +3158,7 @@ THREE.ColladaLoader = function () {
}

props[ 'shading' ] = preferredShading;
props[ 'doubleSided' ] = this.effect.doubleSided;

switch ( this.type ) {

Expand Down Expand Up @@ -3315,6 +3316,16 @@ THREE.ColladaLoader = function () {

this.id = element.getAttribute( 'id' );
this.name = element.getAttribute( 'name' );

this.doubleSided = false;
var double_sided = COLLADA.evaluate( './/dae:extra//dae:double_sided', element, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );
if (double_sided) {
double_sided = double_sided.iterateNext();
if ( double_sided && parseInt( double_sided.textContent, 10 ) === 1) {
this.doubleSided = true;
}
}

this.shader = null;

for ( var i = 0; i < element.childNodes.length; i ++ ) {
Expand Down

0 comments on commit 3fd4f8e

Please sign in to comment.