Instance Transformation Reference Issue
-
I give these two commands, expecting to move a component over the first five seconds and then move it back over the next 5 seconds.
m comp, [20,20,30], 0, 5 m comp, [-20,-20,-30], 5, 10
The result, however, is that the second move command starts by placing the component back in its original position before beginning its move.
Internally, these commands are placed on a stack. The first moves nicely, but it does this by replacing the instance's transformation reference. The second move references the same component, but it was nicely copied so it could keep its original transformation reference.
I didn't copy it. Ruby did. I've been trying to get around this using
Transformation.set!()
, but so far without success. Any ideas for a clean solution? Or do I have to look through the stack, replacing, for each component, transformations with the latest?Making transformations easy is proving difficult.
-
Once it has moved, it's transformation will have changed. You can just grab the new transformation to get its current location, and then you have to supply the new transformation of where its going to. It should be just like you did in step 1 to get it to move somewhere in the first place.
Is Ruby doing something else?
Chris
-
Problem is it moves with a new Transformation. I think I've got Transformation.set! mastered so I don't have to change TMs. Will know soon.
-
TM's?
Sometimes its painful to help when I have to ask more questions about your jargon than about your sript issues
Advertisement