123456789101112131415 |
- function [new_piston_dimensions] = JA_piston_sliding_final_dimension(Ob, target_object)
- % set the final positon of the selected piston (whne it hits the ball)
- switch target_object
- case 'piston_CF'
- dim = [1 3];
-
- case 'piston_SBJ'
- dim = [2 4];
- end
- displacement = Ob.ball.dimension(dim(2)) - Ob.(target_object).dimension(dim(1));
- new_piston_dimensions = Ob.(target_object).dimension;
- new_piston_dimensions(dim) = new_piston_dimensions(dim)+displacement;
- end
|