Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
OnManipulationEnded doesn't fire for rotation or scale #5213
The ManipulationHandler event OnManipulationEnded doesn't seem to fire at the end of a rotation or scale, only at the end of an object translation.
Create a component which, on Start, adds a BoundingBox and ManipulationHandler components. For example:
Attach the component to an object (e.g. cube) in the scene and run the scene.
If you move the object, its FinishManipulation gets called. If you rotate or scale the object using the boundingbox handles, the object will be properly rotated or scaled, but there will be no callback at the end.
ManipulationEnded event should fire for any type of manipulation.
Your Setup (please complete the following information)
Target Platform (please complete the following information)
I think the reason for this is
I'm not 100% certain about this because the BoundingBox class is huge ... we should really separate the graphics elements from the transform logic there.
I think a way that will help to think about this is that Manipulation* events come from the manipulation handler, not bounding box. When you rotate / scale an object using one of the bounding box handles, you are using the bounding box component. When you move / scale / rotate by interacting with the object's collidable, you are using manipulation handler.
Not entirely. if you grab and move the object, you'll get manipulation ended. If you grab affordances you'll be using bounding box which doesn't raise those event.
That sounds right. Can you think of a better way to design it? For example, should bounding box also just raise ManipulationStarted/Ended events?
No, RotateStopped/ScaleStopped will only be called when you are using the BoundingBox.
Thanks @julenka , that explanation helps a lot. I'm still trying to get a reasonable solution for my situation, but I think you've given me enough understanding that I should be able to accomplish what I need.
On your design question, I do think that from the user's perspective it would be more convenient and less complex if the various manipulation events were routed through a common handler, and the ManipulationHandler seems perfectly appropriate for that.
Bernie assures me that the BoundingBox has more pressing needs from a refactor, but that might be something to consider during the upcoming refactor.
Thanks again for the clarity!