Skip to content

Commit f270f4d

Browse files
committed
js: Remove MeshoptSimplifier.useExperimentalFeatures
Both simplifyWithAttributes and simplifyPoints are stable and no longer require experimental flag. Technically pruning is still considered experimental but it would make more sense to just remove the boolean setting as even if pruning changes in its behavior, that change will only concern the implementation.
1 parent 0cec566 commit f270f4d

5 files changed

+0
-22
lines changed

demo/simplify.html

-2
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,6 @@
457457

458458
function simplify() {
459459
MeshoptSimplifier.ready.then(function () {
460-
MeshoptSimplifier.useExperimentalFeatures = true;
461-
462460
var threshold = Math.pow(10, -settings.errorThresholdLog10);
463461

464462
if (settings.autoLod) {

js/meshopt_simplifier.js

-7
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,6 @@ var MeshoptSimplifier = (function () {
205205
ready: ready,
206206
supported: true,
207207

208-
// set this to true to be able to use simplifyPoints and simplifyWithAttributes
209-
// note that these functions are experimental and may change interface/behavior in a way that will require revising calling code
210-
useExperimentalFeatures: false,
211-
212208
compactMesh: function (indices) {
213209
assert(
214210
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
@@ -234,7 +230,6 @@ var MeshoptSimplifier = (function () {
234230
var options = 0;
235231
for (var i = 0; i < (flags ? flags.length : 0); ++i) {
236232
assert(flags[i] in simplifyOptions);
237-
assert(this.useExperimentalFeatures || flags[i] != 'Prune'); // set useExperimentalFeatures to use experimental flags like Prune
238233
options |= simplifyOptions[flags[i]];
239234
}
240235

@@ -267,7 +262,6 @@ var MeshoptSimplifier = (function () {
267262
target_error,
268263
flags
269264
) {
270-
assert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code
271265
assert(
272266
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
273267
);
@@ -330,7 +324,6 @@ var MeshoptSimplifier = (function () {
330324
},
331325

332326
simplifyPoints: function (vertex_positions, vertex_positions_stride, target_vertex_count, vertex_colors, vertex_colors_stride, color_weight) {
333-
assert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code
334327
assert(vertex_positions instanceof Float32Array);
335328
assert(vertex_positions.length % vertex_positions_stride == 0);
336329
assert(vertex_positions_stride >= 3);

js/meshopt_simplifier.module.d.ts

-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export const MeshoptSimplifier: {
66
supported: boolean;
77
ready: Promise<void>;
88

9-
useExperimentalFeatures: boolean;
10-
119
compactMesh: (indices: Uint32Array) => [Uint32Array, number];
1210

1311
simplify: (
@@ -19,7 +17,6 @@ export const MeshoptSimplifier: {
1917
flags?: Flags[]
2018
) => [Uint32Array, number];
2119

22-
// Experimental; requires useExperimentalFeatures to be set to true
2320
simplifyWithAttributes: (
2421
indices: Uint32Array,
2522
vertex_positions: Float32Array,
@@ -35,7 +32,6 @@ export const MeshoptSimplifier: {
3532

3633
getScale: (vertex_positions: Float32Array, vertex_positions_stride: number) => number;
3734

38-
// Experimental; requires useExperimentalFeatures to be set to true
3935
simplifyPoints: (
4036
vertex_positions: Float32Array,
4137
vertex_positions_stride: number,

js/meshopt_simplifier.module.js

-7
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,6 @@ var MeshoptSimplifier = (function () {
204204
ready: ready,
205205
supported: true,
206206

207-
// set this to true to be able to use simplifyPoints and simplifyWithAttributes
208-
// note that these functions are experimental and may change interface/behavior in a way that will require revising calling code
209-
useExperimentalFeatures: false,
210-
211207
compactMesh: function (indices) {
212208
assert(
213209
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
@@ -233,7 +229,6 @@ var MeshoptSimplifier = (function () {
233229
var options = 0;
234230
for (var i = 0; i < (flags ? flags.length : 0); ++i) {
235231
assert(flags[i] in simplifyOptions);
236-
assert(this.useExperimentalFeatures || flags[i] != 'Prune'); // set useExperimentalFeatures to use experimental flags like Prune
237232
options |= simplifyOptions[flags[i]];
238233
}
239234

@@ -266,7 +261,6 @@ var MeshoptSimplifier = (function () {
266261
target_error,
267262
flags
268263
) {
269-
assert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code
270264
assert(
271265
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
272266
);
@@ -329,7 +323,6 @@ var MeshoptSimplifier = (function () {
329323
},
330324

331325
simplifyPoints: function (vertex_positions, vertex_positions_stride, target_vertex_count, vertex_colors, vertex_colors_stride, color_weight) {
332-
assert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code
333326
assert(vertex_positions instanceof Float32Array);
334327
assert(vertex_positions.length % vertex_positions_stride == 0);
335328
assert(vertex_positions_stride >= 3);

js/meshopt_simplifier.test.js

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ process.on('unhandledRejection', (error) => {
66
process.exit(1);
77
});
88

9-
simplifier.useExperimentalFeatures = true;
10-
119
var tests = {
1210
compactMesh: function () {
1311
var indices = new Uint32Array([0, 1, 3, 3, 1, 5]);

0 commit comments

Comments
 (0)