41class EXPCL_PANDA_PGRAPH Fog :
public PandaNode {
43 explicit Fog(
const std::string &name);
52 virtual void xform(
const LMatrix4 &mat);
61 INLINE Mode get_mode()
const;
66 INLINE
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b);
67 INLINE
void set_color(
const LColor &color);
88 void output(std::ostream &out)
const;
95 void compute_density();
102 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
108 LPoint3 _linear_onset_point;
109 LPoint3 _linear_opaque_point;
110 PN_stdfloat _exp_density;
112 PN_stdfloat _linear_fallback_cosa;
113 PN_stdfloat _linear_fallback_onset, _linear_fallback_opaque;
115 PN_stdfloat _transformed_onset, _transformed_opaque;
121 static void init_type() {
122 PandaNode::init_type();
124 PandaNode::get_class_type());
126 virtual TypeHandle get_type()
const {
127 return get_class_type();
129 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
132 static TypeHandle _type_handle;
135EXPCL_PANDA_PGRAPH std::ostream &operator << (std::ostream &out, Fog::Mode mode);
137INLINE std::ostream &operator << (std::ostream &out,
const Fog &fog) {
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Specifies how atmospheric fog effects are applied to geometry.
set_color
Sets the color of the fog.
void adjust_to_camera(const TransformState *camera_transform)
This function is intended to be called by the cull traverser to compute the appropriate camera-relati...
set_mode
Specifies the computation that is used to determine the fog effect.
set_linear_opaque_point
Specifies the point in space at which the fog completely obscures geometry.
get_linear_opaque_point
Returns the point in space at which the fog completely obscures geometry.
get_color
Returns the color of the fog.
get_linear_onset_point
Returns the point in space at which the fog begins.
set_linear_onset_point
Specifies the point in space at which the fog begins.
void set_linear_range(PN_stdfloat onset, PN_stdfloat opaque)
Specifies the effects of the fog in linear distance units.
get_exp_density
Returns the density of the fog for exponential calculations.
set_exp_density
Sets the density of the fog for exponential calculations.
void get_linear_range(PN_stdfloat &onset, PN_stdfloat &opaque)
Retrieves the current onset and offset ranges.
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 ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...