Karika 30
The mental acts (vr̥ttiḥ) are produced by the simultaneous functioning of the four (intellect, ego, mind, and senses) directed by what are sensed and not sensed, influenced by the three qualities based on previous mental acts (vr̥ttiḥ).
Sensed + Not sensed + three qualities based on previous mental acts = current mental acts
Agents involved: intellect, ego, mind, and senses.