-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sprite3D.isFlat() calculation does not take transformationMatrix3D adjustments into consideration #969
Comments
How is it supposed to know that you changed the internals of the returned transformation matrix? If you used the |
I understand that it wouldn't be aware of the translation/rotation/scale applied, but it could potentially be aware of the difference between the original transformationMatrix3D and the new one returned after the adjustments? Since the returned transformationMatrix3D is technically no longer 'flat'. I have a given scenario where it is necessary to avoid making these adjustments directly on the container (via: x, y, z, rotationX/rotationY/rotationZ, scaleX/scaleY/scaleZ). |
Hm ... I see what you mean. The problem is that there is no way for me to get notified that the transformation matrix was changed, so I can't trigger any logic that re-evaluates One way to fix this would be an additional method (like Would something like that work for you, @Snky? |
But does it make sense to add anything like that? 3D matrix is a product of the 2D matrix and additional properties, modifying it like that is simply making a hack in my opinion. I think the simplest thing to do for Snky would be to override The best way would be to create a setter for So, my vote goes to: create a subclass and override BTW, @Snky, if you don't want to use the build-in properties, maybe it's because of the same thing I discussed with Daniel a couple of days ago: #954 (read through the whole thing) and what you need is a new set of properties which change the Sprite's appearance. If so, what we agreed on in that issue's comments is exactly the thing you need (it'll require subclassing as well). |
'isFlat' setter sounds like a non-abusive approach. 🍡😄
|
Setter sounds like exposing internal logic as a part of public interface :) Something like |
Thanks for the feedback, guys! I don't actually consider modifying the 3D transformation matrix a hack, or at least no more so than on the standard (2D) Agreed, while an So it would need to be an additional property or method, in my opinion. But for now, @Snky, I'd say you try the subclassing approach first! Simple create a subclass of Sprite3D and override the |
The isFlat function should compensate for these adjustments. Which would make the trace result: true, false
The text was updated successfully, but these errors were encountered: