19 TypeHandle EggSwitchConditionDistance::_type_handle;
25 EggSwitchConditionDistance::
26 EggSwitchConditionDistance(
double switch_in,
double switch_out,
27 const LPoint3d ¢er,
double fade) {
28 _switch_in = switch_in;
29 _switch_out = switch_out;
47 void EggSwitchConditionDistance::
48 write(std::ostream &out,
int indent_level)
const {
49 indent(out, indent_level) <<
"<SwitchCondition> {\n";
50 indent(out, indent_level+2)
51 <<
"<Distance> { " << _switch_in <<
" " << _switch_out;
57 out <<
" <Vertex> { " << _center <<
" } }\n";
58 indent(out, indent_level) <<
"}\n";
68 _center = _center * mat;
70 LVector3d in = LVector3d(_switch_in, 0.0, 0.0) * mat;
71 LVector3d out = LVector3d(_switch_out, 0.0, 0.0) * mat;
73 _switch_in = in.length();
74 _switch_out = out.length();
virtual void transform(const LMatrix4d &mat)
Applies the indicated transformation matrix to the switch condition parameters.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
TypeHandle is the identifier used to differentiate C++ class types.
This corresponds to a <SwitchCondition> entry within a group.
A SwitchCondition that switches the levels-of-detail based on distance from the camera's eyepoint.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.