diff --git a/contrib/src/ai/aiCharacter.cxx b/contrib/src/ai/aiCharacter.cxx index 58485081c3..8f46bd8ee1 100644 --- a/contrib/src/ai/aiCharacter.cxx +++ b/contrib/src/ai/aiCharacter.cxx @@ -117,6 +117,10 @@ NodePath AICharacter::get_char_render() { return _window_render; } +std::string AICharacter::get_name() { + return _name; +} + void AICharacter::set_pf_guide(bool pf_guide) { _pf_guide = pf_guide; } diff --git a/contrib/src/ai/aiCharacter.h b/contrib/src/ai/aiCharacter.h index 81b3a01210..5ea5e590ec 100644 --- a/contrib/src/ai/aiCharacter.h +++ b/contrib/src/ai/aiCharacter.h @@ -46,6 +46,8 @@ class EXPCL_PANDAAI AICharacter : public ReferenceCount { void set_char_render(NodePath render); NodePath get_char_render(); + std::string get_name(); + PUBLISHED: double get_mass(); void set_mass(double m); @@ -65,6 +67,8 @@ PUBLISHED: explicit AICharacter(std::string model_name, NodePath model_np, double mass, double movt_force, double max_force); ~AICharacter(); + + MAKE_PROPERTY(name, get_name); }; #endif diff --git a/panda/src/bullet/bulletWorld.cxx b/panda/src/bullet/bulletWorld.cxx index 8a4bbfb0d3..f422df2f86 100644 --- a/panda/src/bullet/bulletWorld.cxx +++ b/panda/src/bullet/bulletWorld.cxx @@ -125,7 +125,7 @@ BulletWorld() { // Some prefered settings _world->getDispatchInfo().m_enableSPU = true; // default: true _world->getDispatchInfo().m_useContinuous = true; // default: true - _world->getSolverInfo().m_splitImpulse = false; // default: false + _world->getSolverInfo().m_splitImpulse = bullet_split_impulse; _world->getSolverInfo().m_numIterations = bullet_solver_iterations; } diff --git a/panda/src/bullet/config_bullet.cxx b/panda/src/bullet/config_bullet.cxx index e4627c931e..caee5fb2c6 100644 --- a/panda/src/bullet/config_bullet.cxx +++ b/panda/src/bullet/config_bullet.cxx @@ -100,6 +100,11 @@ PRC_DESC("Specifies if events should be send when new contacts are " "contact events might create more load on the event queue " "then you might want! Default value is FALSE.")); +ConfigVariableBool bullet_split_impulse +("bullet-split-impulse", false, +PRC_DESC("Penetrating recovery won't add momentum. " + "btContactSolverInfo::m_splitImpulse. Default value is false.")); + ConfigVariableInt bullet_solver_iterations ("bullet-solver-iterations", 10, PRC_DESC("Specifies the number of iterations for the Bullet contact " diff --git a/panda/src/bullet/config_bullet.h b/panda/src/bullet/config_bullet.h index b9fe8dcc05..cf74435d4b 100644 --- a/panda/src/bullet/config_bullet.h +++ b/panda/src/bullet/config_bullet.h @@ -33,6 +33,7 @@ extern ConfigVariableEnum bullet_broadphase_al extern ConfigVariableEnum bullet_filter_algorithm; extern ConfigVariableDouble bullet_sap_extents; extern ConfigVariableBool bullet_enable_contact_events; +extern ConfigVariableBool bullet_split_impulse; extern ConfigVariableInt bullet_solver_iterations; extern ConfigVariableBool bullet_additional_damping; extern ConfigVariableDouble bullet_additional_damping_linear_factor; diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index c8c649bc36..e5c4ce8809 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -30,6 +30,7 @@ #include "pnmImage.h" #include "pnmReader.h" #include "pfmFile.h" +#include "pnmFileTypeRegistry.h" #include "virtualFileSystem.h" #include "datagramInputFile.h" #include "datagramOutputFile.h" @@ -5212,11 +5213,19 @@ do_write_one(CData *cdata, const Filename &fullpath, int z, int n) { success = pfm.write(fullpath); } else { // Writing a normal, integer texture. + PNMFileType *type = + PNMFileTypeRegistry::get_global_ptr()->get_type_from_extension(fullpath); + if (type == nullptr) { + gobj_cat.error() + << "Texture::write() - couldn't determine type from extension: " << fullpath << endl; + return false; + } + PNMImage pnmimage; if (!do_store_one(cdata, pnmimage, z, n)) { return false; } - success = pnmimage.write(fullpath); + success = pnmimage.write(fullpath, type); } if (!success) { diff --git a/panda/src/pgraph/geomNode.cxx b/panda/src/pgraph/geomNode.cxx index fa4a81beac..c9f379addc 100644 --- a/panda/src/pgraph/geomNode.cxx +++ b/panda/src/pgraph/geomNode.cxx @@ -397,6 +397,24 @@ r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, geom_state = state_munger->munge_state(geom_state); } + // As well as the shaders. + const ShaderAttrib *sa; + if (geom_state->get_attrib(sa)) { + Shader *shader = (Shader *)sa->get_shader(); + if (shader != nullptr) { + prepared_objects->enqueue_shader(shader); + } + else if (sa->auto_shader()) { + gsg->ensure_generated_shader(geom_state); + } + else if (munger->is_of_type(StateMunger::get_class_type())) { + // Premunge the state for the fixed-function pipeline. + StateMunger *state_munger = (StateMunger *)munger.p(); + geom_state = state_munger->munge_state(geom_state); + } + // TODO: prepare the shader inputs. + } + // And now prepare each of the textures. const TextureAttrib *ta; if (geom_state->get_attrib(ta)) { @@ -409,16 +427,6 @@ r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, } } } - - // As well as the shaders. - const ShaderAttrib *sa; - if (geom_state->get_attrib(sa)) { - Shader *shader = (Shader *)sa->get_shader(); - if (shader != nullptr) { - prepared_objects->enqueue_shader(shader); - } - // TODO: prepare the shader inputs. - } } PandaNode::r_prepare_scene(gsg, node_state, transformer, current_thread);