Nockawa Posted July 28, 2016 Share Posted July 28, 2016 2 hours ago, MasterK said: this.scale = (settings.scale == null) ? 1 : settings.scale; this.scaleX = (settings.scaleX == null) ? 1 : settings.scaleX; this.scaleY = (settings.scaleY == null) ? 1 : settings.scaleY; Object.defineProperty(Prim2DBase.prototype, "scale", { Object.defineProperty(Prim2DBase.prototype, "scaleX", { Object.defineProperty(Prim2DBase.prototype, "scaleY", { var tflags = Prim2DBase.actualPositionProperty.flagId | Prim2DBase.rotationProperty.flagId | Prim2DBase.scaleProperty.flagId | Prim2DBase.originProperty.flagId;var tflags = Prim2DBase.actualPositionProperty.flagId | Prim2DBase.rotationProperty.flagId | Prim2DBase.originProperty.flagId | Prim2DBase.scaleXProperty.flagId | Prim2DBase.scaleYProperty.flagId; local = BABYLON.Matrix.Compose(new BABYLON.Vector3(this._scale, this._scale, 1), rot, new BABYLON.Vector3(pos.x, pos.y, 0)); local = BABYLON.Matrix.Compose(new BABYLON.Vector3(this._scaleX, this._scaleY, 1), rot, new BABYLON.Vector3(pos.x, pos.y, 0)); BABYLON.Matrix.ScalingToRef(this._scale, this._scale, 1, Prim2DBase._t0); BABYLON.Matrix.ScalingToRef(this._scaleX, this._scaleY, 1, Prim2DBase._t0); BABYLON.instanceLevelProperty(5, function (pi) { return Prim2DBase.scaleProperty = pi; }, false, true) ], Prim2DBase.prototype, "scale", null); __decorate([ __decorate([ BABYLON.instanceLevelProperty(14, function (pi) { return Prim2DBase.scaleXProperty = pi; }, false, true) ], Prim2DBase.prototype, "scaleX", null); __decorate([ BABYLON.instanceLevelProperty(15, function (pi) { return Prim2DBase.scaleYProperty = pi; }, false, true) ], Prim2DBase.prototype, "scaleY", null); Yes indeed, you did what should be done, but I'm still not convinced that it's a good idea to enable nonuniform scale, do you have a concrete use case to give me when you need it? Thanks! Quote Link to comment Share on other sites More sharing options...
MasterK Posted July 28, 2016 Author Share Posted July 28, 2016 49 minutes ago, Nockawa said: Yes indeed, you did what should be done, but I'm still not convinced that it's a good idea to enable nonuniform scale, do you have a concrete use case to give me when you need it? Thanks! Animate sprite scaleY (1->2->1) Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 28, 2016 Share Posted July 28, 2016 3 minutes ago, MasterK said: Animate sprite scaleY (1->2->1) Ok, why not, non uniform scale is mostly a bad thing when it comes to compute the invert of a matrix, which is not something that happens a lot for a 2D Engine. But I would keep the behavior of scale the same as before to ensure backward compatibility and add the two properties you mentioned. Ok, let's try that, you'll tell me if it's turning out ok of not. MasterK 1 Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 28, 2016 Share Posted July 28, 2016 Ok @MasterK here's the dev: https://github.com/nockawa/Babylon.js/commit/1c0aba093844302162984429b620a9557e16b090 I'll submit a PR right away. Please review the commit and tell me it's you think everything is ok, I tend to always forget something... Quote Link to comment Share on other sites More sharing options...
MasterK Posted July 28, 2016 Author Share Posted July 28, 2016 3 minutes ago, Nockawa said: Ok @MasterK here's the dev: https://github.com/nockawa/Babylon.js/commit/1c0aba093844302162984429b620a9557e16b090 I'll submit a PR right away. Please review the commit and tell me it's you think everything is ok, I tend to always forget something... nice. Looks perfect. better than i did, i was forced to remove scale, cause i didn't make this two things mix good. I'll try after github js update. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.