15 #include "colladaBindMaterial.h" 16 #include "colladaPrimitive.h" 19 #include "pre_collada_include.h" 20 #include <dom/domBind_material.h> 21 #include <dom/domEffect.h> 22 #include <dom/domInstance_effect.h> 23 #include <dom/domInstance_material.h> 24 #include <dom/domMaterial.h> 26 #if PANDA_COLLADA_VERSION >= 15 27 #include <dom/domFx_profile.h> 29 #include <dom/domFx_profile_abstract.h> 30 #define domFx_profile domFx_profile_abstract 31 #define domFx_profile_Array domFx_profile_abstract_Array 32 #define getFx_profile_array getFx_profile_abstract_array 42 if (prim == NULL || _states.count(prim->get_material()) == 0) {
45 return _states.find(prim->get_material())->second;
54 get_material(
const string &symbol)
const {
55 if (_states.count(symbol) == 0) {
58 return _states.find(symbol)->second;
65 void ColladaBindMaterial::
66 load_bind_material(domBind_material &bind_mat) {
67 domInstance_material_Array &mat_instances
68 = bind_mat.getTechnique_common()->getInstance_material_array();
70 for (
size_t i = 0; i < mat_instances.getCount(); ++i) {
81 domMaterialRef mat = daeSafeCast<domMaterial> (inst.getTarget().getElement());
82 nassertv(mat != NULL);
84 domInstance_effectRef einst = mat->getInstance_effect();
85 nassertv(einst != NULL);
87 domInstance_effect::domSetparam_Array &setparams = einst->getSetparam_array();
89 domEffectRef effect = daeSafeCast<domEffect>
90 (mat->getInstance_effect()->getUrl().getElement());
94 const domFx_profile_Array &profiles = effect->getFx_profile_array();
95 for (
size_t i = 0; i < profiles.getCount(); ++i) {
void load_instance_material(domInstance_material &inst)
Loads an instance_material object.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Class that deals with COLLADA primitive structures, such as <triangles> and <polylist>.