Skip to content

Commit a439b33

Browse files
committed
Make Geometry flag changes
1 parent 446da4e commit a439b33

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

js/src/core/Geometry.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,30 @@ var GeometryModel = AutogenGeometryModel.extend({
4040

4141
},
4242

43+
onChange: function(model, options) {
44+
if (options !== 'pushFromThree') {
45+
if (this.hasChanged('vertices')) {
46+
this.obj.verticesNeedUpdate = true;
47+
}
48+
if (this.hasChanged('colors')) {
49+
this.obj.colorsNeedUpdate = true;
50+
}
51+
if (this.hasChanged('faces')) {
52+
this.obj.elementsNeedUpdate = true;
53+
}
54+
if (this.hasChanged('faceVertexUvs')) {
55+
this.obj.uvsNeedUpdate = true;
56+
}
57+
if (this.hasChanged('normals')) {
58+
this.obj.normalsNeedUpdate = true;
59+
}
60+
if (this.hasChanged('morphTargets') || this.hasChanged('morphNormals')) {
61+
this.obj.morphTargetsNeedUpdate = true;
62+
}
63+
}
64+
AutogenGeometryModel.prototype.onChange.call(this, model, options);
65+
}
66+
4367
});
4468

4569
module.exports = {

0 commit comments

Comments
 (0)