Open ginkxo opened 4 years ago
I'd give a hint here since some of you may be new to C++ or Object-Oriented Programming:
The function PointLight::direction
(or DirectionalLight::direction
) is a member function of the PointLight
(or DirectionalLight
) class. So, you also have access to the member variables (also known as fields) of the object for which the function is called. This means that you also have access to properties of that light, and not just the parameter (q
) explicitly passed to the function.
Look at PointLight.h
(or DirectionalLight.h
) to see what properties are available to you.
max_t
is the parametric distance of the query point q
from the light source. For a point light, this will be the value of the parameter t
along the light ray. For a directional light, the README
tells you precisely what value you need to set here. 😉
right, I was getting confused over how the d field in specifically DirectionalLight was both being used as a "direction from the light towards the scene" but we also return d as a "direction towards the light" in our .direction implementations. I'm assuming now that since PointLight has its member variable called p that this was just a case of variable naming I accidentally overlooked. thanks for the help!
Regarding directional light vs. point light:
thanks!