public void moveLegs() { // reposition all legs from the LegGroup for (int i = 0; i < m_legs.length; i++) { if (m_legs[i] == null || m_relativePositions[i] == null) continue; Vec3 tmpPoint = new Vec3(m_relativePositions[i], 0); tmpPoint.rotate(m_rotation); Vec3 finalPoint = new Vec3( tmpPoint.getX() + m_translation.getX(), tmpPoint.getY() + m_translation.getY(), tmpPoint.getZ() + m_translation.getZ()); m_legs[i].setGoalPosition(finalPoint); } }