ソースを参照

Fix: change variable name to the more explicit sceneUsesRightHandedSystem

Thibault Durand 5 年 前
コミット
062332e66d
1 ファイル変更3 行追加3 行削除
  1. 3 3
      serializers/src/OBJ/objSerializer.ts

+ 3 - 3
serializers/src/OBJ/objSerializer.ts

@@ -16,10 +16,10 @@ export class OBJExport {
      * @param materials defines if materials should be exported
      * @param materials defines if materials should be exported
      * @param matlibname defines the name of the associated mtl file
      * @param matlibname defines the name of the associated mtl file
      * @param globalposition defines if the exported positions are globals or local to the exported mesh
      * @param globalposition defines if the exported positions are globals or local to the exported mesh
-     * @param useRightHandedSystem defines if the babylon scene is right handed, in this case the exported obj vertices will be inverted 
+     * @param sceneUsesRightHandedSystem defines if the babylon scene is right handed, in this case the exported obj X vertices won't be inverted 
      * @returns the OBJ content
      * @returns the OBJ content
      */
      */
-    public static OBJ(mesh: Mesh[], materials?: boolean, matlibname?: string, globalposition?: boolean, useRightHandedSystem?: boolean): string {
+    public static OBJ(mesh: Mesh[], materials?: boolean, matlibname?: string, globalposition?: boolean, sceneUsesRightHandedSystem?: boolean): string {
         const output: string[] = [];
         const output: string[] = [];
         let v = 1;
         let v = 1;
         if (materials) {
         if (materials) {
@@ -70,7 +70,7 @@ export class OBJExport {
             for (var i = 0; i < trunkVerts.length; i += 3) {
             for (var i = 0; i < trunkVerts.length; i += 3) {
                 // Babylon default is left handed, while OBJ default is right handed
                 // Babylon default is left handed, while OBJ default is right handed
                 // By default we serialize in OBJ inverting the X vertices
                 // By default we serialize in OBJ inverting the X vertices
-                if(useRightHandedSystem) {
+                if(sceneUsesRightHandedSystem) {
                     output.push("v " + trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
                     output.push("v " + trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
                 } else {
                 } else {
                     output.push("v " + -trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
                     output.push("v " + -trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);