bg2e-js 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/base/Material.ts +5 -4
package/package.json
CHANGED
package/src/base/Material.ts
CHANGED
|
@@ -102,10 +102,7 @@ export const vectorTypeLoader: TypeLoader = {
|
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
if (
|
|
106
|
-
return new Vec(obj);
|
|
107
|
-
}
|
|
108
|
-
else if (obj instanceof Vec) {
|
|
105
|
+
if (obj instanceof Vec) {
|
|
109
106
|
return obj;
|
|
110
107
|
}
|
|
111
108
|
else {
|
|
@@ -120,6 +117,10 @@ export const vectorTypeLoader: TypeLoader = {
|
|
|
120
117
|
else if (obj.length >= 2 && obj.length <= 4) {
|
|
121
118
|
return new Vec(obj);
|
|
122
119
|
}
|
|
120
|
+
// Retrocompatibility with v1.4
|
|
121
|
+
else if (obj._v && obj._v.length >= 2 && obj._v.length <= 4) {
|
|
122
|
+
return new Vec(obj._v);
|
|
123
|
+
}
|
|
123
124
|
else {
|
|
124
125
|
throw new Error(`Invalid parameter found in material deserialization. The required parameter type is array with 2, 3 or 4 elements`);
|
|
125
126
|
}
|