my vector-fu is not good to solve this.
Look, I don't want to be rude since you phrased it in such a funny way. However to quote Rick "Let's do it the dumbest way possible because it's easier for you."
This is something that if you do it half, will cause you lots of problems in the long run. The right thing to do for you is to learn linear algebra and how cross product works.
That said, what you want only works with animals that have long bodies, like a lizard, and aligns them self with the terrain.
Other animals, like humans, will always align inverse towards gravity. Inverse Kinematics is used to make it look like they are walking on the terrain.
Easy hack solution:
We need what a cross product gives us, not only a up direction align to the normal, but also a forwards directions; without this your object can't rotate after it is aligned to the normal.
The easy way we use 2 objects, one to align to the normal and the player to rotate.
1.) Make KinematicBody, give it a basic collision shape. This is the body that will be aligned to the floor. Attach an RayCast node to it.
#First move the body to the collision point
get_node("..").transform.origin = self.get_collision_point()
#Next adjust the normal using the collision point
var RelativeNormal = \
get_node("..").transform.origin + self.get_collision_normal();
#Last use the godot look_at function to rotate the object
get_node("..").look_at(RelativeNormal, Vector3.UP)
So the above body rotates itself based on the normal of the mesh, Next you add your Player object as a child of that object.
Now your player can do everything it does normally, including rotate. However physics has to be done using the first node.
The math used:
RelativeNormal: to look at a normal, we need to add it to the objects already existing position.
If the Object is at (0, 0, 0) and the Normal is (0, 1, 0) then (0, 0, 0) + (0, 1, 0) = (0, 1, 0) meaning it needs to look up.
(2, 3, 4) + (0, 1, 0) = (2, 4, 4) and (2, 4, 4) is (0, 1, 0) higher than (2, 3, 4). Meaning it needs to look at the point above it self.