If additional information was needed:
Origin to geometry
It is the mean of the vertices coordinates.
Origin to center of mass (surface)
Calculates the centroid of each face then the barycenter of these centroids ponderated by the face surfaces.
For each face, loops over its triangles (green, blue, red), calculates their centered and ponderate them by the triangle surface.
In result, calculates the yellow one (their barycenter).
Do that for all faces and calculate the overall barycenter.
Origin to center of mass (volume)
Calculates the centroid of each volume (see below) then the barycenter of them ponderated by their individual volumes.
A volume here is made of a tetrahedron composed of each face triangle and a reference center.
This center is itself precalculated as a barycenter of each face centroid ponderated by their amount of vertices.
For each face and from the center calculates the volume for each tetrahedron (green, blue, red) and the volume center is the barycenter.
Do it for all faces and get the barycenter off all (ponderated by individual volumes).
The difference between the two former is often small, but that may be important for simulations.