Pārlūkot izejas kodu

Merge tag 'v1.10.1'

rdb 6 gadi atpakaļ
vecāks
revīzija
6d927aaa52

+ 3 - 3
README.md

@@ -62,8 +62,8 @@ depending on whether you are on a 32-bit or 64-bit system, or you can
 [click here](https://github.com/rdb/panda3d-thirdparty) for instructions on
 building them from source.
 
-https://www.panda3d.org/download/panda3d-1.10.0/panda3d-1.10.0-tools-win64.zip
-https://www.panda3d.org/download/panda3d-1.10.0/panda3d-1.10.0-tools-win32.zip
+https://www.panda3d.org/download/panda3d-1.10.1/panda3d-1.10.1-tools-win64.zip
+https://www.panda3d.org/download/panda3d-1.10.1/panda3d-1.10.1-tools-win32.zip
 
 After acquiring these dependencies, you may simply build Panda3D from the
 command prompt using the following command.  (Change `14.1` to `14` if you are
@@ -133,7 +133,7 @@ macOS
 -----
 
 On macOS, you will need to download a set of precompiled thirdparty packages in order to
-compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.9.4/panda3d-1.9.4-tools-mac.tar.gz).
+compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.1/panda3d-1.10.1-tools-mac.tar.gz).
 
 After placing the thirdparty directory inside the panda3d source directory,
 you may build Panda3D using a command like the following:

+ 4 - 0
direct/src/interval/cLerpNodePathInterval.I

@@ -106,6 +106,8 @@ set_end_hpr(const LQuaternion &quat) {
  * if either set_end_quat() or set_end_hpr() is also called.  This parameter
  * is optional; if unspecified, the value will be taken from the node's actual
  * rotation at the time the lerp is performed.
+ *
+ * The given quaternion needs to be normalized.
  */
 INLINE void CLerpNodePathInterval::
 set_start_quat(const LQuaternion &quat) {
@@ -143,6 +145,8 @@ set_end_quat(const LVecBase3 &hpr) {
  * This replaces a previous call to set_end_hpr().  If neither set_end_quat()
  * nor set_end_hpr() is called, the node's rotation will not be affected by
  * the lerp.
+ *
+ * The given quaternion needs to be normalized.
  */
 INLINE void CLerpNodePathInterval::
 set_end_quat(const LQuaternion &quat) {

+ 2 - 2
direct/src/interval/cLerpNodePathInterval.cxx

@@ -174,14 +174,14 @@ priv_step(double t) {
           setup_slerp();
 
         } else if ((_flags & F_bake_in_start) != 0) {
-          set_start_quat(transform->get_quat());
+          set_start_quat(transform->get_norm_quat());
           setup_slerp();
 
         } else {
           if (_prev_d == 1.0) {
             _start_quat = _end_quat;
           } else {
-            LQuaternion prev_value = transform->get_quat();
+            LQuaternion prev_value = transform->get_norm_quat();
             _start_quat = (prev_value - _prev_d * _end_quat) / (1.0 - _prev_d);
           }
           setup_slerp();

+ 36 - 44
direct/src/showbase/EventManager.py

@@ -19,7 +19,7 @@ class EventManager:
         Create a C++ event queue and handler
         """
         # Make a notify category for this class (unless there already is one)
-        if (EventManager.notify == None):
+        if EventManager.notify is None:
             EventManager.notify = directNotify.newCategory("EventManager")
 
         self.eventQueue = eventQueue
@@ -37,8 +37,10 @@ class EventManager:
             processFunc = self.processEventPstats
         else:
             processFunc = self.processEvent
-        while (not self.eventQueue.isQueueEmpty()):
-            processFunc(self.eventQueue.dequeueEvent())
+        isEmptyFunc = self.eventQueue.isQueueEmpty
+        dequeueFunc = self.eventQueue.dequeueEvent
+        while not isEmptyFunc():
+            processFunc(dequeueFunc())
 
     def eventLoopTask(self, task):
         """
@@ -78,13 +80,13 @@ class EventManager:
         # ******** Duplicate any changes in processEventPstats *********
         # **************************************************************
         # Get the event name
-        eventName = event.getName()
+        eventName = event.name
         if eventName:
             paramList = []
-            for i in range(event.getNumParameters()):
-                eventParameter = event.getParameter(i)
+            for eventParameter in event.parameters:
                 eventParameterData = self.parseEventParameter(eventParameter)
                 paramList.append(eventParameterData)
+
             # Do not print the new frame debug, it is too noisy!
             if (EventManager.notify.getDebug() and eventName != 'NewFrame'):
                 EventManager.notify.debug('received C++ event named: ' + eventName +
@@ -94,13 +96,12 @@ class EventManager:
             # **************************************************************
             # Send the event, we used to send it with the event
             # name as a parameter, but now you can use extraArgs for that
-            if paramList:
-                messenger.send(eventName, paramList)
-            else:
-                messenger.send(eventName)
+            messenger.send(eventName, paramList)
+
             # Also send the event down into C++ land
-            if self.eventHandler:
-                self.eventHandler.dispatchEvent(event)
+            handler = self.eventHandler
+            if handler:
+                handler.dispatchEvent(event)
 
         else:
             # An unnamed event from C++ is probably a bad thing
@@ -115,13 +116,13 @@ class EventManager:
         # ******** Duplicate any changes in processEvent *********
         # ********************************************************
         # Get the event name
-        eventName = event.getName()
+        eventName = event.name
         if eventName:
             paramList = []
-            for i in range(event.getNumParameters()):
-                eventParameter = event.getParameter(i)
+            for eventParameter in event.parameters:
                 eventParameterData = self.parseEventParameter(eventParameter)
                 paramList.append(eventParameterData)
+
             # Do not print the new frame debug, it is too noisy!
             if (EventManager.notify.getDebug() and eventName != 'NewFrame'):
                 EventManager.notify.debug('received C++ event named: ' + eventName +
@@ -131,45 +132,36 @@ class EventManager:
             # ********************************************************
             # ******** Duplicate any changes in processEvent *********
             # ********************************************************
-            if self._wantPstats:
-                name = eventName
-                hyphen = name.find('-')
-                if hyphen >= 0:
-                    name = name[0:hyphen]
-                pstatCollector = PStatCollector('App:Show code:eventManager:' + name)
-                pstatCollector.start()
-                if self.eventHandler:
-                    cppPstatCollector = PStatCollector(
-                        'App:Show code:eventManager:' + name + ':C++')
-
-            if paramList:
-                messenger.send(eventName, paramList)
-            else:
-                messenger.send(eventName)
-            # Also send the event down into C++ land
+            name = eventName
+            hyphen = name.find('-')
+            if hyphen >= 0:
+                name = name[0:hyphen]
+            pstatCollector = PStatCollector('App:Show code:eventManager:' + name)
+            pstatCollector.start()
             if self.eventHandler:
-                if self._wantPstats:
-                    cppPstatCollector.start()
-                self.eventHandler.dispatchEvent(event)
-            # ********************************************************
-            # ******** Duplicate any changes in processEvent *********
-            # ********************************************************
+                cppPstatCollector = PStatCollector(
+                    'App:Show code:eventManager:' + name + ':C++')
 
-            if self._wantPstats:
-                if self.eventHandler:
-                    cppPstatCollector.stop()
-                pstatCollector.stop()
+            messenger.send(eventName, paramList)
+
+            # Also send the event down into C++ land
+            handler = self.eventHandler
+            if handler:
+                cppPstatCollector.start()
+                handler.dispatchEvent(event)
+                cppPstatCollector.stop()
+
+            pstatCollector.stop()
 
         else:
             # An unnamed event from C++ is probably a bad thing
             EventManager.notify.warning('unnamed event in processEvent')
 
-
     def restart(self):
-        if self.eventQueue == None:
+        if self.eventQueue is None:
             self.eventQueue = EventQueue.getGlobalEventQueue()
 
-        if self.eventHandler == None:
+        if self.eventHandler is None:
             if self.eventQueue == EventQueue.getGlobalEventQueue():
                 # If we are using the global event queue, then we also
                 # want to use the global event handler.

+ 2 - 0
doc/ReleaseNotes

@@ -4,6 +4,7 @@ This is a bugfix release intended to fix several issues in 1.10.0.
 
 * Fix crashes when gamepad is plugged in on 32-bit Windows
 * Fix deploy-ng error regarding 'exist_ok' on Python 2
+* Fix Linux install from pip not working with some mesa drivers
 * Fix compatibility issues with upcoming Python 3.8
 * Fix regression with Audio3DManager.setSoundVelocityAuto()
 * Fix issues when awaiting loader.loadModel in Python 3.7
@@ -13,6 +14,7 @@ This is a bugfix release intended to fix several issues in 1.10.0.
 * Depth buffer now defaults to 24-bit on macOS (fixes flickering)
 * Fix no devices being detected on Windows with threading-model
 * Implement collision tests from Capsule and Box into InvSphere
+* Fix odd behavior and occasional crash in QuatInterval
 * Fix SpriteAnim error in particle system
 * Fix ShaderGenerator error when using too many shadowing lights
 * Fix interrogate crash in Python 3 with optional wstring args

+ 29 - 1
makepanda/makewheel.py

@@ -104,7 +104,7 @@ MANYLINUX_LIBS = [
 
     # These are not mentioned in manylinux1 spec but should nonetheless always
     # be excluded.
-    "linux-vdso.so.1", "linux-gate.so.1", "ld-linux.so.2",
+    "linux-vdso.so.1", "linux-gate.so.1", "ld-linux.so.2", "libdrm.so.2",
 ]
 
 # Binaries to never scan for dependencies on non-Windows systems.
@@ -144,6 +144,32 @@ METADATA = {
     "classifiers": GetMetadataValue('classifiers'),
 }
 
+DESCRIPTION = """
+The Panda3D free 3D game engine
+===============================
+
+Panda3D is a powerful 3D engine written in C++, with a complete set of Python
+bindings. Unlike other engines, these bindings are automatically generated,
+meaning that they are always up-to-date and complete: all functions of the
+engine can be controlled from Python. All major Panda3D applications have been
+written in Python, this is the intended way of using the engine.
+
+Panda3D now supports automatic shader generation, which now means you can use
+normal maps, gloss maps, glow maps, HDR, cartoon shading, and the like without
+having to write any shaders.
+
+Panda3D is a modern engine supporting advanced features such as shaders,
+stencil, and render-to-texture. Panda3D is unusual in that it emphasizes a
+short learning curve, rapid development, and extreme stability and robustness.
+Panda3D is free software that runs under Windows, Linux, or macOS.
+
+The Panda3D team is very concerned with making the engine accessible to new
+users. We provide a detailed manual, a complete API reference, and a large
+collection of sample programs to help you get started. We have active forums,
+with many helpful users, and the developers are regularly online to answer
+questions.
+"""
+
 PANDA3D_TOOLS_INIT = """import os, sys
 import panda3d
 
@@ -544,6 +570,8 @@ def makewheel(version, output_dir, platform=None):
         "Platform: {0}\n".format(platform),
     ] + ["Classifier: {0}\n".format(c) for c in METADATA['classifiers']])
 
+    metadata += '\n' + DESCRIPTION.strip() + '\n'
+
     # Zip it up and name it the right thing
     whl = WheelFile('panda3d', version, platform)
     whl.lib_path = [libs_dir]

+ 2 - 1
panda/src/pipeline/threadPosixImpl.cxx

@@ -58,6 +58,7 @@ ThreadPosixImpl::
 void ThreadPosixImpl::
 setup_main_thread() {
   _status = S_running;
+  _thread = pthread_self();
 }
 
 /**
@@ -180,7 +181,7 @@ join() {
 std::string ThreadPosixImpl::
 get_unique_id() const {
   std::ostringstream strm;
-  strm << getpid() << "." << _thread;
+  strm << getpid() << "." << (uintptr_t)_thread;
 
   return strm.str();
 }

+ 1 - 1
pandatool/src/xfile/xFile.cxx

@@ -34,7 +34,7 @@ PT(XFile) XFile::_standard_templates;
  *
  */
 XFile::
-XFile(bool keep_names) : XFileNode(this, "") {
+XFile(bool keep_names) : XFileNode(this) {
   _major_version = 3;
   _minor_version = 2;
   _format_type = FT_text;

+ 10 - 0
pandatool/src/xfile/xFileNode.I

@@ -11,6 +11,16 @@
  * @date 2004-10-03
  */
 
+/**
+ *
+ */
+INLINE XFileNode::
+XFileNode(XFile *x_file) :
+  Namable(),
+  _x_file(x_file)
+{
+}
+
 /**
  *
  */

+ 3 - 0
pandatool/src/xfile/xFileNode.h

@@ -38,6 +38,9 @@ class Filename;
  */
 class XFileNode : public TypedObject, public Namable,
                   virtual public ReferenceCount {
+protected:
+  INLINE XFileNode(XFile *x_file);
+
 public:
   XFileNode(XFile *x_file, const std::string &name);
   virtual ~XFileNode();

+ 4 - 1
samples/fractal-plants/main.py

@@ -141,11 +141,14 @@ def drawBody(nodePath, vdata, pos, vecList, radius=1, keepDrawing=True, numVerti
         drawReWriter.addData1f(keepDrawing)
         currAngle += angleSlice
 
+    if startRow == 0:
+        return
+
     drawReader = GeomVertexReader(vdata, "drawFlag")
     drawReader.setRow(startRow - numVertices)
 
     # we cant draw quads directly so we use Tristrips
-    if (startRow != 0) & (drawReader.getData1f() != False):
+    if drawReader.getData1i() != 0:
         lines = GeomTristrips(Geom.UHStatic)
         half = int(numVertices * 0.5)
         for i in range(numVertices):