PHP Code:
trace = bulletTrace(model.origin, model.origin + (somexdir, someydir, somezdir), false, model);
model.origin = trace["position"];
model.angles = vectorNormalize(trace["normal"])
Could be something like this or at least that is the direction you have to look for. The trace["normal"] is the thing you are looking for but not sure if it can be applied to models, this needs some testing but im 1 lazy ass...
Edit: Also take a look at kung's portal mod https://killtube.org/showthread.php?...oD2-Portal-Mod proably has what you need.