21 INLINE Fog::Mode Fog::
63 set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b) {
97 _linear_onset_point = onset * forward;
98 _linear_opaque_point = opaque * forward;
99 _transformed_onset = onset;
100 _transformed_opaque = opaque;
112 return _linear_onset_point;
123 _linear_onset_point.set(x, y, z);
134 _linear_onset_point = linear_onset_point;
146 return _linear_opaque_point;
158 _linear_opaque_point.set(x, y, z);
170 _linear_opaque_point = linear_opaque_point;
215 _linear_fallback_cosa = ccos(deg_2_rad(angle));
216 _linear_fallback_onset = onset;
217 _linear_fallback_opaque = opaque;
227 INLINE PN_stdfloat
Fog:: 244 nassertv((exp_density >= 0.0) && (exp_density <= 1.0));
245 _exp_density = exp_density;
247 if (_mode == M_linear) {
248 _mode = M_exponential;
const LPoint3 & get_linear_opaque_point() const
Returns the point in space at which the fog completely obscures geometry.
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b)
Sets the color of the fog.
void set_linear_fallback(PN_stdfloat angle, PN_stdfloat onset, PN_stdfloat opaque)
Fog effects are traditionally defined in camera-relative space, but the Panda Fog node has a special ...
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
void set_linear_onset_point(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Specifies the point in space at which the fog begins.
void set_linear_opaque_point(const LPoint3 &linear_opaque_point)
Specifies the point in space at which the fog completely obscures geometry.
static LVector3f forward(CoordinateSystem cs=CS_default)
Returns the forward vector for the given coordinate system.
const LPoint3 & get_linear_onset_point() const
Returns the point in space at which the fog begins.
void set_mode(Mode mode)
Specifies the computation that is used to determine the fog effect.
void set_linear_range(PN_stdfloat onset, PN_stdfloat opaque)
Specifies the effects of the fog in linear distance units.
void set_exp_density(PN_stdfloat exp_density)
Sets the density of the fog for exponential calculations.
PN_stdfloat get_exp_density() const
Returns the density of the fog for exponential calculations.
This is the base class for all three-component vectors and points.
const LColor & get_color() const
Returns the color of the fog.