Browse Source

Merge branch 'release/1.10.x' into incoming

rdb 4 years ago
parent
commit
20e4704be2

+ 4 - 0
contrib/src/ai/aiCharacter.cxx

@@ -117,6 +117,10 @@ NodePath AICharacter::get_char_render() {
   return _window_render;
   return _window_render;
 }
 }
 
 
+std::string AICharacter::get_name() {
+  return _name;
+}
+
 void AICharacter::set_pf_guide(bool pf_guide) {
 void AICharacter::set_pf_guide(bool pf_guide) {
   _pf_guide = pf_guide;
   _pf_guide = pf_guide;
 }
 }

+ 4 - 0
contrib/src/ai/aiCharacter.h

@@ -46,6 +46,8 @@ class EXPCL_PANDAAI AICharacter : public ReferenceCount {
   void set_char_render(NodePath render);
   void set_char_render(NodePath render);
   NodePath get_char_render();
   NodePath get_char_render();
 
 
+  std::string get_name();
+
 PUBLISHED:
 PUBLISHED:
     double get_mass();
     double get_mass();
     void set_mass(double m);
     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);
     explicit AICharacter(std::string model_name, NodePath model_np, double mass, double movt_force, double max_force);
     ~AICharacter();
     ~AICharacter();
+
+  MAKE_PROPERTY(name, get_name);
 };
 };
 
 
 #endif
 #endif

+ 1 - 1
panda/src/bullet/bulletWorld.cxx

@@ -125,7 +125,7 @@ BulletWorld() {
   // Some prefered settings
   // Some prefered settings
   _world->getDispatchInfo().m_enableSPU = true;      // default: true
   _world->getDispatchInfo().m_enableSPU = true;      // default: true
   _world->getDispatchInfo().m_useContinuous = 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;
   _world->getSolverInfo().m_numIterations = bullet_solver_iterations;
 }
 }
 
 

+ 5 - 0
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 "
          "contact events might create more load on the event queue "
          "then you might want! Default value is FALSE."));
          "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
 ConfigVariableInt bullet_solver_iterations
 ("bullet-solver-iterations", 10,
 ("bullet-solver-iterations", 10,
 PRC_DESC("Specifies the number of iterations for the Bullet contact "
 PRC_DESC("Specifies the number of iterations for the Bullet contact "

+ 1 - 0
panda/src/bullet/config_bullet.h

@@ -33,6 +33,7 @@ extern ConfigVariableEnum<BulletWorld::BroadphaseAlgorithm> bullet_broadphase_al
 extern ConfigVariableEnum<BulletWorld::FilterAlgorithm> bullet_filter_algorithm;
 extern ConfigVariableEnum<BulletWorld::FilterAlgorithm> bullet_filter_algorithm;
 extern ConfigVariableDouble bullet_sap_extents;
 extern ConfigVariableDouble bullet_sap_extents;
 extern ConfigVariableBool bullet_enable_contact_events;
 extern ConfigVariableBool bullet_enable_contact_events;
+extern ConfigVariableBool bullet_split_impulse;
 extern ConfigVariableInt bullet_solver_iterations;
 extern ConfigVariableInt bullet_solver_iterations;
 extern ConfigVariableBool bullet_additional_damping;
 extern ConfigVariableBool bullet_additional_damping;
 extern ConfigVariableDouble bullet_additional_damping_linear_factor;
 extern ConfigVariableDouble bullet_additional_damping_linear_factor;

+ 10 - 1
panda/src/gobj/texture.cxx

@@ -30,6 +30,7 @@
 #include "pnmImage.h"
 #include "pnmImage.h"
 #include "pnmReader.h"
 #include "pnmReader.h"
 #include "pfmFile.h"
 #include "pfmFile.h"
+#include "pnmFileTypeRegistry.h"
 #include "virtualFileSystem.h"
 #include "virtualFileSystem.h"
 #include "datagramInputFile.h"
 #include "datagramInputFile.h"
 #include "datagramOutputFile.h"
 #include "datagramOutputFile.h"
@@ -5212,11 +5213,19 @@ do_write_one(CData *cdata, const Filename &fullpath, int z, int n) {
     success = pfm.write(fullpath);
     success = pfm.write(fullpath);
   } else {
   } else {
     // Writing a normal, integer texture.
     // 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;
     PNMImage pnmimage;
     if (!do_store_one(cdata, pnmimage, z, n)) {
     if (!do_store_one(cdata, pnmimage, z, n)) {
       return false;
       return false;
     }
     }
-    success = pnmimage.write(fullpath);
+    success = pnmimage.write(fullpath, type);
   }
   }
 
 
   if (!success) {
   if (!success) {

+ 18 - 10
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);
       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.
     // And now prepare each of the textures.
     const TextureAttrib *ta;
     const TextureAttrib *ta;
     if (geom_state->get_attrib(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);
   PandaNode::r_prepare_scene(gsg, node_state, transformer, current_thread);