87 if (_data ==
nullptr) {
99 _data->add_child(_vpool);
105 if (_vpool->empty()) {
106 _data->remove_child(_vpool);
119 _data->add_child(_vpool);
122 recurse_nodes(root_path, _data,
false,
nullptr);
125 if (_vpool->empty()) {
126 _data->remove_child(_vpool);
137 bool has_decal, CharacterJointMap *joint_map) {
140 convert_geom_node(DCAST(
GeomNode, node), node_path, egg_parent, has_decal, joint_map);
142 }
else if (node->
is_of_type(LODNode::get_class_type())) {
143 convert_lod_node(DCAST(
LODNode, node), node_path, egg_parent, has_decal, joint_map);
145 }
else if (node->
is_of_type(SequenceNode::get_class_type())) {
146 convert_sequence_node(DCAST(
SequenceNode, node), node_path, egg_parent, has_decal, joint_map);
148 }
else if (node->
is_of_type(SwitchNode::get_class_type())) {
149 convert_switch_node(DCAST(
SwitchNode, node), node_path, egg_parent, has_decal, joint_map);
151 }
else if (node->
is_of_type(CollisionNode::get_class_type())) {
152 convert_collision_node(DCAST(
CollisionNode, node), node_path, egg_parent, has_decal, joint_map);
154 }
else if (node->
is_of_type(AnimBundleNode::get_class_type())) {
155 convert_anim_node(DCAST(
AnimBundleNode, node), node_path, egg_parent, has_decal);
157 }
else if (node->
is_of_type(Character::get_class_type())) {
158 convert_character_node(DCAST(
Character, node), node_path, egg_parent, has_decal);
164 apply_node_properties(egg_group, node);
166 recurse_nodes(node_path, egg_group, has_decal, joint_map);
176 CharacterJointMap *joint_map) {
181 apply_node_properties(egg_group, node);
186 num_children = std::min(num_children, num_switches);
188 for (
int i = 0; i < num_children; i++) {
193 convert_node(
WorkingNodePath(node_path, child), next_group, has_decal, joint_map);
195 if (next_group->size() == 1) {
198 EggNode *child_node = *next_group->begin();
199 if (child_node->
is_of_type(EggGroup::get_class_type())) {
201 next_group->remove_child(child.p());
207 PN_stdfloat in = node->
get_in(i);
208 PN_stdfloat out = node->
get_out(i);
211 next_group->set_lod(dist);
222 CharacterJointMap *joint_map) {
227 apply_node_properties(egg_group, node);
230 egg_group->set_switch_flag(
true);
231 egg_group->set_switch_fps(node->get_frame_rate());
235 for (
int i = 0; i < num_children; i++) {
240 convert_node(
WorkingNodePath(node_path, child), next_group, has_decal, joint_map);
253 CharacterJointMap *joint_map) {
258 apply_node_properties(egg_group, node);
261 egg_group->set_switch_flag(
true);
265 for (
int i = 0; i < num_children; i++) {
270 convert_node(
WorkingNodePath(node_path, child), next_group, has_decal, joint_map);
284 if (animGroup->
is_of_type(AnimBundle::get_class_type())) {
286 eggTable ->set_table_type(EggTable::TT_bundle);
288 }
else if (animGroup->
is_of_type(AnimGroup::get_class_type())) {
290 eggTable ->set_table_type(EggTable::TT_table);
294 if (animGroup->
is_of_type(AnimChannelMatrixXfmTable::get_class_type())) {
297 egg_anim->set_fps(fps);
298 for (
int i = 0; i < num_matrix_components; i++) {
299 string componentName(1, matrix_component_letters[i]);
300 char table_id = matrix_component_letters[i];
304 for (
unsigned int j = 0; j < table.size(); j++) {
311 for (
int i = 0; i < num_children; i++) {
313 EggGroupNode *eggChildNode = convert_animGroup_node(animChild, fps);
314 if (eggChildNode!=
nullptr) {
315 nassertr(eggNode!=
nullptr,
nullptr);
333 _data->add_child(eggTable);
347convert_character_bundle(
PartGroup *bundleNode,
EggGroupNode *egg_parent, CharacterJointMap *joint_map) {
348 convert_character_bundle(bundleNode, egg_parent, joint_map,
nullptr);
357 CharacterJointMap *joint_map,
const CharacterJoint *parent_joint) {
363 if (bundleNode->
is_of_type(CharacterJoint::get_class_type())) {
367 joint->set_group_type(EggGroup::GT_joint);
385 LMatrix4d net_transform = invert(LCAST(
double, character_joint->_initial_net_transform_inverse));
386 if (parent_joint !=
nullptr) {
387 if (parent_joint->_initial_net_transform_inverse != character_joint->_initial_net_transform_inverse) {
388 LMatrix4d parent_inverse = LCAST(
double, parent_joint->_initial_net_transform_inverse);
389 joint->
add_matrix4(net_transform * parent_inverse);
391 }
else if (!net_transform.is_identity()) {
396 LMatrix4d default_pose = LCAST(
double, character_joint->_default_value);
399 transform.
add_matrix4(LCAST(
double, default_pose));
405 if (joint_map !=
nullptr) {
406 CharacterJointMap::iterator mi = joint_map->find(character_joint);
407 if (mi != joint_map->end()) {
410 for (vi = joint_vertices.begin(); vi != joint_vertices.end(); ++vi) {
417 for (
int i = 0; i < num_children ; i++) {
419 convert_character_bundle(partGroup, joint_group, joint_map, character_joint);
437 egg_group->set_dart_type(EggGroup::DT_structured);
439 apply_node_properties(egg_group, node);
441 CharacterJointMap joint_map;
442 recurse_nodes(node_path, egg_group, has_decal, &joint_map);
446 int num_bundles = node->get_num_bundles();
447 for (
int i = 0; i < num_bundles; ++i) {
449 convert_character_bundle(bundle, egg_group, &joint_map);
460 CharacterJointMap *joint_map) {
465 apply_node_properties(egg_group, node,
false);
472 if (from_mask == into_mask) {
473 egg_group->set_collide_mask(into_mask);
475 egg_group->set_from_collide_mask(from_mask);
476 egg_group->set_into_collide_mask(into_mask);
481 egg_group->set_collide_flags(EggGroup::CF_descend);
485 LMatrix4 net_mat = net_transform->
get_mat();
487 net_mat = net_mat * inv;
489 int num_solids = node->get_num_solids();
491 if (num_solids > 0) {
497 for (
int i = 0; i < num_solids; i++) {
499 int flags = EggGroup::CF_descend;
501 if (!child->is_tangible()) {
502 flags |= EggGroup::CF_intangible;
505 if (child->has_effective_normal() &&
506 child->get_effective_normal() == LVector3::up()) {
507 flags |= EggGroup::CF_level;
510 if (child->
is_of_type(CollisionPolygon::get_class_type())) {
511 egg_group->set_cs_type(EggGroup::CST_polyset);
512 egg_group->set_collide_flags(flags);
518 int num_points = poly->get_num_points();
519 for (
int j = 0; j < num_points; j++) {
521 egg_vert.
set_pos(LCAST(
double, poly->get_point(j) * net_mat));
522 egg_vert.set_normal(LCAST(
double, poly->get_normal() * net_mat));
528 }
else if (child->
is_of_type(CollisionSphere::get_class_type())) {
530 LPoint3 center = sphere->get_center();
531 PN_stdfloat radius = sphere->get_radius();
534 if (num_solids == 1) {
535 egg_sphere = egg_group;
541 if (child->
is_of_type(CollisionInvSphere::get_class_type())) {
542 egg_sphere->set_cs_type(EggGroup::CST_inv_sphere);
544 egg_sphere->set_cs_type(EggGroup::CST_sphere);
546 egg_sphere->set_collide_flags(flags);
549 ev1.
set_pos(LCAST(
double, (center + LVector3(radius, 0, 0)) * net_mat));
550 ev2.
set_pos(LCAST(
double, (center + LVector3(0, radius, 0)) * net_mat));
551 ev3.
set_pos(LCAST(
double, (center + LVector3(-radius, 0, 0)) * net_mat));
552 ev4.
set_pos(LCAST(
double, (center + LVector3(0, -radius, 0)) * net_mat));
562 }
else if (child->
is_of_type(CollisionPlane::get_class_type())) {
564 LPoint3 origin = plane.get_point();
565 LVector3 normal = plane.get_normal();
570 if (std::fabs(normal[2]) > std::fabs(normal[1])) {
571 vec1 = normal.cross(LVector3(0, 1, 0));
573 vec1 = normal.cross(LVector3(0, 0, 1));
577 LVector3 vec2 = normal.cross(vec1);
580 if (num_solids == 1) {
581 egg_plane = egg_group;
586 egg_plane->set_cs_type(EggGroup::CST_plane);
587 egg_plane->set_collide_flags(flags);
590 ev0.
set_pos(LCAST(
double, origin * net_mat));
591 ev1.
set_pos(LCAST(
double, (origin + vec1) * net_mat));
592 ev2.
set_pos(LCAST(
double, (origin + vec2) * net_mat));
601 }
else if (child->
is_of_type(CollisionBox::get_class_type())) {
603 LPoint3 min_point = box->get_min();
604 LPoint3 max_point = box->get_max();
607 if (num_solids == 1) {
613 egg_box->set_cs_type(EggGroup::CST_box);
614 egg_box->set_collide_flags(flags);
618 ev0.
set_pos(LCAST(
double, min_point * net_mat));
619 ev1.
set_pos(LCAST(
double, max_point * net_mat));
627 }
else if (child->
is_of_type(CollisionCapsule::get_class_type())) {
629 LPoint3 point_a = capsule->get_point_a();
630 LPoint3 point_b = capsule->get_point_b();
631 LPoint3 centroid = (point_a + point_b) * 0.5f;
634 LVector3 axis = point_b - point_a;
636 if (std::fabs(axis[2]) > std::fabs(axis[1])) {
637 sideways = axis.cross(LVector3(0, 1, 0));
639 sideways = axis.cross(LVector3(0, 0, 1));
641 sideways.normalize();
642 sideways *= capsule->get_radius();
643 LVector3 extend = axis.normalized() * capsule->get_radius();
646 if (num_solids == 1) {
647 egg_capsule = egg_group;
652 egg_capsule->set_cs_type(EggGroup::CST_tube);
653 egg_capsule->set_collide_flags(flags);
658 ev0.
set_pos(LCAST(
double, (point_a - extend) * net_mat));
659 ev1.
set_pos(LCAST(
double, (centroid + sideways) * net_mat));
660 ev2.
set_pos(LCAST(
double, (point_b + extend) * net_mat));
661 ev3.
set_pos(LCAST(
double, (centroid - sideways) * net_mat));
672 nout <<
"Encountered unknown collision solid type " << child->get_type() <<
"\n";
678 recurse_nodes(node_path, egg_group, has_decal, joint_map);
686 EggGroupNode *egg_parent,
bool has_decal, CharacterJointMap *joint_map) {
688 bool fancy_attributes = apply_node_properties(egg_group, node);
690 if (node->get_effects()->has_decal()) {
695 egg_group->set_decal_flag(
true);
698 if (fancy_attributes || has_decal || !node->get_name().empty()) {
703 egg_parent = egg_group;
709 LMatrix4 net_mat = net_transform->
get_mat();
711 net_mat = net_mat * inv;
715 for (
int i = 0; i < num_geoms; ++i) {
717 CPT(
RenderState) geom_net_state = net_state->compose(geom_state);
722 if (num_geoms == 1 && node->
get_num_children() == 0 && egg_parent == egg_group &&
723 !geom_state->is_empty() && node->get_state()->is_empty()) {
724 apply_state_properties(egg_group, geom_state);
725 geom_state = RenderState::make_empty();
728 const Geom *geom = node->get_geom(i);
729 int num_primitives = geom->get_num_primitives();
730 for (
int j = 0; j < num_primitives; ++j) {
735 convert_primitive(vdata, simple, geom_state, geom_net_state,
736 net_mat, egg_parent, joint_map);
740 recurse_nodes(node_path, egg_parent, has_decal, joint_map);
751 CharacterJointMap *joint_map) {
757 if (primitive->
is_of_type(GeomTriangles::get_class_type())) {
759 }
else if (primitive->
is_of_type(GeomPatches::get_class_type())) {
761 }
else if (primitive->
is_of_type(GeomPoints::get_class_type())) {
763 }
else if (primitive->
is_of_type(GeomLines::get_class_type())) {
771 apply_state_properties(egg_prim, geom_state);
774 LVecBase4 color_scale(1.0f, 1.0f, 1.0f, 1.0f);
776 if (net_state->get_attrib(csa)) {
781 bool has_color_override =
false;
782 bool has_color_off =
false;
783 LColor color_override;
785 if (net_state->get_attrib(ca)) {
787 has_color_override =
true;
789 color_override.set(color_override[0] * color_scale[0],
790 color_override[1] * color_scale[1],
791 color_override[2] * color_scale[2],
792 color_override[3] * color_scale[3]);
795 has_color_off =
true;
802 if (net_state->get_attrib(ma)) {
804 if (egg_mat !=
nullptr) {
805 egg_prim->set_material(egg_mat);
811 if (net_state->get_attrib(ta)) {
816 if (egg_tex !=
nullptr) {
818 case TextureStage::M_modulate:
819 if (has_color_off ==
true && i == 0) {
820 egg_tex->set_env_type(EggTexture::ET_replace);
822 egg_tex->set_env_type(EggTexture::ET_modulate);
825 case TextureStage::M_decal:
826 egg_tex->set_env_type(EggTexture::ET_decal);
828 case TextureStage::M_blend:
829 egg_tex->set_env_type(EggTexture::ET_blend);
831 case TextureStage::M_replace:
832 egg_tex->set_env_type(EggTexture::ET_replace);
834 case TextureStage::M_add:
835 egg_tex->set_env_type(EggTexture::ET_add);
837 case TextureStage::M_blend_color_scale:
838 egg_tex->set_env_type(EggTexture::ET_blend_color_scale);
840 case TextureStage::M_modulate_glow:
841 egg_tex->set_env_type(EggTexture::ET_modulate_glow);
843 case TextureStage::M_modulate_gloss:
844 egg_tex->set_env_type(EggTexture::ET_modulate_gloss);
846 case TextureStage::M_normal:
847 egg_tex->set_env_type(EggTexture::ET_normal);
849 case TextureStage::M_normal_height:
850 egg_tex->set_env_type(EggTexture::ET_normal_height);
852 case TextureStage::M_glow:
853 egg_tex->set_env_type(EggTexture::ET_glow);
855 case TextureStage::M_gloss:
856 egg_tex->set_env_type(EggTexture::ET_gloss);
858 case TextureStage::M_height:
859 egg_tex->set_env_type(EggTexture::ET_height);
861 case TextureStage::M_selector:
862 egg_tex->set_env_type(EggTexture::ET_selector);
864 case TextureStage::M_normal_gloss:
865 egg_tex->set_env_type(EggTexture::ET_normal_gloss);
867 case TextureStage::M_emission:
868 egg_tex->set_env_type(EggTexture::ET_emission);
875 if (name !=
nullptr && name != InternalName::get_texcoord()) {
879 egg_prim->add_texture(egg_tex);
886 if (net_state->get_attrib(cfa)) {
888 egg_prim->set_bface_flag(
true);
894 if (net_state->get_attrib(rma)) {
895 if (egg_prim->is_of_type(EggPoint::get_class_type())) {
900 }
else if (egg_prim->is_of_type(EggLine::get_class_type())) {
911 for (
int i = 0; i < num_primitives; ++i) {
915 for (
int j = 0; j < num_vertices; j++) {
919 reader.set_row(primitive->
get_vertex(i * num_vertices + j));
921 reader.set_column(InternalName::get_vertex());
922 LVertex vertex = reader.get_data3();
923 egg_vert.
set_pos(LCAST(
double, vertex * net_mat));
925 if (vertex_data->
has_column(InternalName::get_normal())) {
926 reader.set_column(InternalName::get_normal());
927 LNormal normal = reader.get_data3();
928 egg_vert.set_normal(LCAST(
double, normal * net_mat));
930 if (has_color_override) {
931 egg_vert.set_color(color_override);
933 }
else if (!has_color_off) {
934 LColor color(1.0f, 1.0f, 1.0f, 1.0f);
935 if (vertex_data->
has_column(InternalName::get_color())) {
936 reader.set_column(InternalName::get_color());
937 color = reader.get_data4();
939 egg_vert.set_color(LColor(color[0] * color_scale[0],
940 color[1] * color_scale[1],
941 color[2] * color_scale[2],
942 color[3] * color_scale[3]));
947 reader.set_column(texcoord_name);
948 LTexCoord uv = reader.get_data2();
949 if (texcoord_name == InternalName::get_texcoord()) {
950 egg_vert.
set_uv(LCAST(
double, uv));
956 EggVertex *new_egg_vert = _vpool->create_unique_vertex(egg_vert);
958 if (vertex_data->
has_column(InternalName::get_transform_blend()) &&
959 joint_map !=
nullptr && transformBlendTable !=
nullptr) {
960 reader.set_column(InternalName::get_transform_blend());
961 int idx = reader.get_data1i();
964 for (
int k = 0; k < num_weights; ++k) {
968 if (vertex_transform->
is_of_type(JointVertexTransform::get_class_type())) {
971 CharacterJointMap::iterator mi = joint_map->find(joint_vertex_transform->
get_joint());
972 if (mi == joint_map->end()) {
973 mi = joint_map->insert(CharacterJointMap::value_type(joint_vertex_transform->
get_joint(),
pvector<pair<EggVertex*,PN_stdfloat> >())).first;
976 joint_vertices.push_back(pair<EggVertex*,PN_stdfloat>(new_egg_vert, weight));
982 egg_child->add_vertex(new_egg_vert);
992 bool has_decal, CharacterJointMap *joint_map) {
996 for (
int i = 0; i < num_children; i++) {
998 convert_node(
WorkingNodePath(node_path, child), egg_parent, has_decal, joint_map);
1007apply_node_properties(
EggGroup *egg_group,
PandaNode *node,
bool allow_backstage) {
1008 bool any_applied =
false;
1014 egg_group->add_object_type(
"backstage");
1017 if (node->has_tags()) {
1018 if (apply_tags(egg_group, node)) {
1023 if (node->
is_of_type(ModelNode::get_class_type())) {
1026 case ModelNode::PT_none:
1027 egg_group->set_model_flag(
true);
1030 case ModelNode::PT_drop_node:
1033 case ModelNode::PT_net:
1034 egg_group->set_dcs_type(EggGroup::DC_net);
1037 case ModelNode::PT_local:
1038 egg_group->set_dcs_type(EggGroup::DC_local);
1041 case ModelNode::PT_no_touch:
1042 egg_group->set_dcs_type(EggGroup::DC_no_touch);
1047 if (node->
is_of_type(UvScrollNode::get_class_type())) {
1049 egg_group->set_scroll_u(scroll_node->get_u_speed());
1050 egg_group->set_scroll_v(scroll_node->get_v_speed());
1051 egg_group->set_scroll_w(scroll_node->get_w_speed());
1052 egg_group->set_scroll_r(scroll_node->get_r_speed());
1057 if (effect !=
nullptr) {
1060 egg_group->set_billboard_type(EggGroup::BT_axis);
1064 egg_group->set_billboard_type(EggGroup::BT_point_camera_relative);
1068 egg_group->set_billboard_type(EggGroup::BT_point_world_relative);
1078 const LVecBase3 &scale = transform->
get_scale();
1079 const LQuaternion &quat = transform->
get_quat();
1080 const LVecBase3 &pos = transform->
get_pos();
1081 if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
1084 if (!quat.is_identity()) {
1087 if (!pos.almost_equal(LVecBase3::zero())) {
1091 }
else if (transform->
has_mat()) {
1093 const LMatrix4 &mat = transform->
get_mat();
1100 if (apply_state_properties(egg_group, state)) {
1117 bool any_applied =
false;
1121 if (state->get_attrib(tra)) {
1122 EggRenderMode::AlphaMode tex_trans = EggRenderMode::AM_unspecified;
1124 case TransparencyAttrib::M_none:
1125 tex_trans = EggRenderMode::AM_off;
1127 case TransparencyAttrib::M_alpha:
1128 tex_trans = EggRenderMode::AM_blend;
1130 case TransparencyAttrib::M_premultiplied_alpha:
1131 tex_trans = EggRenderMode::AM_premultiplied;
1133 case TransparencyAttrib::M_multisample:
1134 tex_trans = EggRenderMode::AM_ms;
1136 case TransparencyAttrib::M_multisample_mask:
1137 tex_trans = EggRenderMode::AM_ms_mask;
1139 case TransparencyAttrib::M_binary:
1140 tex_trans = EggRenderMode::AM_binary;
1142 case TransparencyAttrib::M_dual:
1143 tex_trans = EggRenderMode::AM_dual;
1152 if (state->get_attrib(dwa)) {
1153 if (dwa->
get_mode() != DepthWriteAttrib::M_off) {
1156 }
else if (egg_render_mode->
get_alpha_mode() == EggRenderMode::AM_blend) {
1158 egg_render_mode->
set_alpha_mode(EggRenderMode::AM_blend_no_occlude);
1167 if (state->get_attrib(dta)) {
1168 RenderAttrib::PandaCompareFunc mode = dta->
get_mode();
1169 if (mode == DepthTestAttrib::M_none || mode == DepthTestAttrib::M_always) {
1178 if (state->get_attrib(doa)) {
1184 if (state->get_attrib(cba)) {
1199 std::ostringstream strm;
1200 char delimiter =
'\n';
1201 string delimiter_str(1, delimiter);
1204 string data = strm.str();
1209 bool any_applied =
false;
1212 size_t q = data.find(delimiter);
1213 while (q != string::npos) {
1214 string tag = data.substr(p, q);
1215 if (apply_tag(egg_group, node, tag)) {
1219 q = data.find(delimiter, p);
1222 string tag = data.substr(p);
1223 if (apply_tag(egg_group, node, tag)) {
1235 if (!node->has_tag(tag)) {
1239 string value = node->get_tag(tag);
1240 egg_group->
set_tag(tag, value);
1249 if (mat !=
nullptr) {
1251 if (mat->has_base_color()) {
1252 temp.set_base(mat->get_base_color());
1255 if (mat->has_ambient()) {
1256 temp.set_amb(mat->get_ambient());
1259 if (mat->has_diffuse()) {
1260 temp.set_diff(mat->get_diffuse());
1263 if (mat->has_specular()) {
1264 temp.set_spec(mat->get_specular());
1267 if (mat->has_emission()) {
1268 temp.set_emit(mat->get_emission());
1271 if (mat->has_roughness()) {
1272 temp.set_roughness(mat->get_roughness());
1274 temp.set_shininess(mat->get_shininess());
1277 if (mat->has_metallic()) {
1278 temp.set_metallic(mat->get_metallic());
1281 if (mat->has_refractive_index()) {
1282 temp.set_ior(mat->get_refractive_index());
1285 temp.set_local(mat->get_local());
1297get_egg_texture(
Texture *tex) {
1298 if (tex !=
nullptr) {
1304 temp.set_alpha_filename(alpha);
1308 case SamplerState::FT_nearest:
1309 temp.set_minfilter(EggTexture::FT_nearest);
1311 case SamplerState::FT_linear:
1312 temp.set_minfilter(EggTexture::FT_linear);
1314 case SamplerState::FT_nearest_mipmap_nearest:
1315 temp.set_minfilter(EggTexture::FT_nearest_mipmap_nearest);
1317 case SamplerState::FT_linear_mipmap_nearest:
1318 temp.set_minfilter(EggTexture::FT_linear_mipmap_nearest);
1320 case SamplerState::FT_nearest_mipmap_linear:
1321 temp.set_minfilter(EggTexture::FT_nearest_mipmap_linear);
1323 case SamplerState::FT_linear_mipmap_linear:
1324 temp.set_minfilter(EggTexture::FT_linear_mipmap_linear);
1332 case SamplerState::FT_nearest:
1333 temp.set_magfilter(EggTexture::FT_nearest);
1335 case SamplerState::FT_linear:
1336 temp.set_magfilter(EggTexture::FT_linear);
1344 case SamplerState::WM_clamp:
1345 temp.set_wrap_u(EggTexture::WM_clamp);
1347 case SamplerState::WM_repeat:
1348 temp.set_wrap_u(EggTexture::WM_repeat);
1358 case SamplerState::WM_clamp:
1359 temp.set_wrap_v(EggTexture::WM_clamp);
1361 case SamplerState::WM_repeat:
1362 temp.set_wrap_v(EggTexture::WM_repeat);
1372 case Texture::F_red:
1373 temp.set_format(EggTexture::F_red);
1375 case Texture::F_green:
1376 temp.set_format(EggTexture::F_green);
1378 case Texture::F_blue:
1379 temp.set_format(EggTexture::F_blue);
1381 case Texture::F_alpha:
1382 temp.set_format(EggTexture::F_alpha);
1384 case Texture::F_rgb:
1385 temp.set_format(EggTexture::F_rgb);
1387 case Texture::F_rgb5:
1388 temp.set_format(EggTexture::F_rgb5);
1390 case Texture::F_rgb8:
1391 temp.set_format(EggTexture::F_rgb8);
1393 case Texture::F_rgb12:
1394 temp.set_format(EggTexture::F_rgb12);
1396 case Texture::F_rgb332:
1397 temp.set_format(EggTexture::F_rgb332);
1399 case Texture::F_rgba:
1400 temp.set_format(EggTexture::F_rgba);
1402 case Texture::F_rgbm:
1403 temp.set_format(EggTexture::F_rgbm);
1405 case Texture::F_rgba4:
1406 temp.set_format(EggTexture::F_rgba4);
1408 case Texture::F_rgba5:
1409 temp.set_format(EggTexture::F_rgba5);
1411 case Texture::F_rgba8:
1412 temp.set_format(EggTexture::F_rgba8);
1414 case Texture::F_rgba12:
1415 temp.set_format(EggTexture::F_rgba12);
1417 case Texture::F_luminance:
1418 temp.set_format(EggTexture::F_luminance);
1420 case Texture::F_luminance_alpha:
1421 temp.set_format(EggTexture::F_luminance_alpha);
1423 case Texture::F_luminance_alphamask:
1424 temp.set_format(EggTexture::F_luminance_alphamask);
1426 case Texture::F_srgb:
1427 temp.set_format(EggTexture::F_srgb);
1429 case Texture::F_srgb_alpha:
1430 temp.set_format(EggTexture::F_srgb_alpha);
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a node that contains a pointer to an AnimBundle.
This is the root of an AnimChannel hierarchy.
get_base_frame_rate
Returns the ideal number of frames per second of the animation, when it is running at normal speed.
An animation channel that issues a matrix each frame, read from a table such as might have been read ...
has_table
Returns true if the indicated subtable has been assigned.
get_table
Returns a pointer to the indicated subtable's data, if it exists, or NULL if it does not.
This is the base class for AnimChannel and AnimBundle.
get_child
Returns the nth child of the group.
get_num_children
Returns the number of child nodes of the group.
Indicates that geometry at this node should automatically rotate to face the camera,...
bool get_eye_relative() const
Returns true if this billboard interprets the up vector relative to the camera, or false if it is rel...
bool get_axial_rotate() const
Returns true if this billboard rotates only around the axis of the up vector, or false if it rotates ...
This represents one joint of the character's animation, containing an animating transform matrix.
An animated character, with skeleton-morph animation and either soft- skinned or hard-skinned vertice...
A cuboid collision volume or object.
This implements a solid consisting of a cylinder with hemispherical endcaps, also known as a capsule ...
A node in the scene graph that can hold any number of CollisionSolids.
get_into_collide_mask
Returns the current "into" CollideMask.
get_from_collide_mask
Returns the current "from" CollideMask.
get_default_collide_mask
Returns the default into_collide_mask assigned to new CollisionNodes.
The abstract base class for all things that can collide with other things in the world,...
A spherical collision volume or object.
Indicates what color should be applied to renderable geometry.
get_color
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
get_color_type
Returns the type of color specified by this ColorAttrib.
Applies a scale to colors in the scene graph and on vertices.
get_scale
Returns the scale to be applied to colors.
Similar to PointerToArray, except that its contents may not be modified.
Assigns geometry to a particular bin by name.
get_draw_order
Returns the draw order this attribute specifies.
get_bin_name
Returns the name of the bin this attribute specifies.
Indicates which faces should be culled based on their vertex ordering.
get_effective_mode
Returns the effective culling mode.
This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to ...
get_offset
Returns the depth offset represented by this attrib.
Enables or disables writing to the depth buffer.
get_mode
Returns the depth write mode.
Enables or disables writing to the depth buffer.
get_mode
Returns the depth write mode.
This is the primary interface into all the egg data, and the root of the egg file structure.
A base class for nodes in the hierarchy that are not leaf nodes.
EggNode * add_child(EggNode *node)
Adds the indicated child to the group and returns it.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
void set_vertex_membership(EggVertex *vert, double membership)
Explicitly sets the net membership of the indicated vertex in this group to the given value.
void set_tag(const std::string &key, const std::string &value)
Associates a user-defined value with a user-defined key which is stored on the node.
set_default_pose
Replaces the initial pose transform.
A line segment, or a series of connected line segments, defined by a <Line> entry.
EggMaterial * create_unique_material(const EggMaterial ©, int eq)
Creates a new material if there is not already one equivalent (according to eq, see EggMaterial::is_e...
A base class for things that may be directly added into the egg hierarchy.
const LMatrix4d & get_vertex_frame_inv() const
Returns the inverse of the matrix returned by get_vertex_frame().
A single "patch", a special primitive to be rendered only with a tessellation shader.
A single point, or a collection of points as defined by a single <PointLight> entry.
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
EggVertex * add_vertex(EggVertex *vertex)
Adds the indicated vertex to the end of the primitive's list of vertices, and returns it.
This class stores miscellaneous rendering properties that is associated with geometry,...
void set_draw_order(int order)
Sets the "draw-order" flag associated with this object.
void set_depth_write_mode(DepthWriteMode mode)
Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides ...
void set_alpha_mode(AlphaMode mode)
Specifies precisely how the transparency for this geometry should be achieved, or if it should be use...
void set_depth_test_mode(DepthTestMode mode)
Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming ...
void set_bin(const std::string &bin)
Sets the "bin" string for this particular object.
AlphaMode get_alpha_mode() const
Returns the alpha mode that was set, or AM_unspecified if nothing was set.
void set_depth_offset(int bias)
Sets the "depth-offset" flag associated with this object.
void add_node(PandaNode *node)
Adds the scene graph rooted at the indicated node to the accumulated egg data within this object.
void add_subgraph(PandaNode *root)
Adds the scene graph rooted at the indicated node (but without the node itself) to the accumulated eg...
A SwitchCondition that switches the levels-of-detail based on distance from the camera's eyepoint.
EggTexture * create_unique_texture(const EggTexture ©, int eq)
Creates a new texture if there is not already one equivalent (according to eq, see EggTexture::is_equ...
Defines a texture map that may be applied to geometry.
set_uv_name
Specifies the named set of texture coordinates that this texture will use when it is applied to geome...
A collection of vertices.
EggVertex * create_unique_vertex(const EggVertex ©)
Creates a new vertex in the pool that is a copy of the indicated one and returns it.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
void set_pos(double pos)
Sets the vertex position.
void set_uv(const LTexCoordd &texCoord)
Replaces the unnamed UV coordinate pair on the vertex with the indicated value.
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine entries that specify...
void add_component_data(const std::string &component_name, double value)
Adds a new row to the named component (one of matrix_component_letters) of the table.
The name of a file, such as a texture file or an Egg file.
std::string get_basename_wo_extension() const
Returns the basename part of the filename, without the file extension.
A node that holds Geom objects, renderable pieces of geometry.
get_num_geoms
Returns the number of geoms in the node.
get_geom_state
Returns the RenderState associated with the nth geom of the node.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
int get_num_primitives() const
Returns the number of individual primitives stored within this object.
get_vertex
Returns the ith vertex index in the table.
get_num_vertices_per_primitive
If the primitive type is a simple type in which all primitives have the same number of vertices,...
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
bool has_column(const InternalName *name) const
Returns true if the data has the named column, false otherwise.
get_format
Returns a pointer to the GeomVertexFormat structure that defines this data.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
A container for geometry primitives.
Encodes a string name in a hash table, mapping it to a pointer.
get_basename
Return the name represented by just this particular InternalName object, ignoring its parents names.
get_out
Returns the "out" distance of the indicated switch range.
get_in
Returns the "in" distance of the indicated switch range.
get_center
Returns the center of the LOD.
get_num_switches
Returns the number of switch ranges added to the LODNode.
Indicates which, if any, material should be applied to geometry.
get_material
If the MaterialAttrib is not an 'off' MaterialAttrib, returns the material that is associated.
Defines the way an object appears in the presence of lighting.
This node is placed at key points within the scene graph to indicate the roots of "models": subtrees ...
PreserveTransform get_preserve_transform() const
Returns the current setting of the preserve_transform flag.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
A basic node of the scene graph or data graph.
virtual bool is_geom_node() const
A simple downcast check.
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
get_child
Returns the nth child node of this node.
void list_tags(std::ostream &out, const std::string &separator="\n") const
Writes a list of all the tag keys assigned to the node to the indicated stream.
get_num_children
Returns the number of child nodes this node has.
This is the root of a MovingPart hierarchy.
This is the base class for PartRoot and MovingPart.
get_num_children
Returns the number of child nodes of the group.
get_child
Returns the nth child of the group.
This is the base class for a number of special render effects that may be set on scene graph nodes to...
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
const RenderEffect * get_effect(size_t n) const
Returns the nth effect in the state.
Specifies how polygons are to be drawn.
get_perspective
Returns the perspective flag.
get_thickness
Returns the line width or point thickness.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
bool is_empty() const
Returns true if the state is empty, false otherwise.
A node that automatically cycles through rendering each one of its children according to its frame ra...
A node that renders only one of its children, according to the user's indication.
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
get_num_on_stages
Returns the number of stages that are turned on by the attribute.
get_on_texture
Returns the texture associated with the indicated stage, or NULL if no texture is associated.
get_on_stage
Returns the nth stage turned on by the attribute, sorted in render order.
Defines the properties of a named stage of the multitexture pipeline.
get_mode
Return the mode of this stage.
get_texcoord_name
See set_texcoord_name.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
get_format
Returns the format of the texture, which represents both the semantic meaning of the texels and,...
get_minfilter
Returns the filter mode of the texture for minification.
has_filename
Returns true if the filename has been set and is available.
get_filename
Returns the filename that has been set.
get_alpha_filename
Returns the alpha_filename that has been set.
get_magfilter
Returns the filter mode of the texture for magnification.
has_alpha_filename
Returns true if the alpha_filename has been set and is available.
get_wrap_u
Returns the wrap mode of the texture in the U direction.
get_wrap_v
Returns the wrap mode of the texture in the V direction.
This controls the enabling of transparency.
get_mode
Returns the transparency mode.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
This is a class designed to support low-overhead traversals of the complete scene graph,...
PandaNode * node() const
Returns the node traversed to so far.
get_node_path
Constructs and returns an actual NodePath that represents the same path we have just traversed.
This is our own Panda specialization on the default STL vector.
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.
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.
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.
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.
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.
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.
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.