Inverse dynamics methods are commonly used for the biomechanical analysis of human motion. External forces applied on the subject are required as an input data to solve the dynamic equilibrium of the subject. Force platforms measure ground reaction forces and moments (GRF&Ms) but they limit the ecological aspect of experimental conditions. Motion-based GRF&Ms prediction may circumvent this limitation. The current study aims at evaluating the accuracy of an optimization-based GRF&Ms prediction method modified to be applied to the interaction with a moving and/or nonhorizontal structure (MNHS). The main improvement of the method deals with contact detection in such a MNHS. To evaluate the accuracy of the method, 20 subjects performed squats and steps on an instrumented moving structure, measuring both motion and GRF&Ms. The comparison of the root-mean-square error between the predicted and measured GFR&Ms divided by the subjects mass showed a similar order of magnitude than those from the method without the studied modification (0.14 N/kg for antero-posterior forces, 0.29 N/kg for medio lateral forces, 0.61 N/kg for longitudinal forces, 0.06 Nm/kg for frontal moments, 0.13 Nm/kg for sagittal moments, and 0.03 Nm/kg for transverse moments). The results showed the suitability of the method to study human motions for tasks performed on a MNHS.