|
@@ -4123,20 +4123,22 @@ THREE.Matrix4.prototype = {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
- makeRotationFromEuler: function ( rotation ) {
|
|
|
+ makeRotationFromEuler: function ( euler ) {
|
|
|
+
|
|
|
+ if ( typeof euler['order'] === undefined ) {
|
|
|
|
|
|
- if( typeof rotation['order'] === undefined ) {
|
|
|
console.error( 'ERROR: Matrix\'s .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order. Please update your code.' );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
var te = this.elements;
|
|
|
|
|
|
- var x = rotation.x, y = rotation.y, z = rotation.z;
|
|
|
+ var x = euler.x, y = euler.y, z = euler.z;
|
|
|
var a = Math.cos( x ), b = Math.sin( x );
|
|
|
var c = Math.cos( y ), d = Math.sin( y );
|
|
|
var e = Math.cos( z ), f = Math.sin( z );
|
|
|
|
|
|
- if ( rotation.order === undefined || rotation.order === 'XYZ' ) {
|
|
|
+ if ( euler.order === undefined || euler.order === 'XYZ' ) {
|
|
|
|
|
|
var ae = a * e, af = a * f, be = b * e, bf = b * f;
|
|
|
|
|
@@ -4152,7 +4154,7 @@ THREE.Matrix4.prototype = {
|
|
|
te[6] = be + af * d;
|
|
|
te[10] = a * c;
|
|
|
|
|
|
- } else if ( rotation.order === 'YXZ' ) {
|
|
|
+ } else if ( euler.order === 'YXZ' ) {
|
|
|
|
|
|
var ce = c * e, cf = c * f, de = d * e, df = d * f;
|
|
|
|
|
@@ -4168,7 +4170,7 @@ THREE.Matrix4.prototype = {
|
|
|
te[6] = df + ce * b;
|
|
|
te[10] = a * c;
|
|
|
|
|
|
- } else if ( rotation.order === 'ZXY' ) {
|
|
|
+ } else if ( euler.order === 'ZXY' ) {
|
|
|
|
|
|
var ce = c * e, cf = c * f, de = d * e, df = d * f;
|
|
|
|
|
@@ -4184,7 +4186,7 @@ THREE.Matrix4.prototype = {
|
|
|
te[6] = b;
|
|
|
te[10] = a * c;
|
|
|
|
|
|
- } else if ( rotation.order === 'ZYX' ) {
|
|
|
+ } else if ( euler.order === 'ZYX' ) {
|
|
|
|
|
|
var ae = a * e, af = a * f, be = b * e, bf = b * f;
|
|
|
|
|
@@ -4200,7 +4202,7 @@ THREE.Matrix4.prototype = {
|
|
|
te[6] = b * c;
|
|
|
te[10] = a * c;
|
|
|
|
|
|
- } else if ( rotation.order === 'YZX' ) {
|
|
|
+ } else if ( euler.order === 'YZX' ) {
|
|
|
|
|
|
var ac = a * c, ad = a * d, bc = b * c, bd = b * d;
|
|
|
|
|
@@ -4216,7 +4218,7 @@ THREE.Matrix4.prototype = {
|
|
|
te[6] = ad * f + bc;
|
|
|
te[10] = ac - bd * f;
|
|
|
|
|
|
- } else if ( rotation.order === 'XZY' ) {
|
|
|
+ } else if ( euler.order === 'XZY' ) {
|
|
|
|
|
|
var ac = a * c, ad = a * d, bc = b * c, bd = b * d;
|
|
|
|
|
@@ -37399,7 +37401,6 @@ THREE.DepthPassPlugin = function () {
|
|
|
|
|
|
/**
|
|
|
* @author mikael emtinger / http://gomo.se/
|
|
|
- *
|
|
|
*/
|
|
|
|
|
|
THREE.ShaderFlares = {
|
|
@@ -37430,20 +37431,20 @@ THREE.ShaderFlares = {
|
|
|
|
|
|
"if( renderType == 2 ) {",
|
|
|
|
|
|
- "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.5, 0.5 ) );",
|
|
|
-
|
|
|
- "vVisibility = ( visibility.r / 9.0 ) *",
|
|
|
- "( 1.0 - visibility.g / 9.0 ) *",
|
|
|
- "( visibility.b / 9.0 ) *",
|
|
|
- "( 1.0 - visibility.a / 9.0 );",
|
|
|
+ "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );",
|
|
|
+
|
|
|
+ "vVisibility = visibility.r / 9.0;",
|
|
|
+ "vVisibility *= 1.0 - visibility.g / 9.0;",
|
|
|
+ "vVisibility *= visibility.b / 9.0;",
|
|
|
+ "vVisibility *= 1.0 - visibility.a / 9.0;",
|
|
|
|
|
|
"pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
|
|
|
"pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
|
|
@@ -37563,11 +37564,10 @@ THREE.ShaderFlares = {
|
|
|
|
|
|
"} else {",
|
|
|
|
|
|
- "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a +",
|
|
|
- "texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;",
|
|
|
-
|
|
|
+ "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;",
|
|
|
+ "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;",
|
|
|
"visibility = ( 1.0 - visibility / 4.0 );",
|
|
|
|
|
|
"vec4 texture = texture2D( map, vUV );",
|