MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ReflectRay

Function ReflectRay

Descent3/render.cpp:513–518  ·  view source on GitHub ↗

Given a vector, reflects that vector off of a mirror vector Useful for specular and other reflective surfaces

Source from the content-addressed store, hash-verified

511// Given a vector, reflects that vector off of a mirror vector
512// Useful for specular and other reflective surfaces
513void ReflectRay(vector *dest, vector *src, vector *mirror_norm) {
514 *dest = *src;
515 float d = *dest * *mirror_norm;
516 vector upvec = d * *mirror_norm;
517 *dest -= (2.0f * upvec);
518}
519
520// This is needed for small view cameras
521// It clears the facing array so that it is recomputed

Callers 2

MarkFacingFacesFunction · 0.85
BuildMirroredRoomListSubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected