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);
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);
347 convert_character_bundle(
PartGroup *bundleNode,
EggGroupNode *egg_parent, CharacterJointMap *joint_map) {
351 if (bundleNode->
is_of_type(CharacterJoint::get_class_type())) {
356 LMatrix4d transformd(LCAST(
double, transformf));
359 joint->set_group_type(EggGroup::GT_joint);
362 if (joint_map !=
nullptr) {
363 CharacterJointMap::iterator mi = joint_map->find(character_joint);
364 if (mi != joint_map->end()) {
367 for (vi = joint_vertices.begin(); vi != joint_vertices.end(); ++vi) {
374 for (
int i = 0; i < num_children ; i++) {
376 convert_character_bundle(partGroup, joint_group, joint_map);
394 egg_group->set_dart_type(EggGroup::DT_structured);
396 apply_node_properties(egg_group, node);
398 CharacterJointMap joint_map;
399 recurse_nodes(node_path, egg_group, has_decal, &joint_map);
403 int num_bundles = node->get_num_bundles();
404 for (
int i = 0; i < num_bundles; ++i) {
406 convert_character_bundle(bundle, egg_group, &joint_map);
417 CharacterJointMap *joint_map) {
422 apply_node_properties(egg_group, node,
false);
427 if (from_mask != CollisionNode::get_default_collide_mask() ||
428 into_mask != CollisionNode::get_default_collide_mask()) {
429 if (from_mask == into_mask) {
430 egg_group->set_collide_mask(into_mask);
432 egg_group->set_from_collide_mask(from_mask);
433 egg_group->set_into_collide_mask(into_mask);
438 egg_group->set_collide_flags(EggGroup::CF_descend);
442 LMatrix4 net_mat = net_transform->
get_mat();
444 net_mat = net_mat * inv;
446 int num_solids = node->get_num_solids();
448 if (num_solids > 0) {
454 for (
int i = 0; i < num_solids; i++) {
456 int flags = EggGroup::CF_descend;
458 if (!child->is_tangible()) {
459 flags |= EggGroup::CF_intangible;
462 if (child->has_effective_normal() &&
463 child->get_effective_normal() == LVector3::up()) {
464 flags |= EggGroup::CF_level;
467 if (child->
is_of_type(CollisionPolygon::get_class_type())) {
468 egg_group->set_cs_type(EggGroup::CST_polyset);
469 egg_group->set_collide_flags(flags);
475 int num_points = poly->get_num_points();
476 for (
int j = 0; j < num_points; j++) {
478 egg_vert.
set_pos(LCAST(
double, poly->get_point(j) * net_mat));
479 egg_vert.set_normal(LCAST(
double, poly->get_normal() * net_mat));
485 }
else if (child->
is_of_type(CollisionSphere::get_class_type())) {
487 LPoint3 center = sphere->get_center();
488 PN_stdfloat radius = sphere->get_radius();
491 if (num_solids == 1) {
492 egg_sphere = egg_group;
498 if (child->
is_of_type(CollisionInvSphere::get_class_type())) {
499 egg_sphere->set_cs_type(EggGroup::CST_inv_sphere);
501 egg_sphere->set_cs_type(EggGroup::CST_sphere);
503 egg_sphere->set_collide_flags(flags);
506 ev1.
set_pos(LCAST(
double, (center + LVector3(radius, 0, 0)) * net_mat));
507 ev2.
set_pos(LCAST(
double, (center + LVector3(0, radius, 0)) * net_mat));
508 ev3.
set_pos(LCAST(
double, (center + LVector3(-radius, 0, 0)) * net_mat));
509 ev4.
set_pos(LCAST(
double, (center + LVector3(0, -radius, 0)) * net_mat));
519 }
else if (child->
is_of_type(CollisionPlane::get_class_type())) {
521 LPoint3 origin = plane.get_point();
522 LVector3 normal = plane.get_normal();
527 if (std::fabs(normal[2]) > std::fabs(normal[1])) {
528 vec1 = normal.cross(LVector3(0, 1, 0));
530 vec1 = normal.cross(LVector3(0, 0, 1));
534 LVector3 vec2 = normal.cross(vec1);
537 if (num_solids == 1) {
538 egg_plane = egg_group;
543 egg_plane->set_cs_type(EggGroup::CST_plane);
544 egg_plane->set_collide_flags(flags);
547 ev0.
set_pos(LCAST(
double, origin * net_mat));
548 ev1.
set_pos(LCAST(
double, (origin + vec1) * net_mat));
549 ev2.
set_pos(LCAST(
double, (origin + vec2) * net_mat));
558 }
else if (child->
is_of_type(CollisionBox::get_class_type())) {
560 LPoint3 min_point = box->get_min();
561 LPoint3 max_point = box->get_max();
564 if (num_solids == 1) {
570 egg_box->set_cs_type(EggGroup::CST_box);
571 egg_box->set_collide_flags(flags);
575 ev0.
set_pos(LCAST(
double, min_point * net_mat));
576 ev1.
set_pos(LCAST(
double, max_point * net_mat));
584 }
else if (child->
is_of_type(CollisionCapsule::get_class_type())) {
586 LPoint3 point_a = capsule->get_point_a();
587 LPoint3 point_b = capsule->get_point_b();
588 LPoint3 centroid = (point_a + point_b) * 0.5f;
591 LVector3 axis = point_b - point_a;
593 if (std::fabs(axis[2]) > std::fabs(axis[1])) {
594 sideways = axis.cross(LVector3(0, 1, 0));
596 sideways = axis.cross(LVector3(0, 0, 1));
598 sideways.normalize();
599 sideways *= capsule->get_radius();
600 LVector3 extend = axis.normalized() * capsule->get_radius();
603 if (num_solids == 1) {
604 egg_capsule = egg_group;
609 egg_capsule->set_cs_type(EggGroup::CST_tube);
610 egg_capsule->set_collide_flags(flags);
615 ev0.
set_pos(LCAST(
double, (point_a - extend) * net_mat));
616 ev1.
set_pos(LCAST(
double, (centroid + sideways) * net_mat));
617 ev2.
set_pos(LCAST(
double, (point_b + extend) * net_mat));
618 ev3.
set_pos(LCAST(
double, (centroid - sideways) * net_mat));
629 nout <<
"Encountered unknown collision solid type " << child->get_type() <<
"\n";
635 recurse_nodes(node_path, egg_group, has_decal, joint_map);
643 EggGroupNode *egg_parent,
bool has_decal, CharacterJointMap *joint_map) {
645 bool fancy_attributes = apply_node_properties(egg_group, node);
647 if (node->get_effects()->has_decal()) {
652 egg_group->set_decal_flag(
true);
655 if (fancy_attributes || has_decal || !node->get_name().empty()) {
660 egg_parent = egg_group;
666 LMatrix4 net_mat = net_transform->
get_mat();
668 net_mat = net_mat * inv;
672 for (
int i = 0; i < num_geoms; ++i) {
674 CPT(
RenderState) geom_net_state = net_state->compose(geom_state);
679 if (num_geoms == 1 && node->
get_num_children() == 0 && egg_parent == egg_group &&
680 !geom_state->is_empty() && node->get_state()->is_empty()) {
681 apply_state_properties(egg_group, geom_state);
682 geom_state = RenderState::make_empty();
685 const Geom *geom = node->get_geom(i);
686 int num_primitives = geom->get_num_primitives();
687 for (
int j = 0; j < num_primitives; ++j) {
692 convert_primitive(vdata, simple, geom_state, geom_net_state,
693 net_mat, egg_parent, joint_map);
697 recurse_nodes(node_path, egg_parent, has_decal, joint_map);
708 CharacterJointMap *joint_map) {
713 if (primitive->
is_of_type(GeomTriangles::get_class_type())) {
715 }
else if (primitive->
is_of_type(GeomPatches::get_class_type())) {
717 }
else if (primitive->
is_of_type(GeomPoints::get_class_type())) {
719 }
else if (primitive->
is_of_type(GeomLines::get_class_type())) {
727 apply_state_properties(egg_prim, geom_state);
730 LVecBase4 color_scale(1.0f, 1.0f, 1.0f, 1.0f);
732 if (net_state->get_attrib(csa)) {
737 bool has_color_override =
false;
738 bool has_color_off =
false;
739 LColor color_override;
741 if (net_state->get_attrib(ca)) {
743 has_color_override =
true;
745 color_override.set(color_override[0] * color_scale[0],
746 color_override[1] * color_scale[1],
747 color_override[2] * color_scale[2],
748 color_override[3] * color_scale[3]);
751 has_color_off =
true;
758 if (net_state->get_attrib(ma)) {
760 if (egg_mat !=
nullptr) {
761 egg_prim->set_material(egg_mat);
767 if (net_state->get_attrib(ta)) {
770 if (egg_tex !=
nullptr) {
772 if (tex_stage !=
nullptr) {
774 case TextureStage::M_modulate:
775 if (has_color_off ==
true) {
776 egg_tex->set_env_type(EggTexture::ET_replace);
778 egg_tex->set_env_type(EggTexture::ET_modulate);
781 case TextureStage::M_decal:
782 egg_tex->set_env_type(EggTexture::ET_decal);
784 case TextureStage::M_blend:
785 egg_tex->set_env_type(EggTexture::ET_blend);
787 case TextureStage::M_replace:
788 egg_tex->set_env_type(EggTexture::ET_replace);
790 case TextureStage::M_add:
791 egg_tex->set_env_type(EggTexture::ET_add);
793 case TextureStage::M_blend_color_scale:
794 egg_tex->set_env_type(EggTexture::ET_blend_color_scale);
801 egg_prim->set_texture(egg_tex);
807 if (net_state->get_attrib(cfa)) {
809 egg_prim->set_bface_flag(
true);
815 if (net_state->get_attrib(rma)) {
816 if (egg_prim->is_of_type(EggPoint::get_class_type())) {
821 }
else if (egg_prim->is_of_type(EggLine::get_class_type())) {
832 for (
int i = 0; i < num_primitives; ++i) {
836 for (
int j = 0; j < num_vertices; j++) {
840 reader.set_row(primitive->
get_vertex(i * num_vertices + j));
842 reader.set_column(InternalName::get_vertex());
843 LVertex vertex = reader.get_data3();
844 egg_vert.
set_pos(LCAST(
double, vertex * net_mat));
846 if (vertex_data->
has_column(InternalName::get_normal())) {
847 reader.set_column(InternalName::get_normal());
848 LNormal normal = reader.get_data3();
849 egg_vert.set_normal(LCAST(
double, normal * net_mat));
851 if (has_color_override) {
852 egg_vert.set_color(color_override);
854 }
else if (!has_color_off) {
855 LColor color(1.0f, 1.0f, 1.0f, 1.0f);
856 if (vertex_data->
has_column(InternalName::get_color())) {
857 reader.set_column(InternalName::get_color());
858 color = reader.get_data4();
860 egg_vert.set_color(LColor(color[0] * color_scale[0],
861 color[1] * color_scale[1],
862 color[2] * color_scale[2],
863 color[3] * color_scale[3]));
866 if (vertex_data->
has_column(InternalName::get_texcoord())) {
867 reader.set_column(InternalName::get_texcoord());
868 LTexCoord uv = reader.get_data2();
869 egg_vert.
set_uv(LCAST(
double, uv));
872 EggVertex *new_egg_vert = _vpool->create_unique_vertex(egg_vert);
874 if (vertex_data->
has_column(InternalName::get_transform_blend()) &&
875 joint_map !=
nullptr && transformBlendTable !=
nullptr) {
876 reader.set_column(InternalName::get_transform_blend());
877 int idx = reader.get_data1i();
880 for (
int k = 0; k < num_weights; ++k) {
884 if (vertex_transform->
is_of_type(JointVertexTransform::get_class_type())) {
887 CharacterJointMap::iterator mi = joint_map->find(joint_vertex_transform->
get_joint());
888 if (mi == joint_map->end()) {
892 joint_vertices.push_back(pair<EggVertex*,PN_stdfloat>(new_egg_vert, weight));
898 egg_child->add_vertex(new_egg_vert);
908 bool has_decal, CharacterJointMap *joint_map) {
912 for (
int i = 0; i < num_children; i++) {
914 convert_node(
WorkingNodePath(node_path, child), egg_parent, has_decal, joint_map);
923 apply_node_properties(
EggGroup *egg_group,
PandaNode *node,
bool allow_backstage) {
924 bool any_applied =
false;
930 egg_group->add_object_type(
"backstage");
933 if (node->has_tags()) {
934 if (apply_tags(egg_group, node)) {
939 if (node->
is_of_type(ModelNode::get_class_type())) {
942 case ModelNode::PT_none:
943 egg_group->set_model_flag(
true);
946 case ModelNode::PT_drop_node:
949 case ModelNode::PT_net:
950 egg_group->set_dcs_type(EggGroup::DC_net);
953 case ModelNode::PT_local:
954 egg_group->set_dcs_type(EggGroup::DC_local);
957 case ModelNode::PT_no_touch:
958 egg_group->set_dcs_type(EggGroup::DC_no_touch);
963 if (node->
is_of_type(UvScrollNode::get_class_type())) {
965 egg_group->set_scroll_u(scroll_node->get_u_speed());
966 egg_group->set_scroll_v(scroll_node->get_v_speed());
967 egg_group->set_scroll_w(scroll_node->get_w_speed());
968 egg_group->set_scroll_r(scroll_node->get_r_speed());
973 if (effect !=
nullptr) {
976 egg_group->set_billboard_type(EggGroup::BT_axis);
980 egg_group->set_billboard_type(EggGroup::BT_point_camera_relative);
984 egg_group->set_billboard_type(EggGroup::BT_point_world_relative);
994 const LVecBase3 &scale = transform->
get_scale();
995 const LQuaternion &quat = transform->
get_quat();
996 const LVecBase3 &pos = transform->
get_pos();
997 if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
1000 if (!quat.is_identity()) {
1003 if (!pos.almost_equal(LVecBase3::zero())) {
1007 }
else if (transform->
has_mat()) {
1009 const LMatrix4 &mat = transform->
get_mat();
1016 if (apply_state_properties(egg_group, state)) {
1033 bool any_applied =
false;
1037 if (state->get_attrib(tra)) {
1038 EggRenderMode::AlphaMode tex_trans = EggRenderMode::AM_unspecified;
1040 case TransparencyAttrib::M_none:
1041 tex_trans = EggRenderMode::AM_off;
1043 case TransparencyAttrib::M_alpha:
1044 tex_trans = EggRenderMode::AM_blend;
1046 case TransparencyAttrib::M_premultiplied_alpha:
1047 tex_trans = EggRenderMode::AM_premultiplied;
1049 case TransparencyAttrib::M_multisample:
1050 tex_trans = EggRenderMode::AM_ms;
1052 case TransparencyAttrib::M_multisample_mask:
1053 tex_trans = EggRenderMode::AM_ms_mask;
1055 case TransparencyAttrib::M_binary:
1056 tex_trans = EggRenderMode::AM_binary;
1058 case TransparencyAttrib::M_dual:
1059 tex_trans = EggRenderMode::AM_dual;
1068 if (state->get_attrib(dwa)) {
1069 if (dwa->
get_mode() != DepthWriteAttrib::M_off) {
1072 }
else if (egg_render_mode->
get_alpha_mode() == EggRenderMode::AM_blend) {
1074 egg_render_mode->
set_alpha_mode(EggRenderMode::AM_blend_no_occlude);
1083 if (state->get_attrib(dta)) {
1084 RenderAttrib::PandaCompareFunc mode = dta->
get_mode();
1085 if (mode == DepthTestAttrib::M_none || mode == DepthTestAttrib::M_always) {
1094 if (state->get_attrib(doa)) {
1100 if (state->get_attrib(cba)) {
1115 std::ostringstream strm;
1116 char delimiter =
'\n';
1117 string delimiter_str(1, delimiter);
1120 string data = strm.str();
1125 bool any_applied =
false;
1128 size_t q = data.find(delimiter);
1129 while (q != string::npos) {
1130 string tag = data.substr(p, q);
1131 if (apply_tag(egg_group, node, tag)) {
1135 q = data.find(delimiter, p);
1138 string tag = data.substr(p);
1139 if (apply_tag(egg_group, node, tag)) {
1151 if (!node->has_tag(tag)) {
1155 string value = node->get_tag(tag);
1156 egg_group->
set_tag(tag, value);
1165 if (mat !=
nullptr) {
1167 if (mat->has_base_color()) {
1168 temp.
set_base(mat->get_base_color());
1171 if (mat->has_ambient()) {
1172 temp.set_amb(mat->get_ambient());
1175 if (mat->has_diffuse()) {
1176 temp.set_diff(mat->get_diffuse());
1179 if (mat->has_specular()) {
1180 temp.set_spec(mat->get_specular());
1183 if (mat->has_emission()) {
1184 temp.set_emit(mat->get_emission());
1187 if (mat->has_roughness()) {
1188 temp.set_roughness(mat->get_roughness());
1190 temp.set_shininess(mat->get_shininess());
1193 if (mat->has_metallic()) {
1194 temp.set_metallic(mat->get_metallic());
1197 if (mat->has_refractive_index()) {
1198 temp.set_ior(mat->get_refractive_index());
1201 temp.set_local(mat->get_local());
1213 get_egg_texture(
Texture *tex) {
1214 if (tex !=
nullptr) {
1220 temp.set_alpha_filename(alpha);
1224 case SamplerState::FT_nearest:
1225 temp.set_minfilter(EggTexture::FT_nearest);
1227 case SamplerState::FT_linear:
1228 temp.set_minfilter(EggTexture::FT_linear);
1230 case SamplerState::FT_nearest_mipmap_nearest:
1231 temp.set_minfilter(EggTexture::FT_nearest_mipmap_nearest);
1233 case SamplerState::FT_linear_mipmap_nearest:
1234 temp.set_minfilter(EggTexture::FT_linear_mipmap_nearest);
1236 case SamplerState::FT_nearest_mipmap_linear:
1237 temp.set_minfilter(EggTexture::FT_nearest_mipmap_linear);
1239 case SamplerState::FT_linear_mipmap_linear:
1240 temp.set_minfilter(EggTexture::FT_linear_mipmap_linear);
1248 case SamplerState::FT_nearest:
1249 temp.set_magfilter(EggTexture::FT_nearest);
1251 case SamplerState::FT_linear:
1252 temp.set_magfilter(EggTexture::FT_linear);
1260 case SamplerState::WM_clamp:
1261 temp.set_wrap_u(EggTexture::WM_clamp);
1263 case SamplerState::WM_repeat:
1264 temp.set_wrap_u(EggTexture::WM_repeat);
1274 case SamplerState::WM_clamp:
1275 temp.set_wrap_v(EggTexture::WM_clamp);
1277 case SamplerState::WM_repeat:
1278 temp.set_wrap_v(EggTexture::WM_repeat);
1288 case Texture::F_red:
1289 temp.set_format(EggTexture::F_red);
1291 case Texture::F_green:
1292 temp.set_format(EggTexture::F_green);
1294 case Texture::F_blue:
1295 temp.set_format(EggTexture::F_blue);
1297 case Texture::F_alpha:
1298 temp.set_format(EggTexture::F_alpha);
1300 case Texture::F_rgb:
1301 temp.set_format(EggTexture::F_rgb);
1303 case Texture::F_rgb5:
1304 temp.set_format(EggTexture::F_rgb5);
1306 case Texture::F_rgb8:
1307 temp.set_format(EggTexture::F_rgb8);
1309 case Texture::F_rgb12:
1310 temp.set_format(EggTexture::F_rgb12);
1312 case Texture::F_rgb332:
1313 temp.set_format(EggTexture::F_rgb332);
1315 case Texture::F_rgba:
1316 temp.set_format(EggTexture::F_rgba);
1318 case Texture::F_rgbm:
1319 temp.set_format(EggTexture::F_rgbm);
1321 case Texture::F_rgba4:
1322 temp.set_format(EggTexture::F_rgba4);
1324 case Texture::F_rgba5:
1325 temp.set_format(EggTexture::F_rgba5);
1327 case Texture::F_rgba8:
1328 temp.set_format(EggTexture::F_rgba8);
1330 case Texture::F_rgba12:
1331 temp.set_format(EggTexture::F_rgba12);
1333 case Texture::F_luminance:
1334 temp.set_format(EggTexture::F_luminance);
1336 case Texture::F_luminance_alpha:
1337 temp.set_format(EggTexture::F_luminance_alpha);
1339 case Texture::F_luminance_alphamask:
1340 temp.set_format(EggTexture::F_luminance_alphamask);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
bool is_empty() const
Returns true if the state is empty, false otherwise.
get_geom_state
Returns the RenderState associated with the nth geom of the node.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AlphaMode get_alpha_mode() const
Returns the alpha mode that was set, or AM_unspecified if nothing was set.
get_filename
Returns the filename that has been set.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
PandaNode * node() const
Returns the node traversed to so far.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_depth_test_mode(DepthTestMode mode)
Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming ...
get_magfilter
Returns the filter mode of the texture for magnification.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_mode
Returns the transparency mode.
Enables or disables writing to the depth buffer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
A line segment, or a series of connected line segments, defined by a <Line> entry.
get_wrap_v
Returns the wrap mode of the texture in the V direction.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_axial_rotate() const
Returns true if this billboard rotates only around the axis of the up vector, or false if it rotates ...
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.
An animated character, with skeleton-morph animation and either soft- skinned or hard-skinned vertice...
Indicates which, if any, material should be applied to geometry.
void set_pos(double pos)
Sets the vertex position.
Enables or disables writing to the depth buffer.
This is the root of an AnimChannel hierarchy.
A base class for nodes in the hierarchy that are not leaf nodes.
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.
The abstract base class for all things that can collide with other things in the world,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_on_stage
Returns the nth stage turned on by the attribute, sorted in render order.
get_vertex
Returns the ith vertex index in the table.
void set_depth_write_mode(DepthWriteMode mode)
Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides ...
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This controls the enabling of transparency.
Defines a texture map that may be applied to geometry.
has_table
Returns true if the indicated subtable has been assigned.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::string get_basename_wo_extension() const
Returns the basename part of the filename, without the file extension.
A cuboid collision volume or object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_bin_name
Returns the name of the bin this attribute specifies.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
get_color
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
A node that automatically cycles through rendering each one of its children according to its frame ra...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class for a number of special render effects that may be set on scene graph nodes to...
PreserveTransform get_preserve_transform() const
Returns the current setting of the preserve_transform flag.
A spherical collision volume or object.
get_num_children
Returns the number of child nodes of the group.
This is the primary interface into all the egg data, and the root of the egg file structure.
Indicates that geometry at this node should automatically rotate to face the camera,...
This is a class designed to support low-overhead traversals of the complete scene graph,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_depth_offset(int bias)
Sets the "depth-offset" flag associated with this object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_mode
Returns the depth write mode.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single point, or a collection of points as defined by a single <PointLight> entry.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_num_children
Returns the number of child nodes of the group.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_minfilter
Returns the filter mode of the texture for minification.
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
get_num_switches
Returns the number of switch ranges added to the LODNode.
Indicates which faces should be culled based on their vertex ordering.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
has_alpha_filename
Returns true if the alpha_filename has been set and is available.
void set_bin(const std::string &bin)
Sets the "bin" string for this particular object.
get_mode
Return the mode of this stage.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_scale
Returns the scale to be applied to colors.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
get_format
Returns the format of the texture, which represents both the semantic meaning of the texels and,...
This class stores miscellaneous rendering properties that is associated with geometry,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_num_children
Returns the number of child nodes this node has.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_base_frame_rate
Returns the ideal number of frames per second of the animation, when it is running at normal speed.
get_offset
Returns the depth offset represented by this attrib.
get_from_collide_mask
Returns the current "from" CollideMask.
This is the base class for AnimChannel and AnimBundle.
This node is placed at key points within the scene graph to indicate the roots of "models": subtrees ...
has_filename
Returns true if the filename has been set and is available.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
A single "patch", a special primitive to be rendered only with a tessellation shader.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_child
Returns the nth child of the group.
get_into_collide_mask
Returns the current "into" CollideMask.
get_node_path
Constructs and returns an actual NodePath that represents the same path we have just traversed.
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that...
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_draw_order(int order)
Sets the "draw-order" flag associated with this object.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
void add_subgraph(PandaNode *root)
Adds the scene graph rooted at the indicated node (but without the node itself) to the accumulated eg...
This implements a solid consisting of a cylinder with hemispherical endcaps, also known as a capsule ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A container for geometry primitives.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Texture * get_texture() const
If the TextureAttrib is not an 'off' TextureAttrib, returns the base-level texture that is associated...
void set_alpha_mode(AlphaMode mode)
Specifies precisely how the transparency for this geometry should be achieved, or if it should be use...
const RenderEffect * get_effect(size_t n) const
Returns the nth effect in the state.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_mode
Returns the depth write mode.
Defines the way an object appears in the presence of lighting.
Applies a scale to colors in the scene graph and on vertices.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Assigns geometry to a particular bin by name.
get_table
Returns a pointer to the indicated subtable's data, if it exists, or NULL if it does not.
get_wrap_u
Returns the wrap mode of the texture in the U direction.
get_material
If the MaterialAttrib is not an 'off' MaterialAttrib, returns the material that is associated.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_in
Returns the "in" distance of the indicated switch range.
get_effective_mode
Returns the effective culling mode.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
EggNode * add_child(EggNode *node)
Adds the indicated child to the group and returns it.
int get_num_primitives() const
Returns the number of individual primitives stored within this object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_eye_relative() const
Returns true if this billboard interprets the up vector relative to the camera, or false if it is rel...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_num_geoms
Returns the number of geoms in the node.
bool has_column(const InternalName *name) const
Returns true if the data has the named column, false otherwise.
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.
This is the root of a MovingPart hierarchy.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
A base class for things that may be directly added into the egg hierarchy.
This represents one joint of the character's animation, containing an animating transform matrix.
This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to ...
A node in the scene graph that can hold any number of CollisionSolids.
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...
get_thickness
Returns the line width or point thickness.
get_perspective
Returns the perspective flag.
get_alpha_filename
Returns the alpha_filename that has been set.
Specifies how polygons are to be drawn.
An animation channel that issues a matrix each frame, read from a table such as might have been read ...
void get_transform(LMatrix4 &transform) const
Copies the joint's current transform into the indicated matrix.
Indicates what color should be applied to renderable geometry.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_child
Returns the nth child of the group.
get_child
Returns the nth child node of this node.
get_center
Returns the center of the LOD.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_frame_rate
Returns the native frame rate of the animation.
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.
virtual bool is_geom_node() const
A simple downcast check.
Defines the properties of a named stage of the multitexture pipeline.
get_draw_order
Returns the draw order this attribute specifies.
get_color_type
Returns the type of color specified by this ColorAttrib.
void set_uv(const LTexCoordd &texCoord)
Replaces the unnamed UV coordinate pair on the vertex with the indicated value.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
EggVertex * create_unique_vertex(const EggVertex ©)
Creates a new vertex in the pool that is a copy of the indicated one and returns it.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_node(PandaNode *node)
Adds the scene graph rooted at the indicated node to the accumulated egg data within this object.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A collection of vertices.
EggVertex * add_vertex(EggVertex *vertex)
Adds the indicated vertex to the end of the primitive's list of vertices, and returns it.
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
A SwitchCondition that switches the levels-of-detail based on distance from the camera's eyepoint.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A node that holds Geom objects, renderable pieces of geometry.
get_num_vertices_per_primitive
If the primitive type is a simple type in which all primitives have the same number of vertices,...
A node that renders only one of its children, according to the user's indication.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Similar to PointerToArray, except that its contents may not be modified.
const LMatrix4d & get_vertex_frame_inv() const
Returns the inverse of the matrix returned by get_vertex_frame().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_out
Returns the "out" distance of the indicated switch range.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class for PartRoot and MovingPart.