Browse Source

Merge branch 'release/1.10.x'

rdb 6 years ago
parent
commit
662f28813a

+ 11 - 0
contrib/src/ai/aiBehaviors.cxx

@@ -13,6 +13,17 @@
 
 
 #include "aiBehaviors.h"
 #include "aiBehaviors.h"
 
 
+#include "arrival.h"
+#include "evade.h"
+#include "flee.h"
+#include "flock.h"
+#include "obstacleAvoidance.h"
+#include "pathFind.h"
+#include "pathFollow.h"
+#include "pursue.h"
+#include "seek.h"
+#include "wander.h"
+
 using std::cout;
 using std::cout;
 using std::endl;
 using std::endl;
 using std::string;
 using std::string;

+ 0 - 1
contrib/src/ai/aiGlobals.h

@@ -15,7 +15,6 @@
 #define _AI_GLOBALS_H
 #define _AI_GLOBALS_H
 
 
 #include "config_ai.h"
 #include "config_ai.h"
-#include "pandaFramework.h"
 #include "textNode.h"
 #include "textNode.h"
 #include "pandaSystem.h"
 #include "pandaSystem.h"
 
 

+ 3 - 0
contrib/src/ai/arrival.cxx

@@ -13,6 +13,9 @@
 
 
 #include "arrival.h"
 #include "arrival.h"
 
 
+#include "pursue.h"
+#include "seek.h"
+
 Arrival::Arrival(AICharacter *ai_ch, double distance) {
 Arrival::Arrival(AICharacter *ai_ch, double distance) {
   _ai_char = ai_ch;
   _ai_char = ai_ch;
 
 

+ 2 - 0
contrib/src/ai/obstacleAvoidance.cxx

@@ -13,6 +13,8 @@
 
 
 #include "obstacleAvoidance.h"
 #include "obstacleAvoidance.h"
 
 
+#include "aiWorld.h"
+
 ObstacleAvoidance::
 ObstacleAvoidance::
 ObstacleAvoidance(AICharacter *ai_char, float feeler_length) {
 ObstacleAvoidance(AICharacter *ai_char, float feeler_length) {
   _ai_char = ai_char;
   _ai_char = ai_char;

+ 2 - 0
contrib/src/ai/pathFind.cxx

@@ -13,6 +13,8 @@
 
 
 #include "pathFind.h"
 #include "pathFind.h"
 
 
+#include "pathFollow.h"
+
 using std::cout;
 using std::cout;
 using std::endl;
 using std::endl;
 using std::string;
 using std::string;

+ 14 - 0
contrib/src/ai/pathFollow.cxx

@@ -1,6 +1,20 @@
+/**
+ * PANDA 3D SOFTWARE
+ * Copyright (c) Carnegie Mellon University.  All rights reserved.
+ *
+ * All use of this software is subject to the terms of the revised BSD
+ * license.  You should have received a copy of this license along
+ * with this source code in a file named "LICENSE."
+ *
+ * @file pathFind.cxx
+ * @author Deepak, John, Navin
+ * @date 2009-10-24
+ */
 
 
 #include "pathFollow.h"
 #include "pathFollow.h"
 
 
+#include "pathFind.h"
+
 PathFollow::PathFollow(AICharacter *ai_ch, float follow_wt) {
 PathFollow::PathFollow(AICharacter *ai_ch, float follow_wt) {
     _follow_weight = follow_wt;
     _follow_weight = follow_wt;
   _curr_path_waypoint = -1;
   _curr_path_waypoint = -1;

+ 1 - 1
contrib/src/rplight/shadowAtlas.h

@@ -28,7 +28,7 @@
 #define SHADOWATLAS_H
 #define SHADOWATLAS_H
 
 
 #include "pandabase.h"
 #include "pandabase.h"
-#include "lvecBase4.h"
+#include "luse.h"
 
 
 NotifyCategoryDecl(shadowatlas, EXPORT_CLASS, EXPORT_TEMPL);
 NotifyCategoryDecl(shadowatlas, EXPORT_CLASS, EXPORT_TEMPL);
 
 

+ 2 - 2
makepanda/makepackage.py

@@ -748,7 +748,7 @@ def MakeInstallerOSX(version, runtime=False, python_versions=[], **kwargs):
     oscmd('rm -f Panda3D-rw.dmg')
     oscmd('rm -f Panda3D-rw.dmg')
 
 
 
 
-def MakeInstallerFreeBSD(version, runtime=False, **kwargs):
+def MakeInstallerFreeBSD(version, runtime=False, python_versions=[], **kwargs):
     outputdir = GetOutputDir()
     outputdir = GetOutputDir()
 
 
     oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
     oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
@@ -758,7 +758,7 @@ def MakeInstallerFreeBSD(version, runtime=False, **kwargs):
     if runtime:
     if runtime:
         InstallRuntime(destdir="targetroot", prefix="/usr/local", outputdir=outputdir)
         InstallRuntime(destdir="targetroot", prefix="/usr/local", outputdir=outputdir)
     else:
     else:
-        InstallPanda(destdir="targetroot", prefix="/usr/local", outputdir=outputdir)
+        InstallPanda(destdir="targetroot", prefix="/usr/local", outputdir=outputdir, python_versions=python_versions)
 
 
     if not os.path.exists("/usr/sbin/pkg"):
     if not os.path.exists("/usr/sbin/pkg"):
         exit("Cannot create an installer without pkg")
         exit("Cannot create an installer without pkg")

+ 8 - 2
makepanda/makepandacore.py

@@ -2797,8 +2797,14 @@ def SetupVisualStudioEnviron():
         elif not win_kit.endswith('\\'):
         elif not win_kit.endswith('\\'):
             win_kit += '\\'
             win_kit += '\\'
 
 
-        AddToPathEnv("LIB", win_kit + "Lib\\10.0.10150.0\\ucrt\\" + arch)
-        AddToPathEnv("INCLUDE", win_kit + "Include\\10.0.10150.0\\ucrt")
+        for vnum in 10150, 10240, 10586, 14393, 15063, 16299, 17134, 17763:
+            version = "10.0.{0}.0".format(vnum)
+            if os.path.isfile(win_kit + "Include\\" + version + "\\ucrt\\assert.h"):
+                print("Using Universal CRT %s" % (version))
+                break
+
+        AddToPathEnv("LIB", "%s\\Lib\\%s\\ucrt\\%s" % (win_kit, version, arch))
+        AddToPathEnv("INCLUDE", "%s\\Include\\%s\\ucrt" % (win_kit, version))
 
 
         # Copy the DLLs to the bin directory.
         # Copy the DLLs to the bin directory.
         CopyAllFiles(GetOutputDir() + "/bin/", win_kit + "Redist\\ucrt\\DLLs\\" + arch + "\\")
         CopyAllFiles(GetOutputDir() + "/bin/", win_kit + "Redist\\ucrt\\DLLs\\" + arch + "\\")

+ 1 - 0
panda/src/collide/collisionBox.cxx

@@ -186,6 +186,7 @@ get_test_pcollector() {
  */
  */
 void CollisionBox::
 void CollisionBox::
 output(std::ostream &out) const {
 output(std::ostream &out) const {
+  out << "box, (" << get_min() << ") to (" << get_max() << ")";
 }
 }
 
 
 /**
 /**

+ 30 - 12
panda/src/egg2pg/eggLoader.cxx

@@ -1814,10 +1814,11 @@ make_node(EggGroup *egg_group, PandaNode *parent) {
     // A collision group: create collision geometry.
     // A collision group: create collision geometry.
     node = new CollisionNode(egg_group->get_name());
     node = new CollisionNode(egg_group->get_name());
 
 
+    // Piggy-back the desired transform to apply onto the node, since we can't
+    // break the ABI in 1.10.
+    node->set_transform(TransformState::make_mat(LCAST(PN_stdfloat, egg_group->get_vertex_to_node())));
     make_collision_solids(egg_group, egg_group, (CollisionNode *)node.p());
     make_collision_solids(egg_group, egg_group, (CollisionNode *)node.p());
-
-    // Transform all of the collision solids into local space.
-    node->xform(LCAST(PN_stdfloat, egg_group->get_vertex_to_node()));
+    node->clear_transform();
 
 
     if ((egg_group->get_collide_flags() & EggGroup::CF_keep) != 0) {
     if ((egg_group->get_collide_flags() & EggGroup::CF_keep) != 0) {
       // If we also specified to keep the geometry, continue the traversal.
       // If we also specified to keep the geometry, continue the traversal.
@@ -2773,7 +2774,7 @@ make_sphere(EggGroup *egg_group, EggGroup::CollideFlags flags,
  */
  */
 bool EggLoader::
 bool EggLoader::
 make_box(EggGroup *egg_group, EggGroup::CollideFlags flags,
 make_box(EggGroup *egg_group, EggGroup::CollideFlags flags,
-         LPoint3 &min_p, LPoint3 &max_p, LColor &color) {
+         const LMatrix4 &xform, LPoint3 &min_p, LPoint3 &max_p) {
   EggGroup *geom_group = find_collision_geometry(egg_group, flags);
   EggGroup *geom_group = find_collision_geometry(egg_group, flags);
   if (geom_group != nullptr) {
   if (geom_group != nullptr) {
     // Collect all of the vertices.
     // Collect all of the vertices.
@@ -2802,13 +2803,12 @@ make_box(EggGroup *egg_group, EggGroup::CollideFlags flags,
     }
     }
 
 
     EggVertex *vertex = (*vi);
     EggVertex *vertex = (*vi);
-    LVertexd min_pd = vertex->get_pos3();
-    LVertexd max_pd = min_pd;
-    color = vertex->get_color();
+    LPoint3 min_pd = LCAST(PN_stdfloat, vertex->get_pos3()) * xform;
+    LPoint3 max_pd = min_pd;
 
 
     for (++vi; vi != vertices.end(); ++vi) {
     for (++vi; vi != vertices.end(); ++vi) {
       vertex = (*vi);
       vertex = (*vi);
-      const LVertexd &pos = vertex->get_pos3();
+      LPoint3 pos = LCAST(PN_stdfloat, vertex->get_pos3()) * xform;
       min_pd.set(min(min_pd[0], pos[0]),
       min_pd.set(min(min_pd[0], pos[0]),
                  min(min_pd[1], pos[1]),
                  min(min_pd[1], pos[1]),
                  min(min_pd[2], pos[2]));
                  min(min_pd[2], pos[2]));
@@ -2817,13 +2817,25 @@ make_box(EggGroup *egg_group, EggGroup::CollideFlags flags,
                  max(max_pd[2], pos[2]));
                  max(max_pd[2], pos[2]));
     }
     }
 
 
-    min_p = LCAST(PN_stdfloat, min_pd);
-    max_p = LCAST(PN_stdfloat, max_pd);
+    min_p = min_pd;
+    max_p = max_pd;
     return (min_pd != max_pd);
     return (min_pd != max_pd);
   }
   }
   return false;
   return false;
 }
 }
 
 
+/**
+ * Creates a single generic Box corresponding to the polygons associated with
+ * this group.  This box is used by make_collision_box.
+ */
+bool EggLoader::
+make_box(EggGroup *egg_group, EggGroup::CollideFlags flags,
+         LPoint3 &min_p, LPoint3 &max_p, LColor &color) {
+
+  color.set(1.0, 1.0, 1.0, 1.0);
+  return make_box(egg_group, flags, LMatrix4::ident_mat(), min_p, max_p);
+}
+
 /**
 /**
  * Creates CollisionSolids corresponding to the collision geometry indicated
  * Creates CollisionSolids corresponding to the collision geometry indicated
  * at the given node and below.
  * at the given node and below.
@@ -2904,6 +2916,7 @@ make_collision_plane(EggGroup *egg_group, CollisionNode *cnode,
           create_collision_plane(DCAST(EggPolygon, *ci), egg_group);
           create_collision_plane(DCAST(EggPolygon, *ci), egg_group);
         if (csplane != nullptr) {
         if (csplane != nullptr) {
           apply_collision_flags(csplane, flags);
           apply_collision_flags(csplane, flags);
+          csplane->xform(cnode->get_transform()->get_mat());
           cnode->add_solid(csplane);
           cnode->add_solid(csplane);
           return;
           return;
         }
         }
@@ -3004,6 +3017,7 @@ make_collision_sphere(EggGroup *egg_group, CollisionNode *cnode,
     CollisionSphere *cssphere =
     CollisionSphere *cssphere =
       new CollisionSphere(center, radius);
       new CollisionSphere(center, radius);
     apply_collision_flags(cssphere, flags);
     apply_collision_flags(cssphere, flags);
+    cssphere->xform(cnode->get_transform()->get_mat());
     cnode->add_solid(cssphere);
     cnode->add_solid(cssphere);
   }
   }
 }
 }
@@ -3017,8 +3031,8 @@ make_collision_box(EggGroup *egg_group, CollisionNode *cnode,
                    EggGroup::CollideFlags flags) {
                    EggGroup::CollideFlags flags) {
   LPoint3 min_p;
   LPoint3 min_p;
   LPoint3 max_p;
   LPoint3 max_p;
-  LColor dummycolor;
-  if (make_box(egg_group, flags, min_p, max_p, dummycolor)) {
+  CPT(TransformState) transform = cnode->get_transform();
+  if (make_box(egg_group, flags, transform->get_mat(), min_p, max_p)) {
     CollisionBox *csbox =
     CollisionBox *csbox =
       new CollisionBox(min_p, max_p);
       new CollisionBox(min_p, max_p);
     apply_collision_flags(csbox, flags);
     apply_collision_flags(csbox, flags);
@@ -3040,6 +3054,7 @@ make_collision_inv_sphere(EggGroup *egg_group, CollisionNode *cnode,
     CollisionInvSphere *cssphere =
     CollisionInvSphere *cssphere =
       new CollisionInvSphere(center, radius);
       new CollisionInvSphere(center, radius);
     apply_collision_flags(cssphere, flags);
     apply_collision_flags(cssphere, flags);
+    cssphere->xform(cnode->get_transform()->get_mat());
     cnode->add_solid(cssphere);
     cnode->add_solid(cssphere);
   }
   }
 }
 }
@@ -3234,6 +3249,7 @@ make_collision_capsule(EggGroup *egg_group, CollisionNode *cnode,
           new CollisionCapsule(LCAST(PN_stdfloat, point_a), LCAST(PN_stdfloat, point_b),
           new CollisionCapsule(LCAST(PN_stdfloat, point_a), LCAST(PN_stdfloat, point_b),
                             radius);
                             radius);
         apply_collision_flags(cscapsule, flags);
         apply_collision_flags(cscapsule, flags);
+        cscapsule->xform(cnode->get_transform()->get_mat());
         cnode->add_solid(cscapsule);
         cnode->add_solid(cscapsule);
       }
       }
     }
     }
@@ -3395,6 +3411,7 @@ create_collision_polygons(CollisionNode *cnode, EggPolygon *egg_poly,
         new CollisionPolygon(vertices_begin, vertices_end);
         new CollisionPolygon(vertices_begin, vertices_end);
       if (cspoly->is_valid()) {
       if (cspoly->is_valid()) {
         apply_collision_flags(cspoly, flags);
         apply_collision_flags(cspoly, flags);
+        cspoly->xform(cnode->get_transform()->get_mat());
         cnode->add_solid(cspoly);
         cnode->add_solid(cspoly);
       }
       }
     }
     }
@@ -3485,6 +3502,7 @@ create_collision_floor_mesh(CollisionNode *cnode,
     CollisionFloorMesh::TriangleIndices triangle = *ti;
     CollisionFloorMesh::TriangleIndices triangle = *ti;
     csfloor->add_triangle(triangle.p1, triangle.p2, triangle.p3);
     csfloor->add_triangle(triangle.p1, triangle.p2, triangle.p3);
   }
   }
+  csfloor->xform(cnode->get_transform()->get_mat());
   cnode->add_solid(csfloor);
   cnode->add_solid(csfloor);
 }
 }
 
 

+ 2 - 0
panda/src/egg2pg/eggLoader.h

@@ -163,6 +163,8 @@ private:
   bool make_sphere(EggGroup *start_group, EggGroup::CollideFlags flags,
   bool make_sphere(EggGroup *start_group, EggGroup::CollideFlags flags,
                    LPoint3 &center, PN_stdfloat &radius, LColor &color);
                    LPoint3 &center, PN_stdfloat &radius, LColor &color);
 
 
+  bool make_box(EggGroup *start_group, EggGroup::CollideFlags flags,
+                const LMatrix4 &xform, LPoint3 &min_p, LPoint3 &max_p);
   bool make_box(EggGroup *start_group, EggGroup::CollideFlags flags,
   bool make_box(EggGroup *start_group, EggGroup::CollideFlags flags,
                 LPoint3 &min_p, LPoint3 &max_p, LColor &color);
                 LPoint3 &min_p, LPoint3 &max_p, LColor &color);