Browse Source

Added frontface direction constants.

These replace frontFaceDirection parameter strings in renderer.setFaceCulling( cullFace, frontFaceDirection ):

"cw"  => THREE.FrontFaceDirectionCW
"ccw" => THREE.FrontFaceDirectionCCW

See related cullFace constants changes in #2683
alteredq 12 năm trước cách đây
mục cha
commit
55e8d36455
4 tập tin đã thay đổi với 28 bổ sung21 xóa
  1. 7 4
      build/three.js
  2. 14 13
      build/three.min.js
  3. 3 0
      src/Three.js
  4. 4 4
      src/renderers/WebGLRenderer.js

+ 7 - 4
build/three.js

@@ -88,6 +88,9 @@ THREE.CullFaceBack = 1;
 THREE.CullFaceFront = 2;
 THREE.CullFaceFrontBack = 3;
 
+THREE.FrontFaceDirectionCW = 0;
+THREE.FrontFaceDirectionCCW = 1;
+
 // MATERIAL CONSTANTS
 
 // side
@@ -21558,7 +21561,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	// GL state setting
 
-	this.setFaceCulling = function ( cullFace, frontFace ) {
+	this.setFaceCulling = function ( cullFace, frontFaceDirection ) {
 
 		if ( cullFace === THREE.CullFaceNone ) {
 
@@ -21566,13 +21569,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		} else {
 
-			if ( !frontFace || frontFace === "ccw" ) {
+			if ( frontFaceDirection === THREE.FrontFaceDirectionCW ) {
 
-				_gl.frontFace( _gl.CCW );
+				_gl.frontFace( _gl.CW );
 
 			} else {
 
-				_gl.frontFace( _gl.CW );
+				_gl.frontFace( _gl.CCW );
 
 			}
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 14 - 13
build/three.min.js


+ 3 - 0
src/Three.js

@@ -88,6 +88,9 @@ THREE.CullFaceBack = 1;
 THREE.CullFaceFront = 2;
 THREE.CullFaceFrontBack = 3;
 
+THREE.FrontFaceDirectionCW = 0;
+THREE.FrontFaceDirectionCCW = 1;
+
 // MATERIAL CONSTANTS
 
 // side

+ 4 - 4
src/renderers/WebGLRenderer.js

@@ -5938,7 +5938,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	// GL state setting
 
-	this.setFaceCulling = function ( cullFace, frontFace ) {
+	this.setFaceCulling = function ( cullFace, frontFaceDirection ) {
 
 		if ( cullFace === THREE.CullFaceNone ) {
 
@@ -5946,13 +5946,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		} else {
 
-			if ( !frontFace || frontFace === "ccw" ) {
+			if ( frontFaceDirection === THREE.FrontFaceDirectionCW ) {
 
-				_gl.frontFace( _gl.CCW );
+				_gl.frontFace( _gl.CW );
 
 			} else {
 
-				_gl.frontFace( _gl.CW );
+				_gl.frontFace( _gl.CCW );
 
 			}
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác