Browse Source

Bring parameter-reimpl up-to-date with master (merge)

Conflicts:
	panda/src/linmath/lvecBase4_src.I
rdb 10 years ago
parent
commit
bacfc5cd4e
100 changed files with 611 additions and 1397 deletions
  1. 1 1
      .gitignore
  2. 2 2
      .travis.yml
  3. 33 4
      README.md
  4. 6 1
      contrib/.gitignore
  5. 38 38
      contrib/src/ai/Sources.pp
  6. 16 16
      contrib/src/ai/aiBehaviors.h
  7. 21 26
      contrib/src/ai/aiCharacter.cxx
  8. 4 4
      contrib/src/ai/aiCharacter.h
  9. 1 1
      contrib/src/ai/aiNode.cxx
  10. 2 2
      contrib/src/ai/aiNode.h
  11. 2 2
      contrib/src/ai/aiPathFinder.cxx
  12. 1 1
      contrib/src/ai/aiPathFinder.h
  13. 8 8
      contrib/src/ai/arrival.cxx
  14. 3 3
      contrib/src/ai/arrival.h
  15. 4 4
      contrib/src/ai/evade.cxx
  16. 2 2
      contrib/src/ai/evade.h
  17. 7 7
      contrib/src/ai/flee.cxx
  18. 5 5
      contrib/src/ai/flee.h
  19. 1 1
      contrib/src/ai/meshNode.cxx
  20. 2 2
      contrib/src/ai/meshNode.h
  21. 15 15
      contrib/src/ai/obstacleAvoidance.cxx
  22. 1 1
      contrib/src/ai/obstacleAvoidance.h
  23. 3 3
      contrib/src/ai/pathFind.cxx
  24. 2 2
      contrib/src/ai/pathFind.h
  25. 2 2
      contrib/src/ai/pathFollow.cxx
  26. 2 2
      contrib/src/ai/pathFollow.h
  27. 6 6
      contrib/src/ai/pursue.cxx
  28. 2 2
      contrib/src/ai/pursue.h
  29. 5 5
      contrib/src/ai/seek.cxx
  30. 5 5
      contrib/src/ai/seek.h
  31. 18 18
      contrib/src/ai/wander.cxx
  32. 3 3
      contrib/src/ai/wander.h
  33. 4 13
      contrib/src/contribbase/contribsymbols.h
  34. 1 0
      contrib/src/panda3dtoolsgui/build_exe.bat
  35. 4 9
      direct/src/actor/Actor.py
  36. 1 1
      direct/src/cluster/ClusterClient.py
  37. 0 1
      direct/src/cluster/ClusterConfig.py
  38. 1 1
      direct/src/cluster/ClusterMsgs.py
  39. 1 1
      direct/src/cluster/ClusterServer.py
  40. 3 7
      direct/src/controls/GravityWalker.py
  41. 4 0
      direct/src/dcparser/dcPackData.I
  42. 1 1
      direct/src/dcparser/dcPacker.h
  43. 2 1
      direct/src/dcparser/dcPackerInterface.cxx
  44. 3 3
      direct/src/directbase/TestStart.py
  45. 4 13
      direct/src/directbase/directsymbols.h
  46. 5 3
      direct/src/directbase/ppython.cxx
  47. 2 16
      direct/src/directdevices/DirectDeviceManager.py
  48. 2 0
      direct/src/directnotify/DirectNotifyGlobal.py
  49. 0 1
      direct/src/directnotify/Logger.py
  50. 0 1
      direct/src/directnotify/Notifier.py
  51. 2 2
      direct/src/directscripts/Doxyfile.python
  52. 1 1
      direct/src/directscripts/doxygen_filter.py
  53. 5 7
      direct/src/directscripts/eggcacher.py
  54. 122 52
      direct/src/directscripts/extract_docs.py
  55. 1 1
      direct/src/directtools/DirectCameraControl.py
  56. 1 1
      direct/src/directtools/DirectGeometry.py
  57. 1 1
      direct/src/directtools/DirectGlobals.py
  58. 1 1
      direct/src/directtools/DirectGrid.py
  59. 1 1
      direct/src/directtools/DirectLights.py
  60. 7 9
      direct/src/directtools/DirectSession.py
  61. 4 4
      direct/src/distributed/ConnectionRepository.py
  62. 1 1
      direct/src/distributed/DistributedCartesianGrid.py
  63. 0 1
      direct/src/distributed/GridChild.py
  64. 2 1
      direct/src/distributed/PyDatagram.py
  65. 2 1
      direct/src/distributed/PyDatagramIterator.py
  66. 22 182
      direct/src/distributed/cConnectionRepository.cxx
  67. 3 17
      direct/src/distributed/cConnectionRepository.h
  68. 0 9
      direct/src/doc/dcPacker.txt
  69. 1 1
      direct/src/extensions/HTTPChannel-extensions.py
  70. 5 4
      direct/src/extensions_native/CInterval_extensions.py
  71. 1 1
      direct/src/extensions_native/HTTPChannel_extensions.py
  72. 47 742
      direct/src/extensions_native/NodePath_extensions.py
  73. 1 1
      direct/src/extensions_native/VBase3_extensions.py
  74. 1 1
      direct/src/extensions_native/VBase4_extensions.py
  75. 28 0
      direct/src/extensions_native/core_extensions.py
  76. 4 5
      direct/src/extensions_native/extension_native_helpers.py
  77. 2 4
      direct/src/ffi/DoGenPyCode.py
  78. 0 1
      direct/src/ffi/FFITypes.py
  79. 0 1
      direct/src/ffi/jGenPyCode.py
  80. 9 10
      direct/src/filter/CommonFilters.py
  81. 20 22
      direct/src/filter/FilterManager.py
  82. 0 1
      direct/src/fsm/FourState.py
  83. 0 1
      direct/src/fsm/SampleFSM.py
  84. 0 1
      direct/src/fsm/State.py
  85. 1 1
      direct/src/fsm/StatePush.py
  86. 1 1
      direct/src/gui/DirectButton.py
  87. 1 1
      direct/src/gui/DirectCheckBox.py
  88. 1 2
      direct/src/gui/DirectCheckButton.py
  89. 25 11
      direct/src/gui/DirectDialog.py
  90. 1 1
      direct/src/gui/DirectEntry.py
  91. 2 4
      direct/src/gui/DirectEntryScroll.py
  92. 2 2
      direct/src/gui/DirectFrame.py
  93. 7 9
      direct/src/gui/DirectGuiBase.py
  94. 1 1
      direct/src/gui/DirectGuiGlobals.py
  95. 3 1
      direct/src/gui/DirectGuiTest.py
  96. 1 2
      direct/src/gui/DirectLabel.py
  97. 1 1
      direct/src/gui/DirectOptionMenu.py
  98. 6 4
      direct/src/gui/DirectRadioButton.py
  99. 1 1
      direct/src/gui/DirectScrollBar.py
  100. 1 1
      direct/src/gui/DirectScrolledFrame.py

+ 1 - 1
.gitignore

@@ -1,4 +1,4 @@
 /built_x64
 /built_x64
 /built
 /built
-/samples
 /thirdparty
 /thirdparty
+/targetroot

+ 2 - 2
.travis.yml

@@ -4,12 +4,12 @@ compiler:
   - clang
   - clang
 before_script:
 before_script:
   - sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit
   - sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit
-script: python makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT
+script: python makepanda/makepanda.py --everything --verbose --git-commit $TRAVIS_COMMIT --installer --threads 2
 notifications:
 notifications:
   irc:
   irc:
     channels:
     channels:
       - "chat.freenode.net#panda3d"
       - "chat.freenode.net#panda3d"
     on_success: change
     on_success: change
-    on_failure: change
+    on_failure: always
     use_notice: true
     use_notice: true
     skip_join: true
     skip_join: true

+ 33 - 4
README.md

@@ -29,19 +29,26 @@ need Microsoft Visual Studio to build Panda3D, though - the relevant compilers
 are included as part of the Windows 7.1 SDK.
 are included as part of the Windows 7.1 SDK.
 
 
 You will also need to have the third-party dependency libraries available for
 You will also need to have the third-party dependency libraries available for
-the build scripts to use.  These are available from here:
-https://www.panda3d.org/forums/viewtopic.php?f=9&t=16346
+the build scripts to use.  These are available from one of these two URLs,
+depending on whether you are on a 32-bit or 64-bit system:
+https://www.panda3d.org/download/panda3d-1.9.0/panda3d-1.9.0-tools-win32.zip
+https://www.panda3d.org/download/panda3d-1.9.0/panda3d-1.9.0-tools-win64.zip
 
 
 After acquiring these dependencies, you may simply build Panda3D from the
 After acquiring these dependencies, you may simply build Panda3D from the
 command prompt using the following command:
 command prompt using the following command:
 
 
 ```bash
 ```bash
-makepanda\makepanda.bat --everything --installer
+makepanda\makepanda.bat --everything --installer --no-eigen
 ```
 ```
 
 
 When the build succeeds, it will produce an .exe file that you can use to
 When the build succeeds, it will produce an .exe file that you can use to
 install Panda3D on your system.
 install Panda3D on your system.
 
 
+Note: you may choose to remove --no-eigen and build with Eigen support in
+order to improve runtime performance.  However, this will cause the build to
+take hours to complete, as Eigen is a heavily template-based library, and the
+the MSVC compiler does not perform well under these circumstances.
+
 Linux
 Linux
 -----
 -----
 
 
@@ -70,7 +77,7 @@ If you are on Ubuntu, this command should cover the most frequently
 used third-party packages:
 used third-party packages:
 
 
 ```bash
 ```bash
-sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libeigen3-dev libopenal-dev libode-dev libbullet-dev nvidia-cg-toolkit
+sudo apt-get install build-essential pkg-config python-dev libpng-dev libjpeg-dev libtiff-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libeigen3-dev libopenal-dev libode-dev libbullet-dev nvidia-cg-toolkit libgtk2.0-dev
 ```
 ```
 
 
 Once Panda3D has built, you can either install the .deb or .rpm package that
 Once Panda3D has built, you can either install the .deb or .rpm package that
@@ -81,3 +88,25 @@ your system.  Careful: it is not easy to uninstall Panda3D in this way!
 ```bash
 ```bash
 python2.7 makepanda/installpanda.py --prefix=/usr/local
 python2.7 makepanda/installpanda.py --prefix=/usr/local
 ```
 ```
+
+Mac OS X
+--------
+
+On Mac OS X, all you need to compile Panda3D is a set of precompiled
+thirdparty packages, which can be acquired from here:
+https://www.panda3d.org/download/panda3d-1.9.0/panda3d-1.9.0-tools-mac.tar.gz
+
+After placing the thirdparty directory inside the panda3d source directory,
+you may build Panda3D using a command like the following:
+
+```bash
+python makepanda/makepanda.py --everything --installer
+```
+
+In order to make a universal build, pass the --universal flag.  You may also
+target a specific minimum Mac OS X version using the --osxtarget flag followed
+by the release number, eg. 10.6 or 10.7.
+
+If the build was successful, makepanda will have generated a .dmg file in
+the source directory containing the installer.  Simply open it and run the
+package file in order to install the SDK onto your system.

+ 6 - 1
contrib/.gitignore

@@ -1,4 +1,9 @@
+*.pyc
+*.pyo
 /__init__.py
 /__init__.py
-/built/
+# These are files that are generated within the source tree by the
+# ppremake system.
 Makefile
 Makefile
 pp.dep
 pp.dep
+/built/
+Opt?-*

+ 38 - 38
contrib/src/ai/Sources.pp

@@ -18,7 +18,7 @@
 static const float _PI = 3.14;
 static const float _PI = 3.14;
 
 
 AIBehaviors::AIBehaviors() {
 AIBehaviors::AIBehaviors() {
-  _steering_force = LVecBase3f(0.0, 0.0, 0.0);
+  _steering_force = LVecBase3(0.0, 0.0, 0.0);
   _behaviors_flags = _behaviors_flags & _none;
   _behaviors_flags = _behaviors_flags & _none;
   _previous_conflict = false;
   _previous_conflict = false;
   _conflict = false;
   _conflict = false;
@@ -67,7 +67,7 @@ bool AIBehaviors::is_conflict() {
       }
       }
 
 
       if(is_on(_flee)) {
       if(is_on(_flee)) {
-        LVecBase3f dirn = _flee_force;
+        LVecBase3 dirn = _flee_force;
         dirn.normalize();
         dirn.normalize();
         _flee_force = _steering_force.length() * dirn * _flee_obj->_flee_weight;
         _flee_force = _steering_force.length() * dirn * _flee_obj->_flee_weight;
       }
       }
@@ -77,7 +77,7 @@ bool AIBehaviors::is_conflict() {
       }
       }
 
 
       if(is_on(_evade)) {
       if(is_on(_evade)) {
-        LVecBase3f dirn = _evade_force;
+        LVecBase3 dirn = _evade_force;
         dirn.normalize();
         dirn.normalize();
         _evade_force = _steering_force.length() * dirn * _evade_obj->_evade_weight;
         _evade_force = _steering_force.length() * dirn * _evade_obj->_evade_weight;
       }
       }
@@ -111,9 +111,9 @@ bool AIBehaviors::is_conflict() {
 
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
 
-void AIBehaviors::accumulate_force(string force_type, LVecBase3f force) {
+void AIBehaviors::accumulate_force(string force_type, LVecBase3 force) {
 
 
-  LVecBase3f old_force;
+  LVecBase3 old_force;
 
 
   if(force_type == "seek") {
   if(force_type == "seek") {
     old_force = _seek_force;
     old_force = _seek_force;
@@ -169,8 +169,8 @@ void AIBehaviors::accumulate_force(string force_type, LVecBase3f force) {
 
 
 //////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f AIBehaviors::calculate_prioritized() {
-  LVecBase3f force;
+LVecBase3 AIBehaviors::calculate_prioritized() {
+  LVecBase3 force;
 
 
   if(is_on(_seek)) {
   if(is_on(_seek)) {
     if(_conflict) {
     if(_conflict) {
@@ -299,13 +299,13 @@ LVecBase3f AIBehaviors::calculate_prioritized() {
 
 
   if(is_on(_arrival)) {
   if(is_on(_arrival)) {
     if(_seek_obj != NULL) {
     if(_seek_obj != NULL) {
-      LVecBase3f dirn = _steering_force;
+      LVecBase3 dirn = _steering_force;
       dirn.normalize();
       dirn.normalize();
       _steering_force = ((_steering_force.length() - _arrival_force.length()) * dirn);
       _steering_force = ((_steering_force.length() - _arrival_force.length()) * dirn);
     }
     }
 
 
     if(_pursue_obj != NULL) {
     if(_pursue_obj != NULL) {
-      LVecBase3f dirn = _steering_force;
+      LVecBase3 dirn = _steering_force;
       dirn.normalize();
       dirn.normalize();
       _steering_force = ((_steering_force.length() - _arrival_force.length()) * _arrival_obj->_arrival_direction);
       _steering_force = ((_steering_force.length() - _arrival_force.length()) * _arrival_obj->_arrival_direction);
     }
     }
@@ -639,7 +639,7 @@ void AIBehaviors::resume_ai(string ai_type) {
 // Function : seek
 // Function : seek
 // Description : This function activates seek and makes an object of the Seek class.
 // Description : This function activates seek and makes an object of the Seek class.
 //                This is the function we want the user to call for seek to be done.
 //                This is the function we want the user to call for seek to be done.
-//                This function is overloaded to accept a NodePath or an LVecBase3f.
+//                This function is overloaded to accept a NodePath or an LVecBase3.
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
@@ -648,7 +648,7 @@ void AIBehaviors::seek(NodePath target_object, float seek_wt) {
   turn_on("seek");
   turn_on("seek");
 }
 }
 
 
-void AIBehaviors::seek(LVecBase3f pos, float seek_wt) {
+void AIBehaviors::seek(LVecBase3 pos, float seek_wt) {
   _seek_obj = new Seek(_ai_char, pos, seek_wt);
   _seek_obj = new Seek(_ai_char, pos, seek_wt);
   turn_on("seek");
   turn_on("seek");
 }
 }
@@ -657,7 +657,7 @@ void AIBehaviors::seek(LVecBase3f pos, float seek_wt) {
 //
 //
 // Function : flee
 // Function : flee
 // Description : This function activates flee_activate and creates an object of the Flee class.
 // Description : This function activates flee_activate and creates an object of the Flee class.
-//                This function is overloaded to accept a NodePath or an LVecBase3f.
+//                This function is overloaded to accept a NodePath or an LVecBase3.
 
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
 
@@ -668,7 +668,7 @@ void AIBehaviors::flee(NodePath target_object, double panic_distance, double rel
   turn_on("flee_activate");
   turn_on("flee_activate");
 }
 }
 
 
-void AIBehaviors::flee(LVecBase3f pos, double panic_distance, double relax_distance, float flee_wt) {
+void AIBehaviors::flee(LVecBase3 pos, double panic_distance, double relax_distance, float flee_wt) {
   _flee_obj = new Flee(_ai_char, pos, panic_distance, relax_distance, flee_wt);
   _flee_obj = new Flee(_ai_char, pos, panic_distance, relax_distance, flee_wt);
   _flee_list.insert(_flee_list.end(), *_flee_obj);
   _flee_list.insert(_flee_list.end(), *_flee_obj);
 
 
@@ -769,38 +769,38 @@ void AIBehaviors::flock_activate() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f AIBehaviors::do_flock() {
+LVecBase3 AIBehaviors::do_flock() {
 
 
   //! Initialize variables required to compute the flocking force on the ai char.
   //! Initialize variables required to compute the flocking force on the ai char.
   unsigned int neighbor_count = 0;
   unsigned int neighbor_count = 0;
-  LVecBase3f separation_force = LVecBase3f(0.0, 0.0, 0.0);
-  LVecBase3f alignment_force = LVecBase3f(0.0, 0.0, 0.0);
-  LVecBase3f cohesion_force = LVecBase3f(0.0, 0.0, 0.0);
-  LVecBase3f avg_neighbor_heading = LVecBase3f(0.0, 0.0, 0.0);
-  LVecBase3f total_neighbor_heading = LVecBase3f(0.0, 0.0, 0.0);
-  LVecBase3f avg_center_of_mass = LVecBase3f(0.0, 0.0, 0.0);
-  LVecBase3f total_center_of_mass = LVecBase3f(0.0, 0.0, 0.0);
+  LVecBase3 separation_force = LVecBase3(0.0, 0.0, 0.0);
+  LVecBase3 alignment_force = LVecBase3(0.0, 0.0, 0.0);
+  LVecBase3 cohesion_force = LVecBase3(0.0, 0.0, 0.0);
+  LVecBase3 avg_neighbor_heading = LVecBase3(0.0, 0.0, 0.0);
+  LVecBase3 total_neighbor_heading = LVecBase3(0.0, 0.0, 0.0);
+  LVecBase3 avg_center_of_mass = LVecBase3(0.0, 0.0, 0.0);
+  LVecBase3 total_center_of_mass = LVecBase3(0.0, 0.0, 0.0);
 
 
   //! Loop through all the other AI units in the flock to check if they are neigbours.
   //! Loop through all the other AI units in the flock to check if they are neigbours.
   for(unsigned int i = 0; i < _flock_group->_ai_char_list.size(); i++) {
   for(unsigned int i = 0; i < _flock_group->_ai_char_list.size(); i++) {
     if(_flock_group->_ai_char_list[i]->_name != _ai_char->_name) {
     if(_flock_group->_ai_char_list[i]->_name != _ai_char->_name) {
 
 
       //! Using visibilty cone to detect neighbors.
       //! Using visibilty cone to detect neighbors.
-      LVecBase3f dist_vect = _flock_group->_ai_char_list[i]->_ai_char_np.get_pos() - _ai_char->_ai_char_np.get_pos();
-      LVecBase3f ai_char_heading = _ai_char->get_velocity();
+      LVecBase3 dist_vect = _flock_group->_ai_char_list[i]->_ai_char_np.get_pos() - _ai_char->_ai_char_np.get_pos();
+      LVecBase3 ai_char_heading = _ai_char->get_velocity();
       ai_char_heading.normalize();
       ai_char_heading.normalize();
 
 
       //! Check if the current unit is a neighbor.
       //! Check if the current unit is a neighbor.
       if(dist_vect.dot(ai_char_heading) > ((dist_vect.length()) * (ai_char_heading.length()) * cos(_flock_group->_flock_vcone_angle * (_PI / 180)))
       if(dist_vect.dot(ai_char_heading) > ((dist_vect.length()) * (ai_char_heading.length()) * cos(_flock_group->_flock_vcone_angle * (_PI / 180)))
         && (dist_vect.length() < _flock_group->_flock_vcone_radius)) {
         && (dist_vect.length() < _flock_group->_flock_vcone_radius)) {
           //! Separation force calculation.
           //! Separation force calculation.
-          LVecBase3f ai_char_to_units = _ai_char->_ai_char_np.get_pos() - _flock_group->_ai_char_list[i]->_ai_char_np.get_pos();
+          LVecBase3 ai_char_to_units = _ai_char->_ai_char_np.get_pos() - _flock_group->_ai_char_list[i]->_ai_char_np.get_pos();
           float to_units_dist = ai_char_to_units.length();
           float to_units_dist = ai_char_to_units.length();
           ai_char_to_units.normalize();
           ai_char_to_units.normalize();
           separation_force += (ai_char_to_units / to_units_dist);
           separation_force += (ai_char_to_units / to_units_dist);
 
 
           //! Calculating the total heading and center of mass of all the neighbors.
           //! Calculating the total heading and center of mass of all the neighbors.
-          LVecBase3f neighbor_heading = _flock_group->_ai_char_list[i]->get_velocity();
+          LVecBase3 neighbor_heading = _flock_group->_ai_char_list[i]->get_velocity();
           neighbor_heading.normalize();
           neighbor_heading.normalize();
           total_neighbor_heading += neighbor_heading;
           total_neighbor_heading += neighbor_heading;
           total_center_of_mass += _flock_group->_ai_char_list[i]->_ai_char_np.get_pos();
           total_center_of_mass += _flock_group->_ai_char_list[i]->_ai_char_np.get_pos();
@@ -814,7 +814,7 @@ LVecBase3f AIBehaviors::do_flock() {
   if(neighbor_count > 0) {
   if(neighbor_count > 0) {
     //! Alignment force calculation
     //! Alignment force calculation
     avg_neighbor_heading = total_neighbor_heading / neighbor_count;
     avg_neighbor_heading = total_neighbor_heading / neighbor_count;
-    LVector3f ai_char_heading = _ai_char->get_velocity();
+    LVector3 ai_char_heading = _ai_char->get_velocity();
     ai_char_heading.normalize();
     ai_char_heading.normalize();
     avg_neighbor_heading -= ai_char_heading;
     avg_neighbor_heading -= ai_char_heading;
     avg_neighbor_heading.normalize();
     avg_neighbor_heading.normalize();
@@ -822,7 +822,7 @@ LVecBase3f AIBehaviors::do_flock() {
 
 
     //! Cohesion force calculation
     //! Cohesion force calculation
     avg_center_of_mass = total_center_of_mass / neighbor_count;
     avg_center_of_mass = total_center_of_mass / neighbor_count;
-    LVecBase3f cohesion_dir = avg_center_of_mass - _ai_char->_ai_char_np.get_pos();
+    LVecBase3 cohesion_dir = avg_center_of_mass - _ai_char->_ai_char_np.get_pos();
     cohesion_dir.normalize();
     cohesion_dir.normalize();
     cohesion_force = cohesion_dir * _ai_char->_movt_force;
     cohesion_force = cohesion_dir * _ai_char->_movt_force;
   }
   }
@@ -830,7 +830,7 @@ LVecBase3f AIBehaviors::do_flock() {
     _flock_done = true;
     _flock_done = true;
     turn_off("flock");
     turn_off("flock");
     turn_on("flock_activate");
     turn_on("flock_activate");
-    return(LVecBase3f(0.0, 0.0, 0.0));
+    return(LVecBase3(0.0, 0.0, 0.0));
   }
   }
 
 
   //! Calculate the resultant force on the ai character by taking into account the separation, alignment and cohesion
   //! Calculate the resultant force on the ai character by taking into account the separation, alignment and cohesion
@@ -885,7 +885,7 @@ void AIBehaviors::path_follow(float follow_wt) {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-void AIBehaviors::add_to_path(LVecBase3f pos) {
+void AIBehaviors::add_to_path(LVecBase3 pos) {
   _path_follow_obj->add_to_path(pos);
   _path_follow_obj->add_to_path(pos);
 }
 }
 
 
@@ -923,7 +923,7 @@ void AIBehaviors::init_path_find(const char* navmesh_filename) {
 
 
 ///////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////
 
 
-void AIBehaviors::path_find_to(LVecBase3f pos, string type) {
+void AIBehaviors::path_find_to(LVecBase3 pos, string type) {
   _path_find_obj->path_find(pos, type);
   _path_find_obj->path_find(pos, type);
 }
 }
 
 
@@ -1331,56 +1331,56 @@ switch(char_to_int(ai_type)) {
               if (is_on(_seek)) {
               if (is_on(_seek)) {
                 _behaviors_flags ^= _seek;
                 _behaviors_flags ^= _seek;
               }
               }
-              _seek_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _seek_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 2: {
     case 2: {
               if (is_on(_flee)) {
               if (is_on(_flee)) {
                 _behaviors_flags ^= _flee;
                 _behaviors_flags ^= _flee;
               }
               }
-              _flee_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _flee_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 3: {
     case 3: {
               if(is_on(_pursue)) {
               if(is_on(_pursue)) {
                 _behaviors_flags ^= _pursue;
                 _behaviors_flags ^= _pursue;
               }
               }
-              _pursue_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _pursue_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 4: {
     case 4: {
               if(is_on(_evade)) {
               if(is_on(_evade)) {
                 _behaviors_flags ^= _evade;
                 _behaviors_flags ^= _evade;
               }
               }
-              _evade_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _evade_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 5: {
     case 5: {
               if (is_on(_arrival)) {
               if (is_on(_arrival)) {
                   _behaviors_flags ^= _arrival;
                   _behaviors_flags ^= _arrival;
                 }
                 }
-                _arrival_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+                _arrival_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 6: {
     case 6: {
               if(is_on(_flock)) {
               if(is_on(_flock)) {
                 _behaviors_flags ^= _flock;
                 _behaviors_flags ^= _flock;
               }
               }
-              _flock_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _flock_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 7: {
     case 7: {
               if(is_on(_wander)) {
               if(is_on(_wander)) {
                 _behaviors_flags ^= _wander;
                 _behaviors_flags ^= _wander;
               }
               }
-              _wander_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _wander_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 8: {
     case 8: {
               if(is_on(_obstacle_avoidance)) {
               if(is_on(_obstacle_avoidance)) {
                 _behaviors_flags ^= _obstacle_avoidance;
                 _behaviors_flags ^= _obstacle_avoidance;
               }
               }
-              _obstacle_avoidance_force = LVecBase3f(0.0f, 0.0f, 0.0f);
+              _obstacle_avoidance_force = LVecBase3(0.0f, 0.0f, 0.0f);
               break;
               break;
             }
             }
     case 9:{
     case 9:{

+ 16 - 16
contrib/src/ai/aiBehaviors.h

@@ -73,41 +73,41 @@ public:
   Flock *_flock_group;
   Flock *_flock_group;
 
 
   int _behaviors_flags;
   int _behaviors_flags;
-  LVecBase3f _steering_force;
+  LVecBase3 _steering_force;
 
 
   Seek *_seek_obj;
   Seek *_seek_obj;
-  LVecBase3f _seek_force;
+  LVecBase3 _seek_force;
 
 
   Flee *_flee_obj;
   Flee *_flee_obj;
-  LVecBase3f _flee_force;
+  LVecBase3 _flee_force;
 
 
   //! This list is used if the ai character needs to flee from multiple onjects.
   //! This list is used if the ai character needs to flee from multiple onjects.
   ListFlee _flee_list;
   ListFlee _flee_list;
   ListFlee::iterator _flee_itr;
   ListFlee::iterator _flee_itr;
 
 
   Pursue *_pursue_obj;
   Pursue *_pursue_obj;
-  LVecBase3f _pursue_force;
+  LVecBase3 _pursue_force;
 
 
   Evade *_evade_obj;
   Evade *_evade_obj;
-  LVecBase3f _evade_force;
+  LVecBase3 _evade_force;
 
 
   //! This list is used if the ai character needs to evade from multiple onjects.
   //! This list is used if the ai character needs to evade from multiple onjects.
   ListEvade _evade_list;
   ListEvade _evade_list;
   ListEvade::iterator _evade_itr;
   ListEvade::iterator _evade_itr;
 
 
   Arrival *_arrival_obj;
   Arrival *_arrival_obj;
-  LVecBase3f _arrival_force;
+  LVecBase3 _arrival_force;
 
 
   //! Since Flock is a collective behavior the variables are declared within the AIBehaviors class.
   //! Since Flock is a collective behavior the variables are declared within the AIBehaviors class.
   float _flock_weight;
   float _flock_weight;
-  LVecBase3f _flock_force;
+  LVecBase3 _flock_force;
   bool _flock_done;
   bool _flock_done;
 
 
   Wander * _wander_obj;
   Wander * _wander_obj;
-  LVecBase3f _wander_force;
+  LVecBase3 _wander_force;
 
 
   ObstacleAvoidance *_obstacle_avoidance_obj;
   ObstacleAvoidance *_obstacle_avoidance_obj;
-  LVecBase3f _obstacle_avoidance_force;
+  LVecBase3 _obstacle_avoidance_force;
 
 
   PathFollow *_path_follow_obj;
   PathFollow *_path_follow_obj;
 
 
@@ -127,20 +127,20 @@ public:
 
 
   bool is_conflict();
   bool is_conflict();
 
 
-  void accumulate_force(string force_type, LVecBase3f force);
-  LVecBase3f calculate_prioritized();
+  void accumulate_force(string force_type, LVecBase3 force);
+  LVecBase3 calculate_prioritized();
 
 
   void flock_activate();
   void flock_activate();
-  LVecBase3f do_flock();
+  LVecBase3 do_flock();
 
 
   int char_to_int(string ai_type);
   int char_to_int(string ai_type);
 
 
 PUBLISHED:
 PUBLISHED:
   void seek(NodePath target_object, float seek_wt = 1.0);
   void seek(NodePath target_object, float seek_wt = 1.0);
-  void seek(LVecBase3f pos, float seek_wt = 1.0);
+  void seek(LVecBase3 pos, float seek_wt = 1.0);
 
 
   void flee(NodePath target_object, double panic_distance = 10.0, double relax_distance = 10.0, float flee_wt = 1.0);
   void flee(NodePath target_object, double panic_distance = 10.0, double relax_distance = 10.0, float flee_wt = 1.0);
-  void flee(LVecBase3f pos, double panic_distance = 10.0, double relax_distance = 10.0, float flee_wt = 1.0);
+  void flee(LVecBase3 pos, double panic_distance = 10.0, double relax_distance = 10.0, float flee_wt = 1.0);
 
 
   void pursue(NodePath target_object, float pursue_wt = 1.0);
   void pursue(NodePath target_object, float pursue_wt = 1.0);
 
 
@@ -155,12 +155,12 @@ PUBLISHED:
   void obstacle_avoidance(float feeler_length = 1.0);
   void obstacle_avoidance(float feeler_length = 1.0);
 
 
   void path_follow(float follow_wt);
   void path_follow(float follow_wt);
-  void add_to_path(LVecBase3f pos);
+  void add_to_path(LVecBase3 pos);
   void start_follow(string type = "normal");
   void start_follow(string type = "normal");
 
 
   // should have different function names.
   // should have different function names.
   void init_path_find(const char* navmesh_filename);
   void init_path_find(const char* navmesh_filename);
-  void path_find_to(LVecBase3f pos, string type = "normal");
+  void path_find_to(LVecBase3 pos, string type = "normal");
   void path_find_to(NodePath target, string type = "normal");
   void path_find_to(NodePath target, string type = "normal");
   void add_static_obstacle(NodePath obstacle);
   void add_static_obstacle(NodePath obstacle);
   void add_dynamic_obstacle(NodePath obstacle);
   void add_dynamic_obstacle(NodePath obstacle);

+ 21 - 26
contrib/src/ai/aiCharacter.cxx

@@ -23,8 +23,8 @@ AICharacter::AICharacter(string model_name, NodePath model_np, double mass, doub
   _max_force = max_force;
   _max_force = max_force;
   _movt_force = movt_force;
   _movt_force = movt_force;
 
 
-  _velocity = LVecBase3f(0.0, 0.0, 0.0);
-  _steering_force = LVecBase3f(0.0, 0.0, 0.0);
+  _velocity = LVecBase3(0.0, 0.0, 0.0);
+  _steering_force = LVecBase3(0.0, 0.0, 0.0);
 
 
   _steering = new AIBehaviors();
   _steering = new AIBehaviors();
   _steering->_ai_char = this;
   _steering->_ai_char = this;
@@ -43,48 +43,43 @@ AICharacter::~AICharacter() {
 //                This also makes the character  look at the direction of the force.
 //                This also makes the character  look at the direction of the force.
 
 
 /////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
-
-void AICharacter::update() {
-
-  if(!_steering->is_off(_steering->_none)) {
-
-    LVecBase3f old_pos = _ai_char_np.get_pos();
-
-    LVecBase3f steering_force = _steering->calculate_prioritized();
-
-    LVecBase3f acceleration = steering_force / _mass;
+void AICharacter::
+update() {
+  if (!_steering->is_off(_steering->_none)) {
+    LVecBase3 old_pos = _ai_char_np.get_pos();
+    LVecBase3 steering_force = _steering->calculate_prioritized();
+    LVecBase3 acceleration = steering_force / _mass;
 
 
     _velocity = acceleration;
     _velocity = acceleration;
 
 
-    LVecBase3f direction = _steering->_steering_force;
+    LVecBase3 direction = _steering->_steering_force;
     direction.normalize();
     direction.normalize();
 
 
     _ai_char_np.set_pos(old_pos + _velocity) ;
     _ai_char_np.set_pos(old_pos + _velocity) ;
 
 
-    if(steering_force.length() > 0) {
+    if (steering_force.length() > 0) {
       _ai_char_np.look_at(old_pos + (direction * 5));
       _ai_char_np.look_at(old_pos + (direction * 5));
       _ai_char_np.set_h(_ai_char_np.get_h() + 180);
       _ai_char_np.set_h(_ai_char_np.get_h() + 180);
       _ai_char_np.set_p(-_ai_char_np.get_p());
       _ai_char_np.set_p(-_ai_char_np.get_p());
       _ai_char_np.set_r(-_ai_char_np.get_r());
       _ai_char_np.set_r(-_ai_char_np.get_r());
     }
     }
-  }
-  else {
-    _steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_seek_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_flee_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_pursue_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_evade_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_arrival_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_flock_force = LVecBase3f(0.0, 0.0, 0.0);
-    _steering->_wander_force = LVecBase3f(0.0, 0.0, 0.0);
+  } else {
+    _steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_seek_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_flee_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_pursue_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_evade_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_arrival_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_flock_force = LVecBase3(0.0, 0.0, 0.0);
+    _steering->_wander_force = LVecBase3(0.0, 0.0, 0.0);
   }
   }
 }
 }
 
 
-LVecBase3f AICharacter::get_velocity() {
+LVecBase3 AICharacter::get_velocity() {
   return _velocity;
   return _velocity;
 }
 }
 
 
-void AICharacter::set_velocity(LVecBase3f velocity) {
+void AICharacter::set_velocity(LVecBase3 velocity) {
   _velocity = velocity;
   _velocity = velocity;
 }
 }
 
 

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

@@ -39,8 +39,8 @@ class EXPCL_PANDAAI AICharacter {
  public:
  public:
   double _mass;
   double _mass;
   double _max_force;
   double _max_force;
-  LVecBase3f _velocity;
-  LVecBase3f _steering_force;
+  LVecBase3 _velocity;
+  LVecBase3 _steering_force;
   string _name;
   string _name;
   double _movt_force;
   double _movt_force;
   unsigned int _ai_char_flock_id;
   unsigned int _ai_char_flock_id;
@@ -51,7 +51,7 @@ class EXPCL_PANDAAI AICharacter {
   bool _pf_guide;
   bool _pf_guide;
 
 
   void update();
   void update();
-  void set_velocity(LVecBase3f vel);
+  void set_velocity(LVecBase3 vel);
   void set_char_render(NodePath render);
   void set_char_render(NodePath render);
   NodePath get_char_render();
   NodePath get_char_render();
 
 
@@ -59,7 +59,7 @@ PUBLISHED:
     double get_mass();
     double get_mass();
     void set_mass(double m);
     void set_mass(double m);
 
 
-    LVecBase3f get_velocity();
+    LVecBase3 get_velocity();
 
 
     double get_max_force();
     double get_max_force();
     void set_max_force(double max_force);
     void set_max_force(double max_force);

+ 1 - 1
contrib/src/ai/aiNode.cxx

@@ -14,7 +14,7 @@
 
 
 #include "aiNode.h"
 #include "aiNode.h"
 
 
-AINode::AINode(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h) {
+AINode::AINode(int grid_x, int grid_y, LVecBase3 pos, float w, float l, float h) {
   for (int i = 0; i < 8; ++i) {
   for (int i = 0; i < 8; ++i) {
     _neighbours[i] = NULL;
     _neighbours[i] = NULL;
   }
   }

+ 2 - 2
contrib/src/ai/aiNode.h

@@ -62,7 +62,7 @@ public:
   int _grid_x, _grid_y;
   int _grid_x, _grid_y;
 
 
   // Position of the node in 3D space.
   // Position of the node in 3D space.
-  LVecBase3f _position;
+  LVecBase3 _position;
 
 
   // Dimensions of each face / cell on the mesh.
   // Dimensions of each face / cell on the mesh.
   // Height is given in case of expansion to a 3d mesh. Currently
   // Height is given in case of expansion to a 3d mesh. Currently
@@ -77,7 +77,7 @@ public:
   AINode *_next;
   AINode *_next;
 
 
 PUBLISHED:
 PUBLISHED:
-  AINode(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h);
+  AINode(int grid_x, int grid_y, LVecBase3 pos, float w, float l, float h);
   ~AINode();
   ~AINode();
 
 
   bool contains(float x, float y);
   bool contains(float x, float y);

+ 2 - 2
contrib/src/ai/aiPathFinder.cxx

@@ -36,7 +36,7 @@ void PathFinder::find_path(Node *src_node, Node *dest_node) {
 
 
   // Add a dummy node as the first element of the open list with score = -1.
   // Add a dummy node as the first element of the open list with score = -1.
   // Inorder to implement a binary heap the index of the elements should never be 0.
   // Inorder to implement a binary heap the index of the elements should never be 0.
-  Node *_dummy_node = new Node(-1, -1, LVecBase3f(0.0, 0.0, 0.0), 0, 0, 0);
+  Node *_dummy_node = new Node(-1, -1, LVecBase3(0.0, 0.0, 0.0), 0, 0, 0);
   _dummy_node->_status = _dummy_node->open;
   _dummy_node->_status = _dummy_node->open;
   _dummy_node->_score = -1;
   _dummy_node->_score = -1;
   _open_list.push_back(_dummy_node);
   _open_list.push_back(_dummy_node);
@@ -379,7 +379,7 @@ void PathFinder::remove_from_clist(int r, int c) {
 
 
 /////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
 
 
-Node* find_in_mesh(NavMesh nav_mesh, LVecBase3f pos, int grid_size) {
+Node* find_in_mesh(NavMesh nav_mesh, LVecBase3 pos, int grid_size) {
   int size = grid_size;
   int size = grid_size;
   float x = pos[0];
   float x = pos[0];
   float y = pos[1];
   float y = pos[1];

+ 1 - 1
contrib/src/ai/aiPathFinder.h

@@ -23,7 +23,7 @@
 typedef vector<Node *> NodeArray;
 typedef vector<Node *> NodeArray;
 typedef vector<NodeArray> NavMesh;
 typedef vector<NodeArray> NavMesh;
 
 
-Node* find_in_mesh(NavMesh nav_mesh, LVecBase3f pos, int grid_size);
+Node* find_in_mesh(NavMesh nav_mesh, LVecBase3 pos, int grid_size);
 
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //

+ 8 - 8
contrib/src/ai/arrival.cxx

@@ -36,8 +36,8 @@ Arrival::~Arrival() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f Arrival::do_arrival() {
-  LVecBase3f direction_to_target;
+LVecBase3 Arrival::do_arrival() {
+  LVecBase3 direction_to_target;
   double distance;
   double distance;
 
 
   if(_arrival_type) {
   if(_arrival_type) {
@@ -52,22 +52,22 @@ LVecBase3f Arrival::do_arrival() {
   _arrival_direction.normalize();
   _arrival_direction.normalize();
 
 
   if(int(distance) == 0) {
   if(int(distance) == 0) {
-    _ai_char->_steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
-    _ai_char->_steering->_arrival_force = LVecBase3f(0.0, 0.0, 0.0);
+    _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
+    _ai_char->_steering->_arrival_force = LVecBase3(0.0, 0.0, 0.0);
 
 
     if(_ai_char->_steering->_seek_obj != NULL) {
     if(_ai_char->_steering->_seek_obj != NULL) {
       _ai_char->_steering->turn_off("arrival");
       _ai_char->_steering->turn_off("arrival");
       _ai_char->_steering->turn_on("arrival_activate");
       _ai_char->_steering->turn_on("arrival_activate");
     }
     }
     _arrival_done = true;
     _arrival_done = true;
-    return(LVecBase3f(0.0, 0.0, 0.0));
+    return(LVecBase3(0.0, 0.0, 0.0));
   }
   }
   else {
   else {
     _arrival_done = false;
     _arrival_done = false;
   }
   }
 
 
   double u = _ai_char->get_velocity().length();
   double u = _ai_char->get_velocity().length();
-  LVecBase3f desired_force = ((u * u) / (2 * distance)) * _ai_char->get_mass();
+  LVecBase3 desired_force = ((u * u) / (2 * distance)) * _ai_char->get_mass();
 
 
   if(_ai_char->_steering->_seek_obj != NULL) {
   if(_ai_char->_steering->_seek_obj != NULL) {
     return(desired_force);
     return(desired_force);
@@ -85,7 +85,7 @@ LVecBase3f Arrival::do_arrival() {
   }
   }
 
 
   cout<<"Arrival works only with seek and pursue"<<endl;
   cout<<"Arrival works only with seek and pursue"<<endl;
-  return(LVecBase3f(0.0, 0.0, 0.0));
+  return(LVecBase3(0.0, 0.0, 0.0));
 }
 }
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
@@ -98,7 +98,7 @@ LVecBase3f Arrival::do_arrival() {
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
 void Arrival::arrival_activate() {
 void Arrival::arrival_activate() {
-  LVecBase3f dirn;
+  LVecBase3 dirn;
   if(_arrival_type) {
   if(_arrival_type) {
     dirn = (_ai_char->_ai_char_np.get_pos(_ai_char->_window_render) - _ai_char->get_ai_behaviors()->_pursue_obj->_pursue_target.get_pos(_ai_char->_window_render));
     dirn = (_ai_char->_ai_char_np.get_pos(_ai_char->_window_render) - _ai_char->get_ai_behaviors()->_pursue_obj->_pursue_target.get_pos(_ai_char->_window_render));
   }
   }

+ 3 - 3
contrib/src/ai/arrival.h

@@ -27,9 +27,9 @@ public:
   AICharacter *_ai_char;
   AICharacter *_ai_char;
 
 
   NodePath _arrival_target;
   NodePath _arrival_target;
-  LVecBase3f _arrival_target_pos;
+  LVecBase3 _arrival_target_pos;
   double _arrival_distance;
   double _arrival_distance;
-  LVecBase3f _arrival_direction;
+  LVecBase3 _arrival_direction;
   bool _arrival_done;
   bool _arrival_done;
 
 
   // This flag specifies if the arrival behavior is being used with seek or pursue behavior.
   // This flag specifies if the arrival behavior is being used with seek or pursue behavior.
@@ -39,7 +39,7 @@ public:
 
 
   Arrival(AICharacter *ai_ch, double distance = 10.0);
   Arrival(AICharacter *ai_ch, double distance = 10.0);
   ~Arrival();
   ~Arrival();
-  LVecBase3f do_arrival();
+  LVecBase3 do_arrival();
   void arrival_activate();
   void arrival_activate();
 };
 };
 
 

+ 4 - 4
contrib/src/ai/evade.cxx

@@ -42,23 +42,23 @@ Evade::~Evade() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f Evade::do_evade() {
+LVecBase3 Evade::do_evade() {
   assert(_evade_target && "evade target not assigned");
   assert(_evade_target && "evade target not assigned");
 
 
   _evade_direction = _ai_char->_ai_char_np.get_pos(_ai_char->_window_render) - _evade_target.get_pos(_ai_char->_window_render);
   _evade_direction = _ai_char->_ai_char_np.get_pos(_ai_char->_window_render) - _evade_target.get_pos(_ai_char->_window_render);
   double distance = _evade_direction.length();
   double distance = _evade_direction.length();
 
 
   _evade_direction.normalize();
   _evade_direction.normalize();
-  LVecBase3f desired_force = _evade_direction * _ai_char->_movt_force;
+  LVecBase3 desired_force = _evade_direction * _ai_char->_movt_force;
 
 
   if(distance > (_evade_distance + _evade_relax_distance)) {
   if(distance > (_evade_distance + _evade_relax_distance)) {
     if((_ai_char->_steering->_behaviors_flags | _ai_char->_steering->_evade) == _ai_char->_steering->_evade) {
     if((_ai_char->_steering->_behaviors_flags | _ai_char->_steering->_evade) == _ai_char->_steering->_evade) {
-      _ai_char->_steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
+      _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
     }
     }
     _ai_char->_steering->turn_off("evade");
     _ai_char->_steering->turn_off("evade");
     _ai_char->_steering->turn_on("evade_activate");
     _ai_char->_steering->turn_on("evade_activate");
     _evade_done = true;
     _evade_done = true;
-    return(LVecBase3f(0.0, 0.0, 0.0));
+    return(LVecBase3(0.0, 0.0, 0.0));
   }
   }
   else {
   else {
       _evade_done = false;
       _evade_done = false;

+ 2 - 2
contrib/src/ai/evade.h

@@ -28,7 +28,7 @@ public:
 
 
   NodePath _evade_target;
   NodePath _evade_target;
   float _evade_weight;
   float _evade_weight;
-  LVecBase3f _evade_direction;
+  LVecBase3 _evade_direction;
   double _evade_distance;
   double _evade_distance;
   double _evade_relax_distance;
   double _evade_relax_distance;
   bool _evade_done;
   bool _evade_done;
@@ -38,7 +38,7 @@ public:
                                           double relax_distance, float evade_wt);
                                           double relax_distance, float evade_wt);
 
 
   ~Evade();
   ~Evade();
-  LVecBase3f do_evade();
+  LVecBase3 do_evade();
   void evade_activate();
   void evade_activate();
 };
 };
 
 

+ 7 - 7
contrib/src/ai/flee.cxx

@@ -29,7 +29,7 @@ Flee::Flee(AICharacter *ai_ch, NodePath target_object, double panic_distance,
   _flee_activate_done = false;
   _flee_activate_done = false;
 }
 }
 
 
-Flee::Flee(AICharacter *ai_ch, LVecBase3f pos, double panic_distance,
+Flee::Flee(AICharacter *ai_ch, LVecBase3 pos, double panic_distance,
                                 double relax_distance, float flee_wt){
                                 double relax_distance, float flee_wt){
 
 
     _ai_char = ai_ch;
     _ai_char = ai_ch;
@@ -57,10 +57,10 @@ Flee::~Flee() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f Flee::do_flee() {
-  LVecBase3f dirn;
+LVecBase3 Flee::do_flee() {
+  LVecBase3 dirn;
   double distance;
   double distance;
-  LVecBase3f desired_force;
+  LVecBase3 desired_force;
 
 
   dirn = _ai_char->_ai_char_np.get_pos(_ai_char->_window_render) - _flee_present_pos;
   dirn = _ai_char->_ai_char_np.get_pos(_ai_char->_window_render) - _flee_present_pos;
   distance = dirn.length();
   distance = dirn.length();
@@ -68,12 +68,12 @@ LVecBase3f Flee::do_flee() {
 
 
   if(distance > (_flee_distance + _flee_relax_distance)) {
   if(distance > (_flee_distance + _flee_relax_distance)) {
     if((_ai_char->_steering->_behaviors_flags | _ai_char->_steering->_flee) == _ai_char->_steering->_flee) {
     if((_ai_char->_steering->_behaviors_flags | _ai_char->_steering->_flee) == _ai_char->_steering->_flee) {
-        _ai_char->_steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
+        _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
     }
     }
     _flee_done = true;
     _flee_done = true;
     _ai_char->_steering->turn_off("flee");
     _ai_char->_steering->turn_off("flee");
     _ai_char->_steering->turn_on("flee_activate");
     _ai_char->_steering->turn_on("flee_activate");
-    return(LVecBase3f(0.0, 0.0, 0.0));
+    return(LVecBase3(0.0, 0.0, 0.0));
   }
   }
   else {
   else {
       return(desired_force);
       return(desired_force);
@@ -90,7 +90,7 @@ LVecBase3f Flee::do_flee() {
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
 void Flee::flee_activate() {
 void Flee::flee_activate() {
-  LVecBase3f dirn;
+  LVecBase3 dirn;
   double distance;
   double distance;
 
 
   _flee_activate_done = false;
   _flee_activate_done = false;

+ 5 - 5
contrib/src/ai/flee.h

@@ -26,23 +26,23 @@ class EXPCL_PANDAAI Flee {
 public:
 public:
   AICharacter *_ai_char;
   AICharacter *_ai_char;
 
 
-  LVecBase3f _flee_position;
+  LVecBase3 _flee_position;
   float _flee_weight;
   float _flee_weight;
-  LVecBase3f _flee_direction;
+  LVecBase3 _flee_direction;
   double _flee_distance;
   double _flee_distance;
   double _flee_relax_distance;
   double _flee_relax_distance;
-  LVecBase3f _flee_present_pos;
+  LVecBase3 _flee_present_pos;
   bool _flee_done;
   bool _flee_done;
   bool _flee_activate_done;
   bool _flee_activate_done;
 
 
   Flee(AICharacter *ai_ch, NodePath target_object, double panic_distance = 10.0,
   Flee(AICharacter *ai_ch, NodePath target_object, double panic_distance = 10.0,
                               double relax_distance = 10.0, float flee_wt = 1.0);
                               double relax_distance = 10.0, float flee_wt = 1.0);
 
 
-  Flee(AICharacter *ai_ch, LVecBase3f pos, double panic_distance = 10.0,
+  Flee(AICharacter *ai_ch, LVecBase3 pos, double panic_distance = 10.0,
                               double relax_distance = 10.0, float flee_wt = 1.0);
                               double relax_distance = 10.0, float flee_wt = 1.0);
 
 
   ~Flee();
   ~Flee();
-  LVecBase3f do_flee();
+  LVecBase3 do_flee();
   void flee_activate();
   void flee_activate();
 };
 };
 
 

+ 1 - 1
contrib/src/ai/meshNode.cxx

@@ -1,7 +1,7 @@
 
 
 #include "meshNode.h"
 #include "meshNode.h"
 
 
-Node::Node(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h) {
+Node::Node(int grid_x, int grid_y, LVecBase3 pos, float w, float l, float h) {
   for(int i = 0; i < 8; ++i) {
   for(int i = 0; i < 8; ++i) {
     _neighbours[i] = NULL;
     _neighbours[i] = NULL;
   }
   }

+ 2 - 2
contrib/src/ai/meshNode.h

@@ -47,7 +47,7 @@ public:
     int _grid_x, _grid_y;
     int _grid_x, _grid_y;
 
 
     // Position of the node in 3D space.
     // Position of the node in 3D space.
-    LVecBase3f _position;
+    LVecBase3 _position;
 
 
     // Dimensions of each face / cell on the mesh.
     // Dimensions of each face / cell on the mesh.
     // Height is given in case of expansion to a 3d mesh. Currently not used.
     // Height is given in case of expansion to a 3d mesh. Currently not used.
@@ -58,7 +58,7 @@ public:
     // Note: The data in this member is discarded when mesh data is written into navmesh.csv file.
     // Note: The data in this member is discarded when mesh data is written into navmesh.csv file.
     Node *_next;
     Node *_next;
 
 
-    Node(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h);
+    Node(int grid_x, int grid_y, LVecBase3 pos, float w, float l, float h);
     ~Node();
     ~Node();
 
 
     bool contains(float x, float y);
     bool contains(float x, float y);

+ 15 - 15
contrib/src/ai/obstacleAvoidance.cxx

@@ -35,15 +35,15 @@ bool ObstacleAvoidance::obstacle_detection() {
   // Calculate the volume of the AICharacter with respect to render
   // Calculate the volume of the AICharacter with respect to render
   PT(BoundingVolume) np_bounds = _ai_char->get_node_path().get_bounds();
   PT(BoundingVolume) np_bounds = _ai_char->get_node_path().get_bounds();
   CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere();
   CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere();
-  LVecBase3f avoidance(0.0, 0.0, 0.0);
+  LVecBase3 avoidance(0.0, 0.0, 0.0);
   double distance = 0x7fff ;
   double distance = 0x7fff ;
   double expanded_radius;
   double expanded_radius;
-  LVecBase3f to_obstacle;
-  LVecBase3f prev_avoidance;
+  LVecBase3 to_obstacle;
+  LVecBase3 prev_avoidance;
   for(unsigned int i = 0; i < _ai_char->_world->_obstacles.size(); ++i) {
   for(unsigned int i = 0; i < _ai_char->_world->_obstacles.size(); ++i) {
     PT(BoundingVolume) bounds = _ai_char->_world->_obstacles[i].get_bounds();
     PT(BoundingVolume) bounds = _ai_char->_world->_obstacles[i].get_bounds();
     CPT(BoundingSphere) bsphere = bounds->as_bounding_sphere();
     CPT(BoundingSphere) bsphere = bounds->as_bounding_sphere();
-    LVecBase3f near_obstacle = _ai_char->_world->_obstacles[i].get_pos() - _ai_char->get_node_path().get_pos();
+    LVecBase3 near_obstacle = _ai_char->_world->_obstacles[i].get_pos() - _ai_char->get_node_path().get_pos();
     // Check if it's the nearest obstacle, If so initialize as the nearest obstacle
     // Check if it's the nearest obstacle, If so initialize as the nearest obstacle
     if((near_obstacle.length() < distance) && (_ai_char->_world->_obstacles[i].get_pos() != _ai_char->get_node_path().get_pos())) {
     if((near_obstacle.length() < distance) && (_ai_char->_world->_obstacles[i].get_pos() != _ai_char->get_node_path().get_pos())) {
       _nearest_obstacle = _ai_char->_world->_obstacles[i];
       _nearest_obstacle = _ai_char->_world->_obstacles[i];
@@ -51,13 +51,13 @@ bool ObstacleAvoidance::obstacle_detection() {
       expanded_radius = bsphere->get_radius() + np_sphere->get_radius();
       expanded_radius = bsphere->get_radius() + np_sphere->get_radius();
     }
     }
   }
   }
-     LVecBase3f feeler = _feeler * _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3f::forward());
+     LVecBase3 feeler = _feeler * _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3::forward());
      feeler.normalize();
      feeler.normalize();
      feeler *= (expanded_radius + np_sphere->get_radius()) ;
      feeler *= (expanded_radius + np_sphere->get_radius()) ;
      to_obstacle = _nearest_obstacle.get_pos() - _ai_char->get_node_path().get_pos();
      to_obstacle = _nearest_obstacle.get_pos() - _ai_char->get_node_path().get_pos();
-     LVector3f line_vector = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3f::forward());
-     LVecBase3f project = (to_obstacle.dot(line_vector) * line_vector) / line_vector.length_squared();
-     LVecBase3f perp = project - to_obstacle;
+     LVector3 line_vector = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3::forward());
+     LVecBase3 project = (to_obstacle.dot(line_vector) * line_vector) / line_vector.length_squared();
+     LVecBase3 perp = project - to_obstacle;
      // If the nearest obstacle will collide with our AICharacter then send obstacle detection as true
      // If the nearest obstacle will collide with our AICharacter then send obstacle detection as true
      if((_nearest_obstacle) && (perp.length() < expanded_radius - np_sphere->get_radius()) && (project.length() < feeler.length())) {
      if((_nearest_obstacle) && (perp.length() < expanded_radius - np_sphere->get_radius()) && (project.length() < feeler.length())) {
        return true;
        return true;
@@ -90,27 +90,27 @@ void ObstacleAvoidance::obstacle_avoidance_activate() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f ObstacleAvoidance::do_obstacle_avoidance() {
-  LVecBase3f offset = _ai_char->get_node_path().get_pos() - _nearest_obstacle.get_pos();
+LVecBase3 ObstacleAvoidance::do_obstacle_avoidance() {
+  LVecBase3 offset = _ai_char->get_node_path().get_pos() - _nearest_obstacle.get_pos();
   PT(BoundingVolume) bounds =_nearest_obstacle.get_bounds();
   PT(BoundingVolume) bounds =_nearest_obstacle.get_bounds();
   CPT(BoundingSphere) bsphere = bounds->as_bounding_sphere();
   CPT(BoundingSphere) bsphere = bounds->as_bounding_sphere();
   PT(BoundingVolume) np_bounds = _ai_char->get_node_path().get_bounds();
   PT(BoundingVolume) np_bounds = _ai_char->get_node_path().get_bounds();
   CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere();
   CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere();
   double distance_needed = offset.length() - bsphere->get_radius() - np_sphere->get_radius();
   double distance_needed = offset.length() - bsphere->get_radius() - np_sphere->get_radius();
   if((obstacle_detection())) {
   if((obstacle_detection())) {
-    LVecBase3f direction = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3f::forward());
+    LVecBase3 direction = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3::forward());
     direction.normalize();
     direction.normalize();
     float forward_component = offset.dot(direction);
     float forward_component = offset.dot(direction);
-    LVecBase3f projection = forward_component * direction;
-    LVecBase3f perpendicular_component = offset - projection;
+    LVecBase3 projection = forward_component * direction;
+    LVecBase3 perpendicular_component = offset - projection;
     double p = perpendicular_component.length();
     double p = perpendicular_component.length();
     perpendicular_component.normalize();
     perpendicular_component.normalize();
-    LVecBase3f   avoidance = perpendicular_component;
+    LVecBase3   avoidance = perpendicular_component;
     // The more closer the obstacle, the more force it generates
     // The more closer the obstacle, the more force it generates
     avoidance = (avoidance * _ai_char->get_max_force() * _ai_char->_movt_force) / (p + 0.01);
     avoidance = (avoidance * _ai_char->get_max_force() * _ai_char->_movt_force) / (p + 0.01);
     return avoidance;
     return avoidance;
   }
   }
   _ai_char->_steering->turn_on("obstacle_avoidance_activate");
   _ai_char->_steering->turn_on("obstacle_avoidance_activate");
   _ai_char->_steering->turn_off("obstacle_avoidance");
   _ai_char->_steering->turn_off("obstacle_avoidance");
-  return LVecBase3f(0, 0, 0);
+  return LVecBase3(0, 0, 0);
 }
 }

+ 1 - 1
contrib/src/ai/obstacleAvoidance.h

@@ -30,7 +30,7 @@ class EXPCL_PANDAAI ObstacleAvoidance {
     float _feeler;
     float _feeler;
 
 
     ObstacleAvoidance(AICharacter *ai_char, float feeler_length);
     ObstacleAvoidance(AICharacter *ai_char, float feeler_length);
-    LVecBase3f do_obstacle_avoidance();
+    LVecBase3 do_obstacle_avoidance();
     ~ObstacleAvoidance();
     ~ObstacleAvoidance();
     void obstacle_avoidance_activate();
     void obstacle_avoidance_activate();
     bool obstacle_detection();
     bool obstacle_detection();

+ 3 - 3
contrib/src/ai/pathFind.cxx

@@ -29,7 +29,7 @@ void PathFind::create_nav_mesh(const char* navmesh_filename) {
   // Stage variables.
   // Stage variables.
   int grid_x, grid_y;
   int grid_x, grid_y;
   float l, w, h;
   float l, w, h;
-  LVecBase3f position;
+  LVecBase3 position;
 
 
   // Variable to hold line data read from file.
   // Variable to hold line data read from file.
   string line;
   string line;
@@ -75,7 +75,7 @@ void PathFind::create_nav_mesh(const char* navmesh_filename) {
         l = atof(fields[4].c_str());
         l = atof(fields[4].c_str());
         w = atof(fields[5].c_str());
         w = atof(fields[5].c_str());
         h = atof(fields[6].c_str());
         h = atof(fields[6].c_str());
-        position = LVecBase3f(atof(fields[7].c_str()), atof(fields[8].c_str()), atof(fields[9].c_str()));
+        position = LVecBase3(atof(fields[7].c_str()), atof(fields[8].c_str()), atof(fields[9].c_str()));
 
 
         Node *stage_node = new Node(grid_x, grid_y, position, w, l, h);
         Node *stage_node = new Node(grid_x, grid_y, position, w, l, h);
 
 
@@ -197,7 +197,7 @@ void PathFind::set_path_find(const char* navmesh_filename) {
 ///////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
-void PathFind::path_find(LVecBase3f pos, string type) {
+void PathFind::path_find(LVecBase3 pos, string type) {
   if(type == "addPath") {
   if(type == "addPath") {
     if(_ai_char->_steering->_path_follow_obj) {
     if(_ai_char->_steering->_path_follow_obj) {
       _ai_char->_steering->remove_ai("pathfollow");
       _ai_char->_steering->remove_ai("pathfollow");

+ 2 - 2
contrib/src/ai/pathFind.h

@@ -43,7 +43,7 @@ public:
 
 
   int _grid_size;
   int _grid_size;
   NodePath _path_find_target;
   NodePath _path_find_target;
-  LVecBase3f _prev_position;
+  LVecBase3 _prev_position;
   PT(GeomNode) _parent;
   PT(GeomNode) _parent;
   LineSegs *_pen;
   LineSegs *_pen;
   vector<int> _previous_obstacles;
   vector<int> _previous_obstacles;
@@ -62,7 +62,7 @@ public:
   void clear_previous_obstacles();
   void clear_previous_obstacles();
 
 
   void set_path_find(const char* navmesh_filename);
   void set_path_find(const char* navmesh_filename);
-  void path_find(LVecBase3f pos, string type = "normal");
+  void path_find(LVecBase3 pos, string type = "normal");
   void path_find(NodePath target, string type = "normal");
   void path_find(NodePath target, string type = "normal");
   void add_obstacle_to_mesh(NodePath obstacle);
   void add_obstacle_to_mesh(NodePath obstacle);
   void dynamic_avoid(NodePath obstacle);
   void dynamic_avoid(NodePath obstacle);

+ 2 - 2
contrib/src/ai/pathFollow.cxx

@@ -20,7 +20,7 @@ PathFollow::~PathFollow() {
 
 
 /////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
 
 
-void PathFollow::add_to_path(LVecBase3f pos) {
+void PathFollow::add_to_path(LVecBase3 pos) {
     _path.push_back(pos);
     _path.push_back(pos);
 }
 }
 
 
@@ -119,7 +119,7 @@ void PathFollow::do_follow() {
 
 
 bool PathFollow::check_if_possible() {
 bool PathFollow::check_if_possible() {
   Node* src = find_in_mesh(_ai_char->_steering->_path_find_obj->_nav_mesh, _ai_char->_ai_char_np.get_pos(_ai_char->_window_render), _ai_char->_steering->_path_find_obj->_grid_size);
   Node* src = find_in_mesh(_ai_char->_steering->_path_find_obj->_nav_mesh, _ai_char->_ai_char_np.get_pos(_ai_char->_window_render), _ai_char->_steering->_path_find_obj->_grid_size);
-  LVecBase3f _prev_position = _ai_char->_steering->_path_find_obj->_path_find_target.get_pos(_ai_char->_window_render);
+  LVecBase3 _prev_position = _ai_char->_steering->_path_find_obj->_path_find_target.get_pos(_ai_char->_window_render);
   Node* dst = find_in_mesh(_ai_char->_steering->_path_find_obj->_nav_mesh, _prev_position, _ai_char->_steering->_path_find_obj->_grid_size);
   Node* dst = find_in_mesh(_ai_char->_steering->_path_find_obj->_nav_mesh, _prev_position, _ai_char->_steering->_path_find_obj->_grid_size);
 
 
   if(src && dst) {
   if(src && dst) {

+ 2 - 2
contrib/src/ai/pathFollow.h

@@ -13,7 +13,7 @@ class EXPCL_PANDAAI PathFollow {
 public:
 public:
   AICharacter *_ai_char;
   AICharacter *_ai_char;
   float _follow_weight;
   float _follow_weight;
-  vector<LVecBase3f> _path;
+  vector<LVecBase3> _path;
   int _curr_path_waypoint;
   int _curr_path_waypoint;
   bool _start;
   bool _start;
   NodePath _dummy;
   NodePath _dummy;
@@ -23,7 +23,7 @@ public:
 
 
   PathFollow(AICharacter *ai_ch, float follow_wt);
   PathFollow(AICharacter *ai_ch, float follow_wt);
   ~PathFollow();
   ~PathFollow();
-  void add_to_path(LVecBase3f pos);
+  void add_to_path(LVecBase3 pos);
   void start(string type);
   void start(string type);
   void do_follow();
   void do_follow();
   bool check_if_possible();
   bool check_if_possible();

+ 6 - 6
contrib/src/ai/pursue.cxx

@@ -37,17 +37,17 @@ Pursue::~Pursue() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f Pursue::do_pursue() {
+LVecBase3 Pursue::do_pursue() {
   assert(_pursue_target && "pursue target not assigned");
   assert(_pursue_target && "pursue target not assigned");
 
 
-  LVecBase3f present_pos = _ai_char->_ai_char_np.get_pos(_ai_char->_window_render);
+  LVecBase3 present_pos = _ai_char->_ai_char_np.get_pos(_ai_char->_window_render);
   double target_distance = (_pursue_target.get_pos(_ai_char->_window_render) - present_pos).length();
   double target_distance = (_pursue_target.get_pos(_ai_char->_window_render) - present_pos).length();
 
 
   if(int(target_distance) == 0) {
   if(int(target_distance) == 0) {
     _pursue_done = true;
     _pursue_done = true;
-    _ai_char->_steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
-    _ai_char->_steering->_pursue_force = LVecBase3f(0.0, 0.0, 0.0);
-    return(LVecBase3f(0.0, 0.0, 0.0));
+    _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
+    _ai_char->_steering->_pursue_force = LVecBase3(0.0, 0.0, 0.0);
+    return(LVecBase3(0.0, 0.0, 0.0));
   }
   }
   else {
   else {
     _pursue_done = false;
     _pursue_done = false;
@@ -56,6 +56,6 @@ LVecBase3f Pursue::do_pursue() {
   _pursue_direction = _pursue_target.get_pos(_ai_char->_window_render) - present_pos;
   _pursue_direction = _pursue_target.get_pos(_ai_char->_window_render) - present_pos;
   _pursue_direction.normalize();
   _pursue_direction.normalize();
 
 
-  LVecBase3f desired_force = _pursue_direction * _ai_char->_movt_force;
+  LVecBase3 desired_force = _pursue_direction * _ai_char->_movt_force;
   return(desired_force);
   return(desired_force);
 }
 }

+ 2 - 2
contrib/src/ai/pursue.h

@@ -28,12 +28,12 @@ public:
 
 
   NodePath _pursue_target;
   NodePath _pursue_target;
   float _pursue_weight;
   float _pursue_weight;
-  LVecBase3f _pursue_direction;
+  LVecBase3 _pursue_direction;
   bool _pursue_done;
   bool _pursue_done;
 
 
   Pursue(AICharacter *ai_ch, NodePath target_object, float pursue_wt);
   Pursue(AICharacter *ai_ch, NodePath target_object, float pursue_wt);
   ~Pursue();
   ~Pursue();
-  LVecBase3f do_pursue();
+  LVecBase3 do_pursue();
 };
 };
 
 
 #endif
 #endif

+ 5 - 5
contrib/src/ai/seek.cxx

@@ -27,7 +27,7 @@ Seek::Seek(AICharacter *ai_ch, NodePath target_object, float seek_wt) {
   _seek_done = false;
   _seek_done = false;
 }
 }
 
 
-Seek::Seek(AICharacter *ai_ch, LVecBase3f pos, float seek_wt) {
+Seek::Seek(AICharacter *ai_ch, LVecBase3 pos, float seek_wt) {
       _ai_char = ai_ch;
       _ai_char = ai_ch;
 
 
   _seek_position = pos;
   _seek_position = pos;
@@ -51,16 +51,16 @@ Seek::~Seek() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f Seek::do_seek() {
+LVecBase3 Seek::do_seek() {
   double target_distance = (_seek_position - _ai_char->_ai_char_np.get_pos(_ai_char->_window_render)).length();
   double target_distance = (_seek_position - _ai_char->_ai_char_np.get_pos(_ai_char->_window_render)).length();
 
 
     if(int(target_distance) == 0) {
     if(int(target_distance) == 0) {
         _seek_done = true;
         _seek_done = true;
-    _ai_char->_steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
+    _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
     _ai_char->_steering->turn_off("seek");
     _ai_char->_steering->turn_off("seek");
-    return(LVecBase3f(0.0, 0.0, 0.0));
+    return(LVecBase3(0.0, 0.0, 0.0));
   }
   }
 
 
-  LVecBase3f desired_force = _seek_direction * _ai_char->_movt_force;
+  LVecBase3 desired_force = _seek_direction * _ai_char->_movt_force;
   return(desired_force);
   return(desired_force);
 }
 }

+ 5 - 5
contrib/src/ai/seek.h

@@ -26,16 +26,16 @@ class EXPCL_PANDAAI Seek {
 public:
 public:
   AICharacter *_ai_char;
   AICharacter *_ai_char;
 
 
-  LVecBase3f _seek_position;
+  LVecBase3 _seek_position;
   float _seek_weight;
   float _seek_weight;
-  LVecBase3f _seek_direction;
+  LVecBase3 _seek_direction;
   bool _seek_done;
   bool _seek_done;
-  LVecBase3f _seek_accum_force;
+  LVecBase3 _seek_accum_force;
 
 
   Seek(AICharacter *ai_ch, NodePath target_object, float seek_wt = 1.0);
   Seek(AICharacter *ai_ch, NodePath target_object, float seek_wt = 1.0);
-  Seek(AICharacter *ai_ch, LVecBase3f pos, float seek_wt = 1.0);
+  Seek(AICharacter *ai_ch, LVecBase3 pos, float seek_wt = 1.0);
   ~Seek();
   ~Seek();
-  LVecBase3f do_seek();
+  LVecBase3 do_seek();
 };
 };
 
 
 #endif
 #endif

+ 18 - 18
contrib/src/ai/wander.cxx

@@ -57,23 +57,23 @@ Wander::Wander(AICharacter *ai_ch, double wander_radius,int flag, double aoe, fl
   // default is XY axes
   // default is XY axes
   switch(_flag) {
   switch(_flag) {
     case 0: {
     case 0: {
-              _wander_target = LVecBase3f(_wander_radius * cos(theta), _wander_radius * sin(theta),0);
+              _wander_target = LVecBase3(_wander_radius * cos(theta), _wander_radius * sin(theta),0);
               break;
               break;
             }
             }
     case 1: {
     case 1: {
-              _wander_target = LVecBase3f(0, _wander_radius * cos(theta), _wander_radius * sin(theta));
+              _wander_target = LVecBase3(0, _wander_radius * cos(theta), _wander_radius * sin(theta));
               break;
               break;
             }
             }
     case 2: {
     case 2: {
-              _wander_target = LVecBase3f(_wander_radius * cos(theta), 0,  _wander_radius * sin(theta));
+              _wander_target = LVecBase3(_wander_radius * cos(theta), 0,  _wander_radius * sin(theta));
               break;
               break;
             }
             }
     case 3: {
     case 3: {
-              _wander_target = LVecBase3f(_wander_radius * sin(theta) * cos(si), _wander_radius * sin(theta) * sin(si), _wander_radius * cos(theta));
+              _wander_target = LVecBase3(_wander_radius * sin(theta) * cos(si), _wander_radius * sin(theta) * sin(si), _wander_radius * cos(theta));
               break;
               break;
             }
             }
     default: {
     default: {
-              _wander_target = LVecBase3f(_wander_radius * cos(theta), _wander_radius * sin(theta),0);
+              _wander_target = LVecBase3(_wander_radius * cos(theta), _wander_radius * sin(theta),0);
               break;
               break;
              }
              }
   }
   }
@@ -91,52 +91,52 @@ Wander::~Wander() {
 
 
 /////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
 
 
-LVecBase3f Wander::do_wander() {
-  LVecBase3f present_pos = _ai_char->get_node_path().get_pos(_ai_char->get_char_render());
+LVecBase3 Wander::do_wander() {
+  LVecBase3 present_pos = _ai_char->get_node_path().get_pos(_ai_char->get_char_render());
   // Create the random slices to enable random movement of wander for x,y,z respectively
   // Create the random slices to enable random movement of wander for x,y,z respectively
   double time_slice_1 = random_clamped() * 1.5;
   double time_slice_1 = random_clamped() * 1.5;
   double time_slice_2 = random_clamped() * 1.5;
   double time_slice_2 = random_clamped() * 1.5;
   double time_slice_3 = random_clamped() * 1.5;
   double time_slice_3 = random_clamped() * 1.5;
   switch(_flag) {
   switch(_flag) {
   case 0: {
   case 0: {
-            _wander_target += LVecBase3f(time_slice_1, time_slice_2, 0);
+            _wander_target += LVecBase3(time_slice_1, time_slice_2, 0);
             break;
             break;
           }
           }
   case 1: {
   case 1: {
-            _wander_target += LVecBase3f(0, time_slice_1, time_slice_2);
+            _wander_target += LVecBase3(0, time_slice_1, time_slice_2);
             break;
             break;
           }
           }
   case 2: {
   case 2: {
-            _wander_target += LVecBase3f(time_slice_1, 0, time_slice_2);
+            _wander_target += LVecBase3(time_slice_1, 0, time_slice_2);
             break;
             break;
           }
           }
   case 3: {
   case 3: {
-            _wander_target += LVecBase3f(time_slice_1, time_slice_2, time_slice_3);
+            _wander_target += LVecBase3(time_slice_1, time_slice_2, time_slice_3);
             break;
             break;
           }
           }
 
 
   default: {
   default: {
-            _wander_target = LVecBase3f(time_slice_1, time_slice_2, 0);
+            _wander_target = LVecBase3(time_slice_1, time_slice_2, 0);
            }
            }
   }
   }
   _wander_target.normalize();
   _wander_target.normalize();
   _wander_target *= _wander_radius;
   _wander_target *= _wander_radius;
-  LVecBase3f target = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3f::forward());
+  LVecBase3 target = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3::forward());
   target.normalize();
   target.normalize();
   // Project wander target onto global space
   // Project wander target onto global space
   target = _wander_target + target;
   target = _wander_target + target;
-  LVecBase3f desired_target = present_pos + target;
-  LVecBase3f desired_force = desired_target - _ai_char->get_node_path().get_pos() ;
+  LVecBase3 desired_target = present_pos + target;
+  LVecBase3 desired_force = desired_target - _ai_char->get_node_path().get_pos() ;
   desired_force.normalize();
   desired_force.normalize();
   desired_force *= _ai_char->_movt_force;
   desired_force *= _ai_char->_movt_force;
   double distance = (present_pos - _init_pos).length();
   double distance = (present_pos - _init_pos).length();
   if(_area_of_effect > 0 && distance > _area_of_effect) {
   if(_area_of_effect > 0 && distance > _area_of_effect) {
-    LVecBase3f direction = present_pos - _init_pos;
+    LVecBase3 direction = present_pos - _init_pos;
     direction.normalize();
     direction.normalize();
     desired_force =  - direction * _ai_char->_movt_force;
     desired_force =  - direction * _ai_char->_movt_force;
-    LVecBase3f dirn = _ai_char->_steering->_steering_force;
+    LVecBase3 dirn = _ai_char->_steering->_steering_force;
     dirn.normalize();
     dirn.normalize();
-    _ai_char->_steering->_steering_force = LVecBase3f(0.0, 0.0, 0.0);
+    _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
   }
   }
   return desired_force;
   return desired_force;
 }
 }

+ 3 - 3
contrib/src/ai/wander.h

@@ -24,14 +24,14 @@ class EXPCL_PANDAAI Wander {
   public:
   public:
     AICharacter *_ai_char;
     AICharacter *_ai_char;
     double _wander_radius;
     double _wander_radius;
-    LVecBase3f _wander_target;
+    LVecBase3 _wander_target;
     float _wander_weight;
     float _wander_weight;
     int _flag;
     int _flag;
-    LVecBase3f _init_pos;
+    LVecBase3 _init_pos;
     double _area_of_effect;
     double _area_of_effect;
 
 
     Wander(AICharacter *ai_ch, double wander_radius, int flag, double aoe, float wander_weight);
     Wander(AICharacter *ai_ch, double wander_radius, int flag, double aoe, float wander_weight);
-    LVecBase3f do_wander();
+    LVecBase3 do_wander();
     ~Wander();
     ~Wander();
 };
 };
 
 

+ 4 - 13
contrib/src/contribbase/contribsymbols.h

@@ -22,21 +22,12 @@
    C++-style comments, since this file is occasionally included by a C
    C++-style comments, since this file is occasionally included by a C
    file. */
    file. */
 
 
-#if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
-
 #ifdef BUILDING_PANDAAI
 #ifdef BUILDING_PANDAAI
-  #define EXPCL_PANDAAI __declspec(dllexport)
-  #define EXPTP_PANDAAI
+  #define EXPCL_PANDAAI EXPORT_CLASS
+  #define EXPTP_PANDAAI EXPORT_TEMPL
 #else
 #else
-  #define EXPCL_PANDAAI __declspec(dllimport)
-  #define EXPTP_PANDAAI extern
+  #define EXPCL_PANDAAI IMPORT_CLASS
+  #define EXPTP_PANDAAI IMPORT_TEMPL
 #endif
 #endif
 
 
-#else   /* !WIN32_VC */
-
-#define EXPCL_PANDAAI
-#define EXPTP_PANDAAI
-
-#endif  /* WIN32_VC */
-
 #endif
 #endif

+ 1 - 0
contrib/src/panda3dtoolsgui/build_exe.bat

@@ -1,4 +1,5 @@
 *.pyc
 *.pyc
+*.pyo
 /__init__.py
 /__init__.py
 # These are files that are generated within the source tree by the
 # These are files that are generated within the source tree by the
 # ppremake system.
 # ppremake system.

+ 4 - 9
direct/src/actor/Actor.py

@@ -2,17 +2,17 @@
 
 
 __all__ = ['Actor']
 __all__ = ['Actor']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-from pandac.PandaModules import LODNode
-import types, copy
+from direct.directnotify import DirectNotifyGlobal
+import types
 
 
 class Actor(DirectObject, NodePath):
 class Actor(DirectObject, NodePath):
     """
     """
     Actor class: Contains methods for creating, manipulating
     Actor class: Contains methods for creating, manipulating
     and playing animations on characters
     and playing animations on characters
     """
     """
-    notify = directNotify.newCategory("Actor")
+    notify = DirectNotifyGlobal.directNotify.newCategory("Actor")
     partPrefix = "__Actor_"
     partPrefix = "__Actor_"
 
 
     modelLoaderOptions = LoaderOptions(LoaderOptions.LFSearch |
     modelLoaderOptions = LoaderOptions(LoaderOptions.LFSearch |
@@ -1019,11 +1019,6 @@ class Actor(DirectObject, NodePath):
         if (partName in partDict):
         if (partName in partDict):
             del(partDict[partName])
             del(partDict[partName])
 
 
-        # remove the bundle handle, in case this part is ever
-        # loaded again in the future
-        if partName in self.__commonBundleHandles:
-            del self.__commonBundleHandles[partName]
-
     def hidePart(self, partName, lodName="lodRoot"):
     def hidePart(self, partName, lodName="lodRoot"):
         """
         """
         Make the given part of the optionally given lod not render,
         Make the given part of the optionally given lod not render,

+ 1 - 1
direct/src/cluster/ClusterClient.py

@@ -1,6 +1,6 @@
 """ClusterClient: Master for mutli-piping or PC clusters.  """
 """ClusterClient: Master for mutli-piping or PC clusters.  """
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from ClusterMsgs import *
 from ClusterMsgs import *
 from ClusterConfig import *
 from ClusterConfig import *
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal

+ 0 - 1
direct/src/cluster/ClusterConfig.py

@@ -1,6 +1,5 @@
 
 
 from ClusterClient import *
 from ClusterClient import *
-import string
 
 
 # A dictionary of information for various cluster configurations.
 # A dictionary of information for various cluster configurations.
 # Dictionary is keyed on cluster-config string
 # Dictionary is keyed on cluster-config string

+ 1 - 1
direct/src/cluster/ClusterMsgs.py

@@ -3,7 +3,7 @@
 # This module is intended to supply routines and dataformats common to
 # This module is intended to supply routines and dataformats common to
 # both ClusterClient and ClusterServer.
 # both ClusterClient and ClusterServer.
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from direct.distributed.PyDatagram import PyDatagram
 from direct.distributed.PyDatagram import PyDatagram
 from direct.distributed.PyDatagramIterator import PyDatagramIterator
 from direct.distributed.PyDatagramIterator import PyDatagramIterator
 import time
 import time

+ 1 - 1
direct/src/cluster/ClusterServer.py

@@ -1,4 +1,4 @@
-from pandac.PandaModules import *
+from panda3d.core import *
 from ClusterMsgs import *
 from ClusterMsgs import *
 from direct.distributed.MsgTypes import *
 from direct.distributed.MsgTypes import *
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal

+ 3 - 7
direct/src/controls/GravityWalker.py

@@ -179,9 +179,9 @@ class GravityWalker(DirectObject.DirectObject):
         # a higher or lower value depending on whether you want an avatar
         # a higher or lower value depending on whether you want an avatar
         # that is outside of the world to step up to the floor when they
         # that is outside of the world to step up to the floor when they
         # get under valid floor:
         # get under valid floor:
-        cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
+        self.cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
         cRayNode = CollisionNode('GW.cRayNode')
         cRayNode = CollisionNode('GW.cRayNode')
-        cRayNode.addSolid(cRay)
+        cRayNode.addSolid(self.cRay)
         self.cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)
         self.cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)
         cRayNode.setFromCollideMask(bitmask)
         cRayNode.setFromCollideMask(bitmask)
         cRayNode.setIntoCollideMask(BitMask32.allOff())
         cRayNode.setIntoCollideMask(BitMask32.allOff())
@@ -697,8 +697,4 @@ class GravityWalker(DirectObject.DirectObject):
     # There are sometimes issues if the collision ray height is
     # There are sometimes issues if the collision ray height is
     # so tall that it collides with multiple levels of floors.
     # so tall that it collides with multiple levels of floors.
     def setCollisionRayHeight(self, height):
     def setCollisionRayHeight(self, height):
-        oldNode = self.avatarNodePath.getNode(0)
-        cRayNode = oldNode.getChild(2)
-        cRayNode.removeSolid(0)
-        cRay = CollisionRay(0.0, 0.0, height, 0.0, 0.0, -1.0)
-        cRayNode.addSolid(cRay)        
+        self.cRay.setOrigin(0.0, 0.0, height)

+ 4 - 0
direct/src/dcparser/dcPackData.I

@@ -20,6 +20,10 @@
 #include "dcSwitchParameter.h"
 #include "dcSwitchParameter.h"
 #include "dcClass.h"
 #include "dcClass.h"
 
 
+#ifdef HAVE_PYTHON
+#include "py_panda.h"
+#endif
+
 DCPacker::StackElement *DCPacker::StackElement::_deleted_chain = NULL;
 DCPacker::StackElement *DCPacker::StackElement::_deleted_chain = NULL;
 int DCPacker::StackElement::_num_ever_allocated = 0;
 int DCPacker::StackElement::_num_ever_allocated = 0;
 
 

+ 1 - 1
direct/src/dcparser/dcPacker.h

@@ -220,7 +220,7 @@ private:
   const DCPackerCatalog *_catalog;
   const DCPackerCatalog *_catalog;
   const DCPackerCatalog::LiveCatalog *_live_catalog;
   const DCPackerCatalog::LiveCatalog *_live_catalog;
 
 
-  class StackElement {
+  class EXPCL_DIRECT StackElement {
   public:
   public:
     // As an optimization, we implement operator new and delete here
     // As an optimization, we implement operator new and delete here
     // to minimize allocation overhead during push() and pop().
     // to minimize allocation overhead during push() and pop().

+ 2 - 1
direct/src/dcparser/dcPackerInterface.cxx

@@ -1,4 +1,5 @@
-print 'DirectStart: Starting the game.'
+__all__ = []
+print('Using deprecated DirectStart interface.')
 
 
 from direct.showbase import ShowBase
 from direct.showbase import ShowBase
 base = ShowBase.ShowBase()
 base = ShowBase.ShowBase()

+ 3 - 3
direct/src/directbase/TestStart.py

@@ -1,10 +1,10 @@
-print 'TestStart: Starting up test environment.'
+print('TestStart: Starting up test environment.')
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 
 
 from direct.showbase.PythonUtil import *
 from direct.showbase.PythonUtil import *
 from direct.showbase import ShowBase
 from direct.showbase import ShowBase
-ShowBase.ShowBase()
+base = ShowBase.ShowBase()
 
 
 # Put an axis in the world:
 # Put an axis in the world:
 loader.loadModel("models/misc/xyzAxis").reparentTo(render)
 loader.loadModel("models/misc/xyzAxis").reparentTo(render)

+ 4 - 13
direct/src/directbase/directsymbols.h

@@ -17,21 +17,12 @@
 
 
 /* See dtoolsymbols.h for a rant on the purpose of this file.  */
 /* See dtoolsymbols.h for a rant on the purpose of this file.  */
 
 
-#if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
-
 #ifdef BUILDING_DIRECT
 #ifdef BUILDING_DIRECT
-  #define EXPCL_DIRECT __declspec(dllexport)
-  #define EXPTP_DIRECT
+  #define EXPCL_DIRECT EXPORT_CLASS
+  #define EXPTP_DIRECT EXPORT_TEMPL
 #else
 #else
-  #define EXPCL_DIRECT __declspec(dllimport)
-  #define EXPTP_DIRECT extern
+  #define EXPCL_DIRECT IMPORT_CLASS
+  #define EXPTP_DIRECT IMPORT_TEMPL
 #endif
 #endif
 
 
-#else   /* !WIN32_VC */
-
-#define EXPCL_DIRECT
-#define EXPTP_DIRECT
-
-#endif  /* WIN32_VC */
-
 #endif
 #endif

+ 5 - 3
direct/src/directbase/ppython.cxx

@@ -7,6 +7,8 @@
 //
 //
 ///////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////
 
 
+#include "dtoolbase.h"
+
 #include <Python.h>
 #include <Python.h>
 #if PY_MAJOR_VERSION >= 3
 #if PY_MAJOR_VERSION >= 3
 #include <wchar.h>
 #include <wchar.h>
@@ -71,7 +73,7 @@ int main(int argc, char *argv[]) {
   char *path = getenv("PATH");
   char *path = getenv("PATH");
   char *result = strtok(path, ";");
   char *result = strtok(path, ";");
   while (result != NULL) {
   while (result != NULL) {
-    struct stat st;       
+    struct stat st;
     char *ppython = (char*) malloc(strlen(result) + 13);
     char *ppython = (char*) malloc(strlen(result) + 13);
     strcpy(ppython, result);
     strcpy(ppython, result);
     strcat(ppython, "\\ppython.exe");
     strcat(ppython, "\\ppython.exe");
@@ -79,13 +81,13 @@ int main(int argc, char *argv[]) {
       Py_SetPythonHome(result);
       Py_SetPythonHome(result);
       free(ppython);
       free(ppython);
       break;
       break;
-    }                                
+    }
     result = strtok(NULL, ";");
     result = strtok(NULL, ";");
     free(ppython);
     free(ppython);
   }
   }
 #endif
 #endif
 #endif
 #endif
-  
+
   Py_Initialize();
   Py_Initialize();
 
 
   if (Py_VerboseFlag) {
   if (Py_VerboseFlag) {

+ 2 - 16
direct/src/directdevices/DirectDeviceManager.py

@@ -1,7 +1,8 @@
 """ Class used to create and control vrpn devices """
 """ Class used to create and control vrpn devices """
 
 
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-from pandac.PandaModules import *
+from panda3d.core import *
+from panda3d.vrpn import *
 
 
 ANALOG_MIN = -0.95
 ANALOG_MIN = -0.95
 ANALOG_MAX = 0.95
 ANALOG_MAX = 0.95
@@ -294,18 +295,3 @@ class DirectTimecodeReader(AnalogNode, DirectObject):
     def __repr__(self):
     def __repr__(self):
         str = ('%s: %d:%d:%d:%d' % ((self.name,) + self.getTime()[:-1]))
         str = ('%s: %d:%d:%d:%d' % ((self.name,) + self.getTime()[:-1]))
         return str
         return str
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 2 - 0
direct/src/directnotify/DirectNotifyGlobal.py

@@ -1,5 +1,7 @@
 """instantiate global DirectNotify used in Direct"""
 """instantiate global DirectNotify used in Direct"""
 
 
+__all__ = ['directNotify', 'giveNotify']
+
 import DirectNotify
 import DirectNotify
 
 
 directNotify = DirectNotify.DirectNotify()
 directNotify = DirectNotify.DirectNotify()

+ 0 - 1
direct/src/directnotify/Logger.py

@@ -1,7 +1,6 @@
 """Logger module: contains the logger class which creates and writes
 """Logger module: contains the logger class which creates and writes
    data to log files on disk"""
    data to log files on disk"""
 
 
-import sys
 import time
 import time
 import math
 import math
 
 

+ 0 - 1
direct/src/directnotify/Notifier.py

@@ -6,7 +6,6 @@ from LoggerGlobal import defaultLogger
 from direct.showbase import PythonUtil
 from direct.showbase import PythonUtil
 from panda3d.core import ConfigVariableBool, NotifyCategory, StreamWriter, Notify
 from panda3d.core import ConfigVariableBool, NotifyCategory, StreamWriter, Notify
 import time
 import time
-import types
 import sys
 import sys
 
 
 class Notifier:
 class Notifier:

+ 2 - 2
direct/src/directscripts/Doxyfile.python

@@ -760,13 +760,13 @@ STRIP_CODE_COMMENTS    = YES
 # then for each documented function all documented 
 # then for each documented function all documented 
 # functions referencing it will be listed.
 # functions referencing it will be listed.
 
 
-REFERENCED_BY_RELATION = YES
+REFERENCED_BY_RELATION = NO
 
 
 # If the REFERENCES_RELATION tag is set to YES 
 # If the REFERENCES_RELATION tag is set to YES 
 # then for each documented function all documented entities 
 # then for each documented function all documented entities 
 # called/used by that function will be listed.
 # called/used by that function will be listed.
 
 
-REFERENCES_RELATION    = YES
+REFERENCES_RELATION    = NO
 
 
 # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
 # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
 # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
 # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 

+ 1 - 1
direct/src/directscripts/doxygen_filter.py

@@ -2,7 +2,7 @@
 doxygen can understand and process.  It can be used
 doxygen can understand and process.  It can be used
 as an INPUT_FILTER in doxygen. """
 as an INPUT_FILTER in doxygen. """
 
 
-import sys, re, os
+import sys, os
 
 
 # Explicitly include these files.  Besides these, all
 # Explicitly include these files.  Besides these, all
 # files ending in _src will be explicitly included too.
 # files ending in _src will be explicitly included too.

+ 5 - 7
direct/src/directscripts/eggcacher.py

@@ -9,15 +9,15 @@
 ##############################################################################
 ##############################################################################
 
 
 import os,sys,gc
 import os,sys,gc
-from pandac.PandaModules import *
+from panda3d.core import *
 
 
 class EggCacher:
 class EggCacher:
     def __init__(self, args):
     def __init__(self, args):
         maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath()
         maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath()
         ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir)
         ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir)
         self.bamcache = BamCache.getGlobalPtr()
         self.bamcache = BamCache.getGlobalPtr()
-        self.pandaloader = PandaLoader()
-        self.loaderopts = LoaderOptions()
+        self.pandaloader = Loader()
+        self.loaderopts = LoaderOptions(LoaderOptions.LF_no_ram_cache)
         if (self.bamcache.getActive() == 0):
         if (self.bamcache.getActive() == 0):
             print "The model cache is not currently active."
             print "The model cache is not currently active."
             print "You must set a model-cache-dir in your config file."
             print "You must set a model-cache-dir in your config file."
@@ -69,12 +69,12 @@ class EggCacher:
 
 
     def processFiles(self, files):
     def processFiles(self, files):
         total = 0
         total = 0
-        for (path,size) in files:
+        for (path, size) in files:
             total += size
             total += size
         progress = 0
         progress = 0
         for (path,size) in files:
         for (path,size) in files:
             fn = Filename.fromOsSpecific(path)
             fn = Filename.fromOsSpecific(path)
-            cached = self.bamcache.lookup(fn,"bam")
+            cached = self.bamcache.lookup(fn, "bam")
             percent = (progress * 100) / total
             percent = (progress * 100) / total
             report = path
             report = path
             if (self.concise): report = os.path.basename(report)
             if (self.concise): report = os.path.basename(report)
@@ -87,6 +87,4 @@ class EggCacher:
             TexturePool.releaseAllTextures()
             TexturePool.releaseAllTextures()
             progress += size
             progress += size
 
 
-
 cacher = EggCacher(sys.argv[1:])
 cacher = EggCacher(sys.argv[1:])
-

+ 122 - 52
direct/src/directscripts/extract_docs.py

@@ -7,7 +7,7 @@ files in the lib/pandac/input directory. """
 
 
 __all__ = []
 __all__ = []
 
 
-import os, re
+import os
 import panda3d, pandac
 import panda3d, pandac
 from panda3d.dtoolconfig import *
 from panda3d.dtoolconfig import *
 
 
@@ -30,6 +30,7 @@ def comment(code):
             if empty_line:
             if empty_line:
                 # New paragraph.
                 # New paragraph.
                 comment += '\n\n'
                 comment += '\n\n'
+                empty_line = False
             elif comment:
             elif comment:
                 comment += '\n'
                 comment += '\n'
             comment += '/// ' + line
             comment += '/// ' + line
@@ -56,15 +57,29 @@ def block_comment(code):
 
 
         line = line.rstrip()
         line = line.rstrip()
         strline = line.lstrip('/ \t')
         strline = line.lstrip('/ \t')
-        if reading_desc:
-            newlines.append('/// ' + line[min(indent, len(line) - len(strline)):])
-        else:
-            # A "Description:" text starts the description.
-            if strline.startswith("Description"):
-                strline = strline[11:].lstrip(': \t')
-                indent = len(line) - len(strline)
-                reading_desc = True
-                newlines.append('/// ' + strline)
+
+        if ':' in strline:
+            pre, post = strline.split(':', 1)
+            pre = pre.rstrip()
+            if pre == "Description":
+                strline = post.lstrip()
+            elif pre in ("Class", "Access", "Function", "Created by", "Enum"):
+                continue
+
+        if strline or len(newlines) > 0:
+            newlines.append('/// ' + strline)
+
+        #if reading_desc:
+        #    newlines.append('/// ' + line[min(indent, len(line) - len(strline)):])
+        #else:
+        #    # A "Description:" text starts the description.
+        #    if strline.startswith("Description"):
+        #        strline = strline[11:].lstrip(': \t')
+        #        indent = len(line) - len(strline)
+        #        reading_desc = True
+        #        newlines.append('/// ' + strline)
+        #    else:
+        #        print line
 
 
     newcode = '\n'.join(newlines)
     newcode = '\n'.join(newlines)
     if len(newcode) > 0:
     if len(newcode) > 0:
@@ -73,6 +88,9 @@ def block_comment(code):
         return ""
         return ""
 
 
 def translateFunctionName(name):
 def translateFunctionName(name):
+    if name.startswith("__"):
+        return name
+
     new = ""
     new = ""
     for i in name.split("_"):
     for i in name.split("_"):
         if new == "":
         if new == "":
@@ -85,32 +103,62 @@ def translateFunctionName(name):
             new += i[0].upper() + i[1:]
             new += i[0].upper() + i[1:]
     return new
     return new
 
 
-def translated_type_name(type):
+def translateTypeName(name, mangle=True):
+    # Equivalent to C++ classNameFromCppName
+    class_name = ""
+    bad_chars = "!@#$%^&*()<>,.-=+~{}? "
+    next_cap = False
+    first_char = mangle
+
+    for chr in name:
+        if (chr == '_' or chr == ' ') and mangle:
+            next_cap = True
+        elif chr in bad_chars:
+            if not mangle:
+                class_name += '_'
+        elif next_cap or first_char:
+            class_name += chr.upper()
+            next_cap = False
+            first_char = False
+        else:
+            class_name += chr
+
+    return class_name
+
+def translated_type_name(type, scoped=True):
+    while interrogate_type_is_wrapped(type):
+        if interrogate_type_is_const(type):
+            return 'const ' + translated_type_name(interrogate_type_wrapped_type(type))
+        else:
+            type = interrogate_type_wrapped_type(type)
+
+    typename = interrogate_type_name(type)
+    if typename in ("PyObject", "_object"):
+        return "object"
+    elif typename == "PN_stdfloat":
+        return "float"
+
     if interrogate_type_is_atomic(type):
     if interrogate_type_is_atomic(type):
         token = interrogate_type_atomic_token(type)
         token = interrogate_type_atomic_token(type)
         if token == 7:
         if token == 7:
             return 'str'
             return 'str'
+        else:
+            return typename
 
 
-    typename = interrogate_type_name(type)
-    typename = typename.replace("< ", "").replace(" >", "")
-    return typename
-
-def translateTypeSpec(name):
-    name = name.strip("* ")
-    name = name.replace("BitMask< unsigned int, 32 >", "BitMask32")
-    name = name.replace("atomic ", "")
-    name = name.replace("< ", "").replace(" >", "")
-    if name == '_object':
-        name = 'object'
-    elif name == '_typeobject':
-        name = 'type'
-    return name
+    if not typename.endswith('_t'):
+        # Hack: don't mangle size_t etc.
+        typename = translateTypeName(typename)
+
+    if scoped and interrogate_type_is_nested(type):
+        return translated_type_name(interrogate_type_outer_class(type)) + '::' + typename
+    else:
+        return typename
 
 
 def processElement(handle, element):
 def processElement(handle, element):
     if interrogate_element_has_comment(element):
     if interrogate_element_has_comment(element):
         print >>handle, comment(interrogate_element_comment(element))
         print >>handle, comment(interrogate_element_comment(element))
 
 
-    print >>handle, translateTypeSpec(translated_type_name(interrogate_element_type(element))),
+    print >>handle, translated_type_name(interrogate_element_type(element)),
     print >>handle, interrogate_element_name(element) + ';'
     print >>handle, interrogate_element_name(element) + ';'
 
 
 def processFunction(handle, function, isConstructor = False):
 def processFunction(handle, function, isConstructor = False):
@@ -120,11 +168,12 @@ def processFunction(handle, function, isConstructor = False):
             print >>handle, block_comment(interrogate_wrapper_comment(wrapper))
             print >>handle, block_comment(interrogate_wrapper_comment(wrapper))
         
         
         if not isConstructor:
         if not isConstructor:
-            if not interrogate_wrapper_number_of_parameters(wrapper) > 0 or not interrogate_wrapper_parameter_is_this(wrapper, 0):
-                print >>handle, "static",
+            if interrogate_function_is_method(function):
+                if not interrogate_wrapper_number_of_parameters(wrapper) > 0 or not interrogate_wrapper_parameter_is_this(wrapper, 0):
+                    print >>handle, "static",
             
             
             if interrogate_wrapper_has_return_value(wrapper):
             if interrogate_wrapper_has_return_value(wrapper):
-                print >>handle, translateTypeSpec(translated_type_name(interrogate_wrapper_return_type(wrapper))),
+                print >>handle, translated_type_name(interrogate_wrapper_return_type(wrapper)),
             else:
             else:
                 pass#print >>handle, "void",
                 pass#print >>handle, "void",
 
 
@@ -137,7 +186,7 @@ def processFunction(handle, function, isConstructor = False):
             if not interrogate_wrapper_parameter_is_this(wrapper, i_param):
             if not interrogate_wrapper_parameter_is_this(wrapper, i_param):
                 if not first:
                 if not first:
                     print >>handle, ",",
                     print >>handle, ",",
-                print >>handle, translateTypeSpec(translated_type_name(interrogate_wrapper_parameter_type(wrapper, i_param))),
+                print >>handle, translated_type_name(interrogate_wrapper_parameter_type(wrapper, i_param)),
                 if interrogate_wrapper_parameter_has_name(wrapper, i_param):
                 if interrogate_wrapper_parameter_has_name(wrapper, i_param):
                     print >>handle, interrogate_wrapper_parameter_name(wrapper, i_param),
                     print >>handle, interrogate_wrapper_parameter_name(wrapper, i_param),
                 first = False
                 first = False
@@ -145,7 +194,7 @@ def processFunction(handle, function, isConstructor = False):
         print >>handle, ");"
         print >>handle, ");"
 
 
 def processType(handle, type):
 def processType(handle, type):
-    typename = translated_type_name(type)
+    typename = translated_type_name(type, scoped=False)
     derivations = [ translated_type_name(interrogate_type_get_derivation(type, n)) for n in range(interrogate_type_number_of_derivations(type)) ]
     derivations = [ translated_type_name(interrogate_type_get_derivation(type, n)) for n in range(interrogate_type_number_of_derivations(type)) ]
     
     
     if interrogate_type_has_comment(type):
     if interrogate_type_has_comment(type):
@@ -157,7 +206,12 @@ def processType(handle, type):
             docstring = comment(interrogate_type_enum_value_comment(type, i_value))
             docstring = comment(interrogate_type_enum_value_comment(type, i_value))
             if docstring:
             if docstring:
                 print >>handle, docstring
                 print >>handle, docstring
-            print >>handle, translateFunctionName(interrogate_type_enum_value_name(type, i_value)), "=", interrogate_type_enum_value(type, i_value), ","
+            print >>handle, interrogate_type_enum_value_name(type, i_value), "=", interrogate_type_enum_value(type, i_value), ","
+
+    elif interrogate_type_is_typedef(type):
+        wrapped_type = translated_type_name(interrogate_type_wrapped_type(type))
+        print >>handle, "typedef %s %s;" % (wrapped_type, typename)
+        return
     else:
     else:
         if interrogate_type_is_struct(type):
         if interrogate_type_is_struct(type):
             classtype = "struct"
             classtype = "struct"
@@ -166,7 +220,7 @@ def processType(handle, type):
         elif interrogate_type_is_union(type):
         elif interrogate_type_is_union(type):
             classtype = "union"
             classtype = "union"
         else:
         else:
-            print "I don't know what type %s is" % typename
+            print "I don't know what type %s is" % interrogate_type_true_name(type)
             return
             return
         
         
         if len(derivations) > 0:
         if len(derivations) > 0:
@@ -192,38 +246,54 @@ def processType(handle, type):
     
     
     print >>handle, "};"
     print >>handle, "};"
 
 
+def processModule(handle, package):
+    print >>handle, "namespace %s {" % package
+
+    if package != "core":
+        print >>handle, "using namespace core;"
+
+    for i_type in xrange(interrogate_number_of_global_types()):
+        type = interrogate_get_global_type(i_type)
+
+        if interrogate_type_has_module_name(type):
+            module_name = interrogate_type_module_name(type)
+            if "panda3d." + package == module_name:
+                processType(handle, type)
+        else:
+            print "Type %s has no module name" % typename
+
+    for i_func in xrange(interrogate_number_of_global_functions()):
+        func = interrogate_get_global_function(i_func)
+
+        if interrogate_function_has_module_name(func):
+            module_name = interrogate_function_module_name(func)
+            if "panda3d." + package == module_name:
+                processFunction(handle, func)
+        else:
+            print "Type %s has no module name" % typename
+
+    print >>handle, "}"
+
+
 if __name__ == "__main__":
 if __name__ == "__main__":
     handle = open("pandadoc.hpp", "w")
     handle = open("pandadoc.hpp", "w")
     
     
     print >>handle, comment("Panda3D modules that are implemented in C++.")
     print >>handle, comment("Panda3D modules that are implemented in C++.")
-    print >>handle, "namespace panda3d {}"
+    print >>handle, "namespace panda3d {"
     
     
     # Determine the path to the interrogatedb files
     # Determine the path to the interrogatedb files
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "..", "..", "etc"))
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "..", "..", "etc"))
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "input"))
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "input"))
 
 
     import panda3d.core
     import panda3d.core
+    processModule(handle, "core")
 
 
     for lib in os.listdir(os.path.dirname(panda3d.__file__)):
     for lib in os.listdir(os.path.dirname(panda3d.__file__)):
         if lib.endswith(('.pyd', '.so')) and not lib.startswith('core.'):
         if lib.endswith(('.pyd', '.so')) and not lib.startswith('core.'):
-            __import__('panda3d.' + os.path.splitext(lib)[0])
+            module_name = os.path.splitext(lib)[0]
+            __import__("panda3d." + module_name)
+            processModule(handle, module_name)
 
 
-    lastpkg = None
-    for i_type in xrange(interrogate_number_of_global_types()):
-        type = interrogate_get_global_type(i_type)
 
 
-        if interrogate_type_has_module_name(type):
-            package = interrogate_type_module_name(type)
-            if lastpkg != package:
-                if lastpkg is not None:
-                    print >>handle, "}"
-                print >>handle, "namespace %s {" % package
-                lastpkg = package
-
-            processType(handle, type)
-        else:
-            print "Type %s has no module name" % typename
-    
-    if lastpkg is not None:
-        print >>handle, "}"
+    print >>handle, "}"
     handle.close()
     handle.close()

+ 1 - 1
direct/src/directtools/DirectCameraControl.py

@@ -222,7 +222,7 @@ class DirectCameraControl(DirectObject):
             skipFlags |= SKIP_CAMERA * (1 - base.getControl())
             skipFlags |= SKIP_CAMERA * (1 - base.getControl())
             self.computeCOA(base.direct.iRay.pickGeom(skipFlags = skipFlags))
             self.computeCOA(base.direct.iRay.pickGeom(skipFlags = skipFlags))
             # Record reference point
             # Record reference point
-            self.coaMarkerRef.iPosHprScale(base.cam)
+            self.coaMarkerRef.setPosHprScale(base.cam, 0, 0, 0, 0, 0, 0, 1, 1, 1)
             # Record entries
             # Record entries
             self.cqEntries = []
             self.cqEntries = []
             for i in range(base.direct.iRay.getNumEntries()):
             for i in range(base.direct.iRay.getNumEntries()):

+ 1 - 1
direct/src/directtools/DirectGeometry.py

@@ -1,5 +1,5 @@
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from DirectGlobals import *
 from DirectGlobals import *
 from DirectUtil import *
 from DirectUtil import *
 import math
 import math

+ 1 - 1
direct/src/directtools/DirectGlobals.py

@@ -1,4 +1,4 @@
-from pandac.PandaModules import Vec3, Point3, BitMask32
+from panda3d.core import Vec3, Point3, BitMask32
 
 
 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible',
 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible',
               'GridBack', 'unpickable']
               'GridBack', 'unpickable']

+ 1 - 1
direct/src/directtools/DirectGrid.py

@@ -1,5 +1,5 @@
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from DirectUtil import *
 from DirectUtil import *
 from DirectGeometry import *
 from DirectGeometry import *

+ 1 - 1
direct/src/directtools/DirectLights.py

@@ -1,5 +1,5 @@
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from string import lower
 from string import lower
 
 
 class DirectLight(NodePath):
 class DirectLight(NodePath):

+ 7 - 9
direct/src/directtools/DirectSession.py

@@ -2,7 +2,7 @@ import math
 import types
 import types
 import string
 import string
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 from DirectUtil import *
 from DirectUtil import *
 
 
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
@@ -304,6 +304,7 @@ class DirectSession(DirectObject):
         except NameError:
         except NameError:
             # Has the clusterMode been set via a config variable?
             # Has the clusterMode been set via a config variable?
             self.clusterMode = base.config.GetString("cluster-mode", '')
             self.clusterMode = base.config.GetString("cluster-mode", '')
+
         if self.clusterMode == 'client':
         if self.clusterMode == 'client':
             self.cluster = createClusterClient()
             self.cluster = createClusterClient()
         elif self.clusterMode == 'server':
         elif self.clusterMode == 'server':
@@ -400,7 +401,7 @@ class DirectSession(DirectObject):
 
 
         if self.oobeMode:
         if self.oobeMode:
             # Position a target point to lerp the oobe camera to
             # Position a target point to lerp the oobe camera to
-            base.direct.cameraControl.camManipRef.iPosHpr(self.trueCamera)
+            base.direct.cameraControl.camManipRef.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0)
             ival = self.oobeCamera.posHprInterval(
             ival = self.oobeCamera.posHprInterval(
                 2.0, pos = Point3(0), hpr = Vec3(0), 
                 2.0, pos = Point3(0), hpr = Vec3(0), 
                 other = base.direct.cameraControl.camManipRef,
                 other = base.direct.cameraControl.camManipRef,
@@ -416,7 +417,7 @@ class DirectSession(DirectObject):
             cameraParent = self.camera.getParent()
             cameraParent = self.camera.getParent()
             # Prepare oobe camera
             # Prepare oobe camera
             self.oobeCamera.reparentTo(cameraParent)
             self.oobeCamera.reparentTo(cameraParent)
-            self.oobeCamera.iPosHpr(self.trueCamera)
+            self.oobeCamera.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0)
             # Put camera under new oobe camera
             # Put camera under new oobe camera
             self.cam.reparentTo(self.oobeCamera)
             self.cam.reparentTo(self.oobeCamera)
             # Position a target point to lerp the oobe camera to
             # Position a target point to lerp the oobe camera to
@@ -432,13 +433,13 @@ class DirectSession(DirectObject):
 
 
     def beginOOBE(self):
     def beginOOBE(self):
         # Make sure we've reached our final destination
         # Make sure we've reached our final destination
-        self.oobeCamera.iPosHpr(base.direct.cameraControl.camManipRef)
+        self.oobeCamera.setPosHpr(base.direct.cameraControl.camManipRef, 0, 0, 0, 0, 0, 0)
         base.direct.camera = self.oobeCamera
         base.direct.camera = self.oobeCamera
         self.oobeMode = 1
         self.oobeMode = 1
 
 
     def endOOBE(self):
     def endOOBE(self):
         # Make sure we've reached our final destination
         # Make sure we've reached our final destination
-        self.oobeCamera.iPosHpr(self.trueCamera)
+        self.oobeCamera.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0)
         # Disable OOBE mode.
         # Disable OOBE mode.
         self.cam.reparentTo(self.trueCamera)
         self.cam.reparentTo(self.trueCamera)
         base.direct.camera = self.trueCamera
         base.direct.camera = self.trueCamera
@@ -806,7 +807,7 @@ class DirectSession(DirectObject):
                            [nodePath, oldParent, self.activeParent, fWrt])
                            [nodePath, oldParent, self.activeParent, fWrt])
 
 
     def isNotCycle(self, nodePath, parent):
     def isNotCycle(self, nodePath, parent):
-        if nodePath.id() == parent.id():
+        if nodePath == parent:
             print 'DIRECT.reparent: Invalid parent'
             print 'DIRECT.reparent: Invalid parent'
             return 0
             return 0
         elif parent.hasParent():
         elif parent.hasParent():
@@ -1308,6 +1309,3 @@ class DisplayRegionList(DirectObject):
             if drc.cam == cam:
             if drc.cam == cam:
                 self.displayRegionList.remove(drc)
                 self.displayRegionList.remove(drc)
                 break
                 break
-
-# Create one
-__builtins__['direct'] = base.direct = DirectSession()

+ 4 - 4
direct/src/distributed/ConnectionRepository.py

@@ -491,7 +491,7 @@ class ConnectionRepository(
         elif self.connectMethod == self.CM_NET or (not hasattr(self,"connectNative")):
         elif self.connectMethod == self.CM_NET or (not hasattr(self,"connectNative")):
             # Try each of the servers in turn.
             # Try each of the servers in turn.
             for url in serverList:
             for url in serverList:
-                self.notify.info("Connecting to %s via NET interface." % (url.cStr()))
+                self.notify.info("Connecting to %s via NET interface." % (url))
                 if self.tryConnectNet(url):
                 if self.tryConnectNet(url):
                     self.startReaderPollTask()
                     self.startReaderPollTask()
                     if successCallback:
                     if successCallback:
@@ -503,7 +503,7 @@ class ConnectionRepository(
                 failureCallback(0, '', *failureArgs)
                 failureCallback(0, '', *failureArgs)
         elif self.connectMethod == self.CM_NATIVE:
         elif self.connectMethod == self.CM_NATIVE:
             for url in serverList:
             for url in serverList:
-                self.notify.info("Connecting to %s via Native interface." % (url.cStr()))
+                self.notify.info("Connecting to %s via Native interface." % (url))
                 if self.connectNative(url):
                 if self.connectNative(url):
                     self.startReaderPollTask()
                     self.startReaderPollTask()
                     if successCallback:
                     if successCallback:
@@ -536,7 +536,7 @@ class ConnectionRepository(
         if ch.isConnectionReady():
         if ch.isConnectionReady():
             self.setConnectionHttp(ch)
             self.setConnectionHttp(ch)
             self._serverAddress = serverList[serverIndex-1]
             self._serverAddress = serverList[serverIndex-1]
-            self.notify.info("Successfully connected to %s." % (self._serverAddress.cStr()))
+            self.notify.info("Successfully connected to %s." % (self._serverAddress))
 
 
             ## if self.recorder:
             ## if self.recorder:
             ##     # If we have a recorder, we wrap the connect inside a
             ##     # If we have a recorder, we wrap the connect inside a
@@ -562,7 +562,7 @@ class ConnectionRepository(
             # No connection yet, but keep trying.
             # No connection yet, but keep trying.
 
 
             url = serverList[serverIndex]
             url = serverList[serverIndex]
-            self.notify.info("Connecting to %s via HTTP interface." % (url.cStr()))
+            self.notify.info("Connecting to %s via HTTP interface." % (url))
             ch.preserveStatus()
             ch.preserveStatus()
 
 
             ch.beginConnectTo(DocumentSpec(url))
             ch.beginConnectTo(DocumentSpec(url))

+ 1 - 1
direct/src/distributed/DistributedCartesianGrid.py

@@ -250,7 +250,7 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
         assert self.notify.debug("removeObjectFromGrid %s" % av)
         assert self.notify.debug("removeObjectFromGrid %s" % av)
         # TODO: WHAT LOCATION SHOULD WE SET THIS TO?
         # TODO: WHAT LOCATION SHOULD WE SET THIS TO?
         #av.reparentTo(hidden)
         #av.reparentTo(hidden)
-        if (av.getParent().compareTo(self) == 0):
+        if av.getParent() == self:
             # only detach if object is directly parented
             # only detach if object is directly parented
             av.detachNode()
             av.detachNode()
         #av.b_setLocation(0, 0)
         #av.b_setLocation(0, 0)

+ 0 - 1
direct/src/distributed/GridChild.py

@@ -1,6 +1,5 @@
 from direct.distributed.DistributedSmoothNodeBase import DistributedSmoothNodeBase
 from direct.distributed.DistributedSmoothNodeBase import DistributedSmoothNodeBase
 from direct.distributed.GridParent import GridParent
 from direct.distributed.GridParent import GridParent
-from pandac.PandaModules import EmbeddedValue
 
 
 class GridChild:
 class GridChild:
     """
     """

+ 2 - 1
direct/src/distributed/PyDatagram.py

@@ -3,7 +3,8 @@
 # class variable FuncDict and so we can import DCSubatomicType at the top
 # class variable FuncDict and so we can import DCSubatomicType at the top
 # of the file rather than every time we call the putArg function.
 # of the file rather than every time we call the putArg function.
 
 
-from pandac.PandaModules import *
+from panda3d.core import Datagram
+from panda3d.direct import *
 # Import the type numbers
 # Import the type numbers
 
 
 #from otp.ai.AIMsgTypes import *
 #from otp.ai.AIMsgTypes import *

+ 2 - 1
direct/src/distributed/PyDatagramIterator.py

@@ -3,7 +3,8 @@
 # class variable FuncDict and so we can import DCSubatomicType at the top
 # class variable FuncDict and so we can import DCSubatomicType at the top
 # of the file rather than every time we call the putArg function.
 # of the file rather than every time we call the putArg function.
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
+from panda3d.direct import *
 # Import the type numbers
 # Import the type numbers
 
 
 class PyDatagramIterator(DatagramIterator):
 class PyDatagramIterator(DatagramIterator):

+ 22 - 182
direct/src/distributed/cConnectionRepository.cxx

@@ -26,11 +26,7 @@
 #include "pStatTimer.h"
 #include "pStatTimer.h"
 
 
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
-#ifndef CPPPARSER
-#include "py_panda.h"  
-IMPORT_THIS struct   Dtool_PyTypedObject Dtool_DatagramIterator;
-IMPORT_THIS struct   Dtool_PyTypedObject Dtool_DCClass;
-#endif
+#include "py_panda.h"
 #endif
 #endif
 
 
 const string CConnectionRepository::_overflow_event_name = "CRDatagramOverflow";
 const string CConnectionRepository::_overflow_event_name = "CRDatagramOverflow";
@@ -42,14 +38,13 @@ PStatCollector CConnectionRepository::_update_pcollector("App:Show code:readerPo
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CConnectionRepository::Constructor
 //     Function: CConnectionRepository::Constructor
 //       Access: Published
 //       Access: Published
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 CConnectionRepository::
 CConnectionRepository::
 CConnectionRepository(bool has_owner_view, bool threaded_net) :
 CConnectionRepository(bool has_owner_view, bool threaded_net) :
   _lock("CConnectionRepository::_lock"),
   _lock("CConnectionRepository::_lock"),
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
   _python_repository(NULL),
   _python_repository(NULL),
-  _python_ai_datagramiterator(NULL),
 #endif
 #endif
 #ifdef HAVE_OPENSSL
 #ifdef HAVE_OPENSSL
   _http_conn(NULL),
   _http_conn(NULL),
@@ -82,19 +77,12 @@ CConnectionRepository(bool has_owner_view, bool threaded_net) :
   }
   }
 #endif
 #endif
   _tcp_header_size = tcp_header_size;
   _tcp_header_size = tcp_header_size;
-
-#ifdef HAVE_PYTHON
-  PyObject *  PyDitterator = DTool_CreatePyInstance(&_di,Dtool_DatagramIterator,false,false);
-  if(PyDitterator != NULL)
-      _python_ai_datagramiterator = Py_BuildValue("(O)",PyDitterator);
-#endif
-
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CConnectionRepository::Destructor
 //     Function: CConnectionRepository::Destructor
 //       Access: Published
 //       Access: Published
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 CConnectionRepository::
 CConnectionRepository::
 ~CConnectionRepository() {
 ~CConnectionRepository() {
@@ -182,7 +170,7 @@ try_connect_net(const URLSpec &url) {
 
 
   disconnect();
   disconnect();
 
 
-  _net_conn = 
+  _net_conn =
     _qcm.open_TCP_client_connection(url.get_server(), url.get_port(),
     _qcm.open_TCP_client_connection(url.get_server(), url.get_port(),
                                     game_server_timeout_ms);
                                     game_server_timeout_ms);
 
 
@@ -315,7 +303,7 @@ check_datagram() {
         _msg_channels.push_back(schan);
         _msg_channels.push_back(schan);
       }
       }
       _msg_sender = _di.get_uint64();
       _msg_sender = _di.get_uint64();
-      
+
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
       // For now, we need to stuff this field onto the Python
       // For now, we need to stuff this field onto the Python
       // structure, to support legacy code that expects to find it
       // structure, to support legacy code that expects to find it
@@ -361,7 +349,7 @@ check_datagram() {
       }
       }
       break;
       break;
 #endif  // HAVE_PYTHON
 #endif  // HAVE_PYTHON
-      
+
     default:
     default:
       // Some unknown message; let the caller deal with it.
       // Some unknown message; let the caller deal with it.
       return true;
       return true;
@@ -372,9 +360,6 @@ check_datagram() {
   return false;
   return false;
 }
 }
 
 
-
-
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CConnectionRepository::is_connected
 //     Function: CConnectionRepository::is_connected
 //       Access: Published
 //       Access: Published
@@ -745,7 +730,7 @@ handle_update_field() {
 
 
   PStatTimer timer(_update_pcollector);
   PStatTimer timer(_update_pcollector);
   unsigned int do_id = _di.get_uint32();
   unsigned int do_id = _di.get_uint32();
-  if (_python_repository != (PyObject *)NULL) 
+  if (_python_repository != (PyObject *)NULL)
   {
   {
     PyObject *doId2do =
     PyObject *doId2do =
       PyObject_GetAttrString(_python_repository, "doId2do");
       PyObject_GetAttrString(_python_repository, "doId2do");
@@ -794,9 +779,9 @@ handle_update_field() {
       // method might get into trouble if it tried to delete the
       // method might get into trouble if it tried to delete the
       // object from the doId2do map.
       // object from the doId2do map.
       Py_INCREF(distobj);
       Py_INCREF(distobj);
-      dclass->receive_update(distobj, _di); 
+      dclass->receive_update(distobj, _di);
       Py_DECREF(distobj);
       Py_DECREF(distobj);
-      
+
       if (PyErr_Occurred()) {
       if (PyErr_Occurred()) {
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
         PyGILState_Release(gstate);
         PyGILState_Release(gstate);
@@ -810,7 +795,7 @@ handle_update_field() {
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
   PyGILState_Release(gstate);
   PyGILState_Release(gstate);
 #endif
 #endif
-  #endif  // HAVE_PYTHON  
+  #endif  // HAVE_PYTHON
   return true;
   return true;
 }
 }
 
 
@@ -880,9 +865,9 @@ handle_update_field_owner() {
         // make a copy of the datagram iterator so that we can use the main
         // make a copy of the datagram iterator so that we can use the main
         // iterator for the non-owner update
         // iterator for the non-owner update
         DatagramIterator _odi(_di);
         DatagramIterator _odi(_di);
-        dclass->receive_update(distobjOV, _odi); 
+        dclass->receive_update(distobjOV, _odi);
         Py_DECREF(distobjOV);
         Py_DECREF(distobjOV);
-      
+
         if (PyErr_Occurred()) {
         if (PyErr_Occurred()) {
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
           PyGILState_Release(gstate);
           PyGILState_Release(gstate);
@@ -919,9 +904,9 @@ handle_update_field_owner() {
         // method might get into trouble if it tried to delete the
         // method might get into trouble if it tried to delete the
         // object from the doId2do map.
         // object from the doId2do map.
         Py_INCREF(distobj);
         Py_INCREF(distobj);
-        dclass->receive_update(distobj, _di); 
+        dclass->receive_update(distobj, _di);
         Py_DECREF(distobj);
         Py_DECREF(distobj);
-      
+
         if (PyErr_Occurred()) {
         if (PyErr_Occurred()) {
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
           PyGILState_Release(gstate);
           PyGILState_Release(gstate);
@@ -935,7 +920,7 @@ handle_update_field_owner() {
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
 #if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
   PyGILState_Release(gstate);
   PyGILState_Release(gstate);
 #endif
 #endif
-#endif  // HAVE_PYTHON  
+#endif  // HAVE_PYTHON
 
 
   return true;
   return true;
 }
 }
@@ -948,17 +933,17 @@ handle_update_field_owner() {
 //               output stream.
 //               output stream.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void CConnectionRepository::
 void CConnectionRepository::
-describe_message(ostream &out, const string &prefix, 
+describe_message(ostream &out, const string &prefix,
                  const Datagram &dg) const {
                  const Datagram &dg) const {
   DCPacker packer;
   DCPacker packer;
-  
+
   packer.set_unpack_data(dg.get_message());
   packer.set_unpack_data(dg.get_message());
   CHANNEL_TYPE do_id;
   CHANNEL_TYPE do_id;
   int msg_type;
   int msg_type;
   bool is_update = false;
   bool is_update = false;
   string full_prefix = "CR::" + prefix;
   string full_prefix = "CR::" + prefix;
 
 
-  if (!_client_datagram) 
+  if (!_client_datagram)
   {
   {
     unsigned char mcnt = packer.raw_unpack_uint8();
     unsigned char mcnt = packer.raw_unpack_uint8();
     for( ;mcnt > 0; mcnt--)
     for( ;mcnt > 0; mcnt--)
@@ -967,7 +952,7 @@ describe_message(ostream &out, const string &prefix,
     packer.RAW_UNPACK_CHANNEL();  // msg_sender
     packer.RAW_UNPACK_CHANNEL();  // msg_sender
     msg_type = packer.raw_unpack_uint16();
     msg_type = packer.raw_unpack_uint16();
     is_update = (msg_type == STATESERVER_OBJECT_UPDATE_FIELD);
     is_update = (msg_type == STATESERVER_OBJECT_UPDATE_FIELD);
-    
+
   } else {
   } else {
     msg_type = packer.raw_unpack_uint16();
     msg_type = packer.raw_unpack_uint16();
     is_update = (msg_type == CLIENT_OBJECT_UPDATE_FIELD);
     is_update = (msg_type == CLIENT_OBJECT_UPDATE_FIELD);
@@ -1045,12 +1030,12 @@ describe_message(ostream &out, const string &prefix,
         Py_DECREF(dclass_this);
         Py_DECREF(dclass_this);
       }
       }
     }
     }
-    #endif  // HAVE_PYTHON  
+    #endif  // HAVE_PYTHON
 
 
     int field_id = packer.raw_unpack_uint16();
     int field_id = packer.raw_unpack_uint16();
 
 
     if (dclass == (DCClass *)NULL) {
     if (dclass == (DCClass *)NULL) {
-      out << full_prefix << "update for unknown object " << do_id 
+      out << full_prefix << "update for unknown object " << do_id
           << ", field " << field_id << "\n";
           << ", field " << field_id << "\n";
 
 
     } else {
     } else {
@@ -1059,7 +1044,7 @@ describe_message(ostream &out, const string &prefix,
       DCField *field = dclass->get_field_by_index(field_id);
       DCField *field = dclass->get_field_by_index(field_id);
       if (field == (DCField *)NULL) {
       if (field == (DCField *)NULL) {
         out << "unknown field " << field_id << "\n";
         out << "unknown field " << field_id << "\n";
-        
+
       } else {
       } else {
         out << field->get_name();
         out << field->get_name();
         packer.begin_unpack(field);
         packer.begin_unpack(field);
@@ -1070,148 +1055,3 @@ describe_message(ostream &out, const string &prefix,
     }
     }
   }
   }
 }
 }
-
-
-
-
-#ifdef HAVE_PYTHON
-#ifdef WANT_NATIVE_NET
-
-bool CConnectionRepository::network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy)
-{
-  ReMutexHolder holder(_lock);
-    while(is_connected())
-    {        
-        check_datagram_ai(PycallBackFunction);
-        if(is_connected())
-            _bdc.Flush();
-        float currentTime = clock.get_real_time();
-        float dif_time = returnBy - currentTime;
-        if(dif_time <= 0.001) // to avoi over runs..
-            break;
-        if(is_connected())
-            _bdc.WaitForNetworkReadEvent(dif_time);
-    }
-    return false;
-}
-
-bool CConnectionRepository::check_datagram_ai(PyObject *PycallBackFunction)
-{
-  ReMutexHolder holder(_lock);
-    // these could be static .. not 
-  PyObject *doId2do = NULL; 
-  float startTime =0;
-  float endTime = 0;
-  // this seems weird...here
-  _bdc.Flush();
-  while (_bdc.GetMessage(_dg))
-  { 
-      if (get_verbose()) 
-          describe_message(nout, "RECV", _dg);
-
-      if (_time_warning > 0) 
-        startTime = ClockObject::get_global_clock()->get_real_time();
-
-      // Start breaking apart the datagram.
-      _di.assign(_dg);
-      unsigned char  wc_cnt = _di.get_uint8();
-      _msg_channels.clear();
-      for(unsigned char lp1 = 0; lp1 < wc_cnt; lp1++)
-          _msg_channels.push_back(_di.get_uint64());
-
-      _msg_sender = _di.get_uint64();
-      _msg_type = _di.get_uint16();
-
-      if( _msg_type == STATESERVER_OBJECT_UPDATE_FIELD)
-      {
-          if(doId2do == NULL)
-          {
-              // this is my attemp to take it out of the inner loop  RHH
-              doId2do =PyObject_GetAttrString(_python_repository, "doId2do");
-              nassertr(doId2do != NULL, false);
-          }
-
-          if (!handle_update_field_ai(doId2do)) 
-          {
-              Py_XDECREF(doId2do);
-              if (_time_warning > 0) {
-                endTime = ClockObject::get_global_clock()->get_real_time(); 
-                if ( _time_warning < (endTime - startTime)) {
-                  nout << "msg " << _msg_type <<" from " << _msg_sender << " took "<<  (endTime-startTime) << "secs to process\n";
-                  _dg.dump_hex(nout,2);
-                }
-              }
-              return false; 
-          }
-      }
-      else
-      {
-          PyObject * result = PyEval_CallObject(PycallBackFunction, _python_ai_datagramiterator);
-          if (PyErr_Occurred()) 
-          {        
-              Py_XDECREF(doId2do);
-              if (_time_warning > 0) {
-                endTime = ClockObject::get_global_clock()->get_real_time(); 
-                if ( _time_warning < (endTime - startTime)) {
-                  nout << "msg " << _msg_type <<" from " << _msg_sender << " took "<<  (endTime-startTime) << "secs to process\n";
-                  _dg.dump_hex(nout,2);                
-                }
-              }
-              return true;
-          }
-      }
-
-      if (_time_warning > 0) {
-        endTime = ClockObject::get_global_clock()->get_real_time(); 
-        if ( _time_warning < (endTime - startTime)) {
-          nout << "msg " << _msg_type <<" from " << _msg_sender << " took "<<  (endTime-startTime) << "secs to process\n";
-          _dg.dump_hex(nout,2);   
-        }
-      }
-             
-  }
-
-
-  Py_XDECREF(doId2do);
-  return false;
-}
-
-#endif  // #ifdef WANT_NATIVE_NET
-#endif  // #ifdef HAVE_PYTHON
-
-
-#ifdef HAVE_PYTHON
-#ifdef WANT_NATIVE_NET
-
-
-bool CConnectionRepository::handle_update_field_ai(PyObject *doId2do) 
-{
-  PStatTimer timer(_update_pcollector);
-  unsigned int do_id = _di.get_uint32();
- 
-  PyObject *doId = PyLong_FromUnsignedLong(do_id);
-  PyObject *distobj = PyDict_GetItem(doId2do, doId);
-  Py_DECREF(doId);
-
-  if (distobj != NULL)
-  {
-      PyObject *dclass_obj = PyObject_GetAttrString(distobj, "dclass");
-      nassertr(dclass_obj != NULL, false);
-
-      DCClass *dclass = NULL;
-      DTOOL_Call_ExtractThisPointerForType(dclass_obj, &Dtool_DCClass, (void **) &dclass);
-      if(dclass == NULL)
-          return false;
-
-      Py_INCREF(distobj);
-      dclass->receive_update(distobj, _di); 
-      Py_DECREF(distobj);
-
-      if (PyErr_Occurred()) 
-          return false;
-  }
-  return true;
-}
-
-#endif  // #ifdef WANT_NATIVE_NET
-#endif  // #ifdef HAVE_PYTHON

+ 3 - 17
direct/src/distributed/cConnectionRepository.h

@@ -100,7 +100,7 @@ PUBLISHED:
 #endif
 #endif
 #ifdef HAVE_NET
 #ifdef HAVE_NET
   BLOCKING bool try_connect_net(const URLSpec &url);
   BLOCKING bool try_connect_net(const URLSpec &url);
-  
+
   INLINE QueuedConnectionManager &get_qcm();
   INLINE QueuedConnectionManager &get_qcm();
   INLINE ConnectionWriter &get_cw();
   INLINE ConnectionWriter &get_cw();
   INLINE QueuedConnectionReader &get_qcr();
   INLINE QueuedConnectionReader &get_qcr();
@@ -117,13 +117,7 @@ PUBLISHED:
 #endif
 #endif
 
 
   BLOCKING bool check_datagram();
   BLOCKING bool check_datagram();
-#ifdef HAVE_PYTHON
-#ifdef WANT_NATIVE_NET
-  BLOCKING bool check_datagram_ai(PyObject *PycallBackFunction);
-  BLOCKING bool network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy);
-#endif
-#endif
-    
+
   BLOCKING INLINE void get_datagram(Datagram &dg);
   BLOCKING INLINE void get_datagram(Datagram &dg);
   BLOCKING INLINE void get_datagram_iterator(DatagramIterator &di);
   BLOCKING INLINE void get_datagram_iterator(DatagramIterator &di);
   BLOCKING INLINE CHANNEL_TYPE get_msg_channel(int offset = 0) const;
   BLOCKING INLINE CHANNEL_TYPE get_msg_channel(int offset = 0) const;
@@ -167,18 +161,11 @@ PUBLISHED:
   INLINE float get_time_warning() const;
   INLINE float get_time_warning() const;
 
 
 private:
 private:
-#ifdef HAVE_PYTHON
-#ifdef WANT_NATIVE_NET
-    bool handle_update_field_ai(PyObject *doId2do);
-#endif
-#endif
-
-
   bool do_check_datagram();
   bool do_check_datagram();
   bool handle_update_field();
   bool handle_update_field();
   bool handle_update_field_owner();
   bool handle_update_field_owner();
 
 
-  void describe_message(ostream &out, const string &prefix, 
+  void describe_message(ostream &out, const string &prefix,
                         const Datagram &dg) const;
                         const Datagram &dg) const;
 
 
 private:
 private:
@@ -186,7 +173,6 @@ private:
 
 
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
   PyObject *_python_repository;
   PyObject *_python_repository;
-  PyObject *_python_ai_datagramiterator;
 #endif
 #endif
 
 
 #ifdef HAVE_OPENSSL
 #ifdef HAVE_OPENSSL

+ 0 - 9
direct/src/doc/dcPacker.txt

@@ -1,9 +0,0 @@
-
-    def __str__(self):
-        return self.cStr()
-
-    def __len__(self):
-        return self.length()
-    
-    def __getitem__(self, n):
-        return self.cStr().__getitem__(n)

+ 1 - 1
direct/src/extensions/HTTPChannel-extensions.py

@@ -14,7 +14,7 @@
         Returns the newly-spawned task.
         Returns the newly-spawned task.
         """
         """
         if not name:
         if not name:
-            name = self.getUrl().cStr()
+            name = str(self.getUrl())
         from direct.task import Task
         from direct.task import Task
         task = Task.Task(self.doTask)
         task = Task.Task(self.doTask)
         task.callback = callback
         task.callback = callback

+ 5 - 4
direct/src/extensions_native/CInterval_extensions.py

@@ -1,7 +1,8 @@
+from .core import Dtool_funcToMethod
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
-notify = directNotify.newCategory("Interval")
-Dtool_ObjectToDict(CInterval,"notify", notify)
-del notify
+
+CInterval.DtoolClassDict["notify"] = directNotify.newCategory("Interval")
+
 #####################################################################
 #####################################################################
 def setT(self, t):
 def setT(self, t):
     # Overridden from the C++ function to call privPostEvent
     # Overridden from the C++ function to call privPostEvent
@@ -10,7 +11,7 @@ def setT(self, t):
     self.setT_Old(t)
     self.setT_Old(t)
     self.privPostEvent()
     self.privPostEvent()
 
 
-Dtool_ObjectToDict(CInterval, "setT_Old", CInterval.setT)
+CInterval.DtoolClassDict["setT_Old"] = CInterval.setT
 Dtool_funcToMethod(setT, CInterval)
 Dtool_funcToMethod(setT, CInterval)
 del setT
 del setT
 #####################################################################
 #####################################################################

+ 1 - 1
direct/src/extensions_native/HTTPChannel_extensions.py

@@ -18,7 +18,7 @@ def spawnTask(self, name = None, callback = None, extraArgs = []):
         Returns the newly-spawned task.
         Returns the newly-spawned task.
         """
         """
         if not name:
         if not name:
-            name = self.getUrl().cStr()
+            name = str(self.getUrl())
         from direct.task import Task
         from direct.task import Task
         task = Task.Task(self.doTask)
         task = Task.Task(self.doTask)
         task.callback = callback
         task.callback = callback

+ 47 - 742
direct/src/extensions_native/NodePath_extensions.py

@@ -10,22 +10,16 @@ of the NodePath class
 
 
 ####################################################################
 ####################################################################
 def id(self):
 def id(self):
-        """Returns a unique id identifying the NodePath instance"""
-        print "Warning: NodePath.id() is deprecated.  Use hash(NodePath) or NodePath.get_key() instead."
+        """Deprecated.  Returns a unique id identifying the NodePath instance"""
+        print("Warning: NodePath.id() is deprecated.  Use hash(NodePath) or NodePath.get_key() instead.")
         return self.getKey()
         return self.getKey()
 
 
 Dtool_funcToMethod(id, NodePath)
 Dtool_funcToMethod(id, NodePath)
 del id
 del id
 #####################################################################
 #####################################################################
-
-##    def __hash__(self):  // inside c code
-##        return self.getKey()
-#####################################################################
-
-    # For iterating over children
 def getChildrenAsList(self):
 def getChildrenAsList(self):
-        """Converts a node path's child NodePathCollection into a list"""
-        print "Warning: NodePath.getChildrenAsList() is deprecated.  Use get_children() instead."
+        """Deprecated.  Converts a node path's child NodePathCollection into a list"""
+        print("Warning: NodePath.getChildrenAsList() is deprecated.  Use get_children() instead.")
         return list(self.getChildren())
         return list(self.getChildren())
 
 
 Dtool_funcToMethod(getChildrenAsList, NodePath)
 Dtool_funcToMethod(getChildrenAsList, NodePath)
@@ -35,7 +29,7 @@ del getChildrenAsList
 def printChildren(self):
 def printChildren(self):
         """Prints out the children of the bottom node of a node path"""
         """Prints out the children of the bottom node of a node path"""
         for child in self.getChildren():
         for child in self.getChildren():
-            print child.getName()
+            print(child.getName())
 Dtool_funcToMethod(printChildren, NodePath)
 Dtool_funcToMethod(printChildren, NodePath)
 del printChildren
 del printChildren
 #####################################################################
 #####################################################################
@@ -95,8 +89,8 @@ del isolate
 #####################################################################
 #####################################################################
 
 
 def remove(self):
 def remove(self):
-        """Remove a node path from the scene graph"""
-        print "Warning: NodePath.remove() is deprecated.  Use remove_node() instead."
+        """Deprecated.  Remove a node path from the scene graph"""
+        print("Warning: NodePath.remove() is deprecated.  Use remove_node() instead.")
         # Send message in case anyone needs to do something
         # Send message in case anyone needs to do something
         # before node is deleted
         # before node is deleted
         messenger.send('preRemoveNodePath', [self])
         messenger.send('preRemoveNodePath', [self])
@@ -109,11 +103,11 @@ del remove
 def lsNames(self):
 def lsNames(self):
         """Walk down a tree and print out the path"""
         """Walk down a tree and print out the path"""
         if self.isEmpty():
         if self.isEmpty():
-            print "(empty)"
+            print("(empty)")
         else:
         else:
             type = self.node().getType().getName()
             type = self.node().getType().getName()
             name = self.getName()
             name = self.getName()
-            print type + "  " + name
+            print(type + "  " + name)
             self.lsNamesRecurse()
             self.lsNamesRecurse()
 
 
 Dtool_funcToMethod(lsNames, NodePath)
 Dtool_funcToMethod(lsNames, NodePath)
@@ -124,7 +118,7 @@ def lsNamesRecurse(self, indentString=' '):
         for nodePath in self.getChildren():
         for nodePath in self.getChildren():
             type = nodePath.node().getType().getName()
             type = nodePath.node().getType().getName()
             name = nodePath.getName()
             name = nodePath.getName()
-            print indentString + type + "  " + name
+            print(indentString + type + "  " + name)
             nodePath.lsNamesRecurse(indentString + " ")
             nodePath.lsNamesRecurse(indentString + " ")
 
 
 Dtool_funcToMethod(lsNamesRecurse, NodePath)
 Dtool_funcToMethod(lsNamesRecurse, NodePath)
@@ -138,7 +132,7 @@ def reverseLsNames(self):
         for nodePath in ancestry:
         for nodePath in ancestry:
             type = nodePath.node().getType().getName()
             type = nodePath.node().getType().getName()
             name = nodePath.getName()
             name = nodePath.getName()
-            print indentString + type + "  " + name
+            print(indentString + type + "  " + name)
             indentString = indentString + " "
             indentString = indentString + " "
 
 
 Dtool_funcToMethod(reverseLsNames, NodePath)
 Dtool_funcToMethod(reverseLsNames, NodePath)
@@ -146,7 +140,7 @@ del reverseLsNames
 #####################################################################
 #####################################################################
 def getAncestry(self):
 def getAncestry(self):
         """Get a list of a node path's ancestors"""
         """Get a list of a node path's ancestors"""
-        print "NodePath.getAncestry() is deprecated.  Use get_ancestors() instead."""
+        print("NodePath.getAncestry() is deprecated.  Use get_ancestors() instead.""")
         ancestors = list(self.getAncestors())
         ancestors = list(self.getAncestors())
         ancestors.reverse()
         ancestors.reverse()
         return ancestors
         return ancestors
@@ -197,11 +191,11 @@ def printPos(self, other = None, sd = 2):
         else:
         else:
             pos = self.getPos()
             pos = self.getPos()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setPos(' + otherString +
+        print((self.getName() + '.setPos(' + otherString +
                formatString % pos[0] + ', ' +
                formatString % pos[0] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[2] +
                formatString % pos[2] +
-               ')\n')
+               ')\n'))
 Dtool_funcToMethod(printPos, NodePath)
 Dtool_funcToMethod(printPos, NodePath)
 del printPos
 del printPos
 #####################################################################
 #####################################################################
@@ -215,11 +209,11 @@ def printHpr(self, other = None, sd = 2):
         else:
         else:
             hpr = self.getHpr()
             hpr = self.getHpr()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setHpr(' + otherString +
+        print((self.getName() + '.setHpr(' + otherString +
                formatString % hpr[0] + ', ' +
                formatString % hpr[0] + ', ' +
                formatString % hpr[1] + ', ' +
                formatString % hpr[1] + ', ' +
                formatString % hpr[2] +
                formatString % hpr[2] +
-               ')\n')
+               ')\n'))
 Dtool_funcToMethod(printHpr, NodePath)
 Dtool_funcToMethod(printHpr, NodePath)
 del printHpr
 del printHpr
 #####################################################################
 #####################################################################
@@ -233,11 +227,11 @@ def printScale(self, other = None, sd = 2):
         else:
         else:
             scale = self.getScale()
             scale = self.getScale()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setScale(' + otherString +
+        print((self.getName() + '.setScale(' + otherString +
                formatString % scale[0] + ', ' +
                formatString % scale[0] + ', ' +
                formatString % scale[1] + ', ' +
                formatString % scale[1] + ', ' +
                formatString % scale[2] +
                formatString % scale[2] +
-               ')\n')
+               ')\n'))
 
 
 Dtool_funcToMethod(printScale, NodePath)
 Dtool_funcToMethod(printScale, NodePath)
 del printScale
 del printScale
@@ -253,14 +247,14 @@ def printPosHpr(self, other = None, sd = 2):
             pos = self.getPos()
             pos = self.getPos()
             hpr = self.getHpr()
             hpr = self.getHpr()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setPosHpr(' + otherString +
+        print((self.getName() + '.setPosHpr(' + otherString +
                formatString % pos[0] + ', ' +
                formatString % pos[0] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[2] + ', ' +
                formatString % pos[2] + ', ' +
                formatString % hpr[0] + ', ' +
                formatString % hpr[0] + ', ' +
                formatString % hpr[1] + ', ' +
                formatString % hpr[1] + ', ' +
                formatString % hpr[2] +
                formatString % hpr[2] +
-               ')\n')
+               ')\n'))
 
 
 Dtool_funcToMethod(printPosHpr, NodePath)
 Dtool_funcToMethod(printPosHpr, NodePath)
 del printPosHpr
 del printPosHpr
@@ -278,7 +272,7 @@ def printPosHprScale(self, other = None, sd = 2):
             hpr = self.getHpr()
             hpr = self.getHpr()
             scale = self.getScale()
             scale = self.getScale()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setPosHprScale(' + otherString +
+        print((self.getName() + '.setPosHprScale(' + otherString +
                formatString % pos[0] + ', ' +
                formatString % pos[0] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[2] + ', ' +
                formatString % pos[2] + ', ' +
@@ -288,14 +282,14 @@ def printPosHprScale(self, other = None, sd = 2):
                formatString % scale[0] + ', ' +
                formatString % scale[0] + ', ' +
                formatString % scale[1] + ', ' +
                formatString % scale[1] + ', ' +
                formatString % scale[2] +
                formatString % scale[2] +
-               ')\n')
+               ')\n'))
 
 
 Dtool_funcToMethod(printPosHprScale, NodePath)
 Dtool_funcToMethod(printPosHprScale, NodePath)
 del printPosHprScale
 del printPosHprScale
 #####################################################################
 #####################################################################
 
 
 def printTransform(self, other = None, sd = 2, fRecursive = 0):
 def printTransform(self, other = None, sd = 2, fRecursive = 0):
-    from pandac.PandaModules import Vec3
+    from panda3d.core import Vec3
     fmtStr = '%%0.%df' % sd
     fmtStr = '%%0.%df' % sd
     name = self.getName()
     name = self.getName()
     if other == None:
     if other == None:
@@ -306,23 +300,23 @@ def printTransform(self, other = None, sd = 2, fRecursive = 0):
         pos = transform.getPos()
         pos = transform.getPos()
         if not pos.almostEqual(Vec3(0)):
         if not pos.almostEqual(Vec3(0)):
             outputString = '%s.setPos(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
             outputString = '%s.setPos(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
-            print outputString % (pos[0], pos[1], pos[2])
+            print(outputString % (pos[0], pos[1], pos[2]))
     if transform.hasHpr():
     if transform.hasHpr():
         hpr = transform.getHpr()
         hpr = transform.getHpr()
         if not hpr.almostEqual(Vec3(0)):
         if not hpr.almostEqual(Vec3(0)):
             outputString = '%s.setHpr(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
             outputString = '%s.setHpr(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
-            print outputString % (hpr[0], hpr[1], hpr[2])
+            print(outputString % (hpr[0], hpr[1], hpr[2]))
     if transform.hasScale():
     if transform.hasScale():
         if transform.hasUniformScale():
         if transform.hasUniformScale():
             scale = transform.getUniformScale()
             scale = transform.getUniformScale()
             if scale != 1.0:
             if scale != 1.0:
                 outputString = '%s.setScale(%s)' % (name, fmtStr)
                 outputString = '%s.setScale(%s)' % (name, fmtStr)
-                print outputString % scale
+                print(outputString % scale)
         else:
         else:
             scale = transform.getScale()
             scale = transform.getScale()
             if not scale.almostEqual(Vec3(1)):
             if not scale.almostEqual(Vec3(1)):
                 outputString = '%s.setScale(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
                 outputString = '%s.setScale(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
-                print outputString % (scale[0], scale[1], scale[2])
+                print(outputString % (scale[0], scale[1], scale[2]))
     if fRecursive:
     if fRecursive:
         for child in self.getChildren():
         for child in self.getChildren():
             child.printTransform(other, sd, fRecursive)
             child.printTransform(other, sd, fRecursive)
@@ -383,700 +377,6 @@ def iPosHprScale(self, other = None):
 Dtool_funcToMethod(iPosHprScale, NodePath)
 Dtool_funcToMethod(iPosHprScale, NodePath)
 del iPosHprScale
 del iPosHprScale
 #####################################################################
 #####################################################################
-
-def __lerp(self, functorFunc, duration, blendType, taskName=None):
-        """
-        __lerp(self, functorFunc, float, string, string)
-        Basic lerp functionality used by other lerps.
-        Fire off a lerp. Make it a task if taskName given.
-        """
-        # functorFunc is a function which can be called to create a functor.
-        # functor creation is defered so initial state (sampled in functorFunc)
-        # will be appropriate for the time the lerp is spawned
-        from direct.task import Task
-        from direct.interval import LerpBlendHelpers
-        from direct.task.TaskManagerGlobal import taskMgr
-
-        # make the task function
-        def lerpTaskFunc(task):
-            from pandac.PandaModules import Lerp
-            from pandac.PandaModules import ClockObject
-            from direct.task.Task import Task, cont, done
-            if task.init == 1:
-                # make the lerp
-                functor = task.functorFunc()
-                task.lerp = Lerp(functor, task.duration, task.blendType)
-                task.init = 0
-            dt = globalClock.getDt()
-            task.lerp.setStepSize(dt)
-            task.lerp.step()
-            if (task.lerp.isDone()):
-                # Reset the init flag, in case the task gets re-used
-                task.init = 1
-                return(done)
-            else:
-                return(cont)
-
-        # make the lerp task
-        lerpTask = Task.Task(lerpTaskFunc)
-        lerpTask.init = 1
-        lerpTask.functorFunc = functorFunc
-        lerpTask.duration = duration
-        lerpTask.blendType = LerpBlendHelpers.getBlend(blendType)
-
-        if (taskName == None):
-            # don't spawn a task, return one instead
-            return lerpTask
-        else:
-            # spawn the lerp task
-            taskMgr.add(lerpTask, taskName)
-            return lerpTask
-
-Dtool_funcToMethod(__lerp, NodePath)
-del __lerp
-#####################################################################
-def __autoLerp(self, functorFunc, time, blendType, taskName):
-        """_autoLerp(self, functor, float, string, string)
-        This lerp uses C++ to handle the stepping. Bonus is
-        its more efficient, trade-off is there is less control"""
-        from pandac.PandaModules import AutonomousLerp
-        from direct.interval import LerpBlendHelpers
-        # make a lerp that lives in C++ land
-        functor = functorFunc()
-        lerp = AutonomousLerp(functor, time,
-                              LerpBlendHelpers.getBlend(blendType),
-                              base.eventHandler)
-        lerp.start()
-        return lerp
-
-Dtool_funcToMethod(__autoLerp, NodePath)
-del __autoLerp
-#####################################################################
-
-# user callable lerp methods
-def lerpColor(self, *posArgs, **keyArgs):
-        """lerpColor(self, *positionArgs, **keywordArgs)
-        determine which lerpColor* to call based on arguments
-        """
-        if (len(posArgs) == 2):
-            return apply(self.lerpColorVBase4, posArgs, keyArgs)
-        elif (len(posArgs) == 3):
-            return apply(self.lerpColorVBase4VBase4, posArgs, keyArgs)
-        elif (len(posArgs) == 5):
-            return apply(self.lerpColorRGBA, posArgs, keyArgs)
-        elif (len(posArgs) == 9):
-            return apply(self.lerpColorRGBARGBA, posArgs, keyArgs)
-        else:
-            # bad args
-            raise Exception("Error: NodePath.lerpColor: bad number of args")
-
-Dtool_funcToMethod(lerpColor, NodePath)
-del lerpColor
-#####################################################################
-
-def lerpColorRGBA(self, r, g, b, a, time,
-                      blendType="noBlend", auto=None, task=None):
-        """lerpColorRGBA(self, float, float, float, float, float,
-        string="noBlend", string=none, string=none)
-        """
-        def functorFunc(self = self, r = r, g = g, b = b, a = a):
-            from pandac.PandaModules import ColorLerpFunctor
-            # just end rgba values, use current color rgba values for start
-            startColor = self.getColor()
-            functor = ColorLerpFunctor(
-                self,
-                startColor[0], startColor[1],
-                startColor[2], startColor[3],
-                r, g, b, a)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpColorRGBA, NodePath)
-del lerpColorRGBA
-#####################################################################
-def lerpColorRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
-                          blendType="noBlend", auto=None, task=None):
-        """lerpColorRGBARGBA(self, float, float, float, float, float,
-        float, float, float, float, string="noBlend", string=none, string=none)
-        """
-        def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa,
-                        er = er, eg = eg, eb = eb, ea = ea):
-            from pandac.PandaModules import ColorLerpFunctor
-            # start and end rgba values
-            functor = ColorLerpFunctor(self, sr, sg, sb, sa,
-                                                        er, eg, eb, ea)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpColorRGBARGBA, NodePath)
-del lerpColorRGBARGBA
-#####################################################################
-def lerpColorVBase4(self, endColor, time,
-                        blendType="noBlend", auto=None, task=None):
-        """lerpColorVBase4(self, VBase4, float, string="noBlend", string=none,
-        string=none)
-        """
-        def functorFunc(self = self, endColor = endColor):
-            from pandac.PandaModules import ColorLerpFunctor
-            # just end vec4, use current color for start
-            startColor = self.getColor()
-            functor = ColorLerpFunctor(
-                self, startColor, endColor)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpColorVBase4, NodePath)
-del lerpColorVBase4
-#####################################################################
-def lerpColorVBase4VBase4(self, startColor, endColor, time,
-                          blendType="noBlend", auto=None, task=None):
-        """lerpColorVBase4VBase4(self, VBase4, VBase4, float, string="noBlend",
-        string=none, string=none)
-        """
-        def functorFunc(self = self, startColor = startColor,
-                        endColor = endColor):
-            from pandac.PandaModules import ColorLerpFunctor
-            # start color and end vec
-            functor = ColorLerpFunctor(
-                self, startColor, endColor)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-
-Dtool_funcToMethod(lerpColorVBase4VBase4, NodePath)
-del lerpColorVBase4VBase4
-#####################################################################
-    # user callable lerp methods
-def lerpColorScale(self, *posArgs, **keyArgs):
-        """lerpColorScale(self, *positionArgs, **keywordArgs)
-        determine which lerpColorScale* to call based on arguments
-        """
-        if (len(posArgs) == 2):
-            return apply(self.lerpColorScaleVBase4, posArgs, keyArgs)
-        elif (len(posArgs) == 3):
-            return apply(self.lerpColorScaleVBase4VBase4, posArgs, keyArgs)
-        elif (len(posArgs) == 5):
-            return apply(self.lerpColorScaleRGBA, posArgs, keyArgs)
-        elif (len(posArgs) == 9):
-            return apply(self.lerpColorScaleRGBARGBA, posArgs, keyArgs)
-        else:
-            # bad args
-            raise Exception("Error: NodePath.lerpColorScale: bad number of args")
-
-
-Dtool_funcToMethod(lerpColorScale, NodePath)
-del lerpColorScale
-#####################################################################
-def lerpColorScaleRGBA(self, r, g, b, a, time,
-                      blendType="noBlend", auto=None, task=None):
-        """lerpColorScaleRGBA(self, float, float, float, float, float,
-        string="noBlend", string=none, string=none)
-        """
-        def functorFunc(self = self, r = r, g = g, b = b, a = a):
-            from pandac.PandaModules import ColorScaleLerpFunctor
-            # just end rgba values, use current color rgba values for start
-            startColor = self.getColor()
-            functor = ColorScaleLerpFunctor(
-                self,
-                startColor[0], startColor[1],
-                startColor[2], startColor[3],
-                r, g, b, a)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpColorScaleRGBA, NodePath)
-del lerpColorScaleRGBA
-#####################################################################
-def lerpColorScaleRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
-                          blendType="noBlend", auto=None, task=None):
-        """lerpColorScaleRGBARGBA(self, float, float, float, float, float,
-        float, float, float, float, string="noBlend", string=none, string=none)
-        """
-        def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa,
-                        er = er, eg = eg, eb = eb, ea = ea):
-            from pandac.PandaModules import ColorScaleLerpFunctor
-            # start and end rgba values
-            functor = ColorScaleLerpFunctor(self, sr, sg, sb, sa,
-                                                        er, eg, eb, ea)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpColorScaleRGBARGBA, NodePath)
-del lerpColorScaleRGBARGBA
-#####################################################################
-def lerpColorScaleVBase4(self, endColor, time,
-                        blendType="noBlend", auto=None, task=None):
-        """lerpColorScaleVBase4(self, VBase4, float, string="noBlend", string=none,
-        string=none)
-        """
-        def functorFunc(self = self, endColor = endColor):
-            from pandac.PandaModules import ColorScaleLerpFunctor
-            # just end vec4, use current color for start
-            startColor = self.getColor()
-            functor = ColorScaleLerpFunctor(
-                self, startColor, endColor)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpColorScaleVBase4, NodePath)
-del lerpColorScaleVBase4
-#####################################################################
-def lerpColorScaleVBase4VBase4(self, startColor, endColor, time,
-                          blendType="noBlend", auto=None, task=None):
-        """lerpColorScaleVBase4VBase4(self, VBase4, VBase4, float, string="noBlend",
-        string=none, string=none)
-        """
-        def functorFunc(self = self, startColor = startColor,
-                        endColor = endColor):
-            from pandac.PandaModules import ColorScaleLerpFunctor
-            # start color and end vec
-            functor = ColorScaleLerpFunctor(
-                self, startColor, endColor)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-
-Dtool_funcToMethod(lerpColorScaleVBase4VBase4, NodePath)
-del lerpColorScaleVBase4VBase4
-#####################################################################
-def lerpHpr(self, *posArgs, **keyArgs):
-        """lerpHpr(self, *positionArgs, **keywordArgs)
-        Determine whether to call lerpHprHPR or lerpHprVBase3
-        based on first argument
-        """
-        # check to see if lerping with
-        # three floats or a VBase3
-        if (len(posArgs) == 4):
-            return apply(self.lerpHprHPR, posArgs, keyArgs)
-        elif(len(posArgs) == 2):
-            return apply(self.lerpHprVBase3, posArgs, keyArgs)
-        else:
-            # bad args
-            raise Exception("Error: NodePath.lerpHpr: bad number of args")
-
-Dtool_funcToMethod(lerpHpr, NodePath)
-del lerpHpr
-#####################################################################
-def lerpHprHPR(self, h, p, r, time, other=None,
-                   blendType="noBlend", auto=None, task=None, shortest=1):
-        """lerpHprHPR(self, float, float, float, float, string="noBlend",
-        string=none, string=none, NodePath=none)
-        Perform a hpr lerp with three floats as the end point
-        """
-        def functorFunc(self = self, h = h, p = p, r = r,
-                        other = other, shortest=shortest):
-            from pandac.PandaModules import HprLerpFunctor
-            # it's individual hpr components
-            if (other != None):
-                # lerp wrt other
-                startHpr = self.getHpr(other)
-                functor = HprLerpFunctor(
-                    self,
-                    startHpr[0], startHpr[1], startHpr[2],
-                    h, p, r, other)
-                if shortest:
-                    functor.takeShortest()
-            else:
-                startHpr = self.getHpr()
-                functor = HprLerpFunctor(
-                    self,
-                    startHpr[0], startHpr[1], startHpr[2],
-                    h, p, r)
-                if shortest:
-                    functor.takeShortest()
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpHprHPR, NodePath)
-del lerpHprHPR
-#####################################################################
-def lerpHprVBase3(self, hpr, time, other=None,
-                      blendType="noBlend", auto=None, task=None, shortest=1):
-        """lerpHprVBase3(self, VBase3, float, string="noBlend", string=none,
-        string=none, NodePath=None)
-        Perform a hpr lerp with a VBase3 as the end point
-        """
-        def functorFunc(self = self, hpr = hpr,
-                        other = other, shortest=shortest):
-            from pandac.PandaModules import HprLerpFunctor
-            # it's a vbase3 hpr
-            if (other != None):
-                # lerp wrt other
-                functor = HprLerpFunctor(
-                    self, (self.getHpr(other)), hpr, other)
-                if shortest:
-                    functor.takeShortest()
-            else:
-                functor = HprLerpFunctor(
-                    self, (self.getHpr()), hpr)
-                if shortest:
-                    functor.takeShortest()
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-Dtool_funcToMethod(lerpHprVBase3, NodePath)
-del lerpHprVBase3
-#####################################################################
-def lerpPos(self, *posArgs, **keyArgs):
-        """lerpPos(self, *positionArgs, **keywordArgs)
-        Determine whether to call lerpPosXYZ or lerpPosPoint3
-        based on the first argument
-        """
-        # check to see if lerping with three
-        # floats or a Point3
-        if (len(posArgs) == 4):
-            return apply(self.lerpPosXYZ, posArgs, keyArgs)
-        elif(len(posArgs) == 2):
-            return apply(self.lerpPosPoint3, posArgs, keyArgs)
-        else:
-            # bad number off args
-            raise Exception("Error: NodePath.lerpPos: bad number of args")
-
-Dtool_funcToMethod(lerpPos, NodePath)
-del lerpPos
-#####################################################################
-def lerpPosXYZ(self, x, y, z, time, other=None,
-                   blendType="noBlend", auto=None, task=None):
-        """lerpPosXYZ(self, float, float, float, float, string="noBlend",
-        string=None, NodePath=None)
-        Perform a pos lerp with three floats as the end point
-        """
-        def functorFunc(self = self, x = x, y = y, z = z, other = other):
-            from pandac.PandaModules import PosLerpFunctor
-            if (other != None):
-                # lerp wrt other
-                startPos = self.getPos(other)
-                functor = PosLerpFunctor(self,
-                                         startPos[0], startPos[1], startPos[2],
-                                         x, y, z, other)
-            else:
-                startPos = self.getPos()
-                functor = PosLerpFunctor(self, startPos[0],
-                                         startPos[1], startPos[2], x, y, z)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return  self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpPosXYZ, NodePath)
-del lerpPosXYZ
-#####################################################################
-def lerpPosPoint3(self, pos, time, other=None,
-                      blendType="noBlend", auto=None, task=None):
-        """lerpPosPoint3(self, Point3, float, string="noBlend", string=None,
-        string=None, NodePath=None)
-        Perform a pos lerp with a Point3 as the end point
-        """
-        def functorFunc(self = self, pos = pos, other = other):
-            from pandac.PandaModules import PosLerpFunctor
-            if (other != None):
-                #lerp wrt other
-                functor = PosLerpFunctor(
-                    self, (self.getPos(other)), pos, other)
-            else:
-                functor = PosLerpFunctor(
-                    self, (self.getPos()), pos)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-Dtool_funcToMethod(lerpPosPoint3, NodePath)
-del lerpPosPoint3
-#####################################################################
-def lerpPosHpr(self, *posArgs, **keyArgs):
-        """lerpPosHpr(self, *positionArgs, **keywordArgs)
-        Determine whether to call lerpPosHprXYZHPR or lerpHprPoint3VBase3
-        based on first argument
-        """
-        # check to see if lerping with
-        # six floats or a Point3 and a VBase3
-        if (len(posArgs) == 7):
-            return apply(self.lerpPosHprXYZHPR, posArgs, keyArgs)
-        elif(len(posArgs) == 3):
-            return apply(self.lerpPosHprPoint3VBase3, posArgs, keyArgs)
-        else:
-            # bad number off args
-            raise Exception("Error: NodePath.lerpPosHpr: bad number of args")
-
-Dtool_funcToMethod(lerpPosHpr, NodePath)
-del lerpPosHpr
-#####################################################################
-def lerpPosHprPoint3VBase3(self, pos, hpr, time, other=None,
-                               blendType="noBlend", auto=None, task=None, shortest=1):
-        """lerpPosHprPoint3VBase3(self, Point3, VBase3, string="noBlend",
-        string=none, string=none, NodePath=None)
-        """
-        def functorFunc(self = self, pos = pos, hpr = hpr,
-                        other = other, shortest=shortest):
-            from pandac.PandaModules import PosHprLerpFunctor
-            if (other != None):
-                # lerp wrt other
-                startPos = self.getPos(other)
-                startHpr = self.getHpr(other)
-                functor = PosHprLerpFunctor(
-                    self, startPos, pos,
-                    startHpr, hpr, other)
-                if shortest:
-                    functor.takeShortest()
-            else:
-                startPos = self.getPos()
-                startHpr = self.getHpr()
-                functor = PosHprLerpFunctor(
-                    self, startPos, pos,
-                    startHpr, hpr)
-                if shortest:
-                    functor.takeShortest()
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpPosHprPoint3VBase3, NodePath)
-del lerpPosHprPoint3VBase3
-#####################################################################
-def lerpPosHprXYZHPR(self, x, y, z, h, p, r, time, other=None,
-                         blendType="noBlend", auto=None, task=None, shortest=1):
-        """lerpPosHpr(self, float, string="noBlend", string=none,
-        string=none, NodePath=None)
-        """
-        def functorFunc(self = self, x = x, y = y, z = z,
-                        h = h, p = p, r = r, other = other, shortest=shortest):
-            from pandac.PandaModules import PosHprLerpFunctor
-            if (other != None):
-                # lerp wrt other
-                startPos = self.getPos(other)
-                startHpr = self.getHpr(other)
-                functor = PosHprLerpFunctor(self,
-                                            startPos[0], startPos[1],
-                                            startPos[2], x, y, z,
-                                            startHpr[0], startHpr[1],
-                                            startHpr[2], h, p, r,
-                                            other)
-                if shortest:
-                    functor.takeShortest()
-            else:
-                startPos = self.getPos()
-                startHpr = self.getHpr()
-                functor = PosHprLerpFunctor(self,
-                                            startPos[0], startPos[1],
-                                            startPos[2], x, y, z,
-                                            startHpr[0], startHpr[1],
-                                            startHpr[2], h, p, r)
-                if shortest:
-                    functor.takeShortest()
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-Dtool_funcToMethod(lerpPosHprXYZHPR, NodePath)
-del lerpPosHprXYZHPR
-#####################################################################
-def lerpPosHprScale(self, pos, hpr, scale, time, other=None,
-                        blendType="noBlend", auto=None, task=None, shortest=1):
-        """lerpPosHpr(self, Point3, VBase3, float, float, string="noBlend",
-        string=none, string=none, NodePath=None)
-        Only one case, no need for extra args. Call the appropriate lerp
-        (auto, spawned, or blocking) based on how(if) a task name is given
-        """
-        def functorFunc(self = self, pos = pos, hpr = hpr,
-                        scale = scale, other = other, shortest=shortest):
-            from pandac.PandaModules import PosHprScaleLerpFunctor
-            if (other != None):
-                # lerp wrt other
-                startPos = self.getPos(other)
-                startHpr = self.getHpr(other)
-                startScale = self.getScale(other)
-                functor = PosHprScaleLerpFunctor(self,
-                                                 startPos, pos,
-                                                 startHpr, hpr,
-                                                 startScale, scale, other)
-                if shortest:
-                    functor.takeShortest()
-            else:
-                startPos = self.getPos()
-                startHpr = self.getHpr()
-                startScale = self.getScale()
-                functor = PosHprScaleLerpFunctor(self,
-                                                 startPos, pos,
-                                                 startHpr, hpr,
-                                                 startScale, scale)
-                if shortest:
-                    functor.takeShortest()
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-Dtool_funcToMethod(lerpPosHprScale, NodePath)
-del lerpPosHprScale
-#####################################################################
-def lerpScale(self, *posArgs, **keyArgs):
-        """lerpSclae(self, *positionArgs, **keywordArgs)
-        Determine whether to call lerpScaleXYZ or lerpScaleaseV3
-        based on the first argument
-        """
-        # check to see if lerping with three
-        # floats or a Point3
-        if (len(posArgs) == 4):
-            return apply(self.lerpScaleXYZ, posArgs, keyArgs)
-        elif(len(posArgs) == 2):
-            return apply(self.lerpScaleVBase3, posArgs, keyArgs)
-        else:
-            # bad number off args
-            raise Exception("Error: NodePath.lerpScale: bad number of args")
-
-Dtool_funcToMethod(lerpScale, NodePath)
-del lerpScale
-#####################################################################
-def lerpScaleVBase3(self, scale, time, other=None,
-                        blendType="noBlend", auto=None, task=None):
-        """lerpPos(self, VBase3, float, string="noBlend", string=none,
-        string=none, NodePath=None)
-        """
-        def functorFunc(self = self, scale = scale, other = other):
-            from pandac.PandaModules import ScaleLerpFunctor
-            if (other != None):
-                # lerp wrt other
-                functor = ScaleLerpFunctor(self,
-                                           (self.getScale(other)),
-                                           scale, other)
-            else:
-                functor = ScaleLerpFunctor(self,
-                                           (self.getScale()), scale)
-
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-Dtool_funcToMethod(lerpScaleVBase3, NodePath)
-del lerpScaleVBase3
-#####################################################################
-def lerpScaleXYZ(self, sx, sy, sz, time, other=None,
-                     blendType="noBlend", auto=None, task=None):
-        """lerpPos(self, float, float, float, float, string="noBlend",
-        string=none, string=none, NodePath=None)
-        """
-        def functorFunc(self = self, sx = sx, sy = sy, sz = sz, other = other):
-            from pandac.PandaModules import ScaleLerpFunctor
-            if (other != None):
-                # lerp wrt other
-                startScale = self.getScale(other)
-                functor = ScaleLerpFunctor(self,
-                                           startScale[0], startScale[1],
-                                           startScale[2], sx, sy, sz, other)
-            else:
-                startScale = self.getScale()
-                functor = ScaleLerpFunctor(self,
-                                           startScale[0], startScale[1],
-                                           startScale[2], sx, sy, sz)
-            return functor
-        #determine whether to use auto, spawned, or blocking lerp
-        if (auto != None):
-            return self.__autoLerp(functorFunc, time, blendType, auto)
-        elif (task != None):
-            return self.__lerp(functorFunc, time, blendType, task)
-        else:
-            return self.__lerp(functorFunc, time, blendType)
-
-
-
-
-Dtool_funcToMethod(lerpScaleXYZ, NodePath)
-del lerpScaleXYZ
-#####################################################################
 def place(self):
 def place(self):
         base.startDirect(fWantTk = 1)
         base.startDirect(fWantTk = 1)
         from direct.tkpanels import Placer
         from direct.tkpanels import Placer
@@ -1253,8 +553,8 @@ Dtool_funcToMethod(colorScaleInterval, NodePath)
 del colorScaleInterval
 del colorScaleInterval
 #####################################################################
 #####################################################################
 def attachCollisionSphere(self, name, cx, cy, cz, r, fromCollide, intoCollide):
 def attachCollisionSphere(self, name, cx, cy, cz, r, fromCollide, intoCollide):
-        from pandac.PandaModules import CollisionSphere
-        from pandac.PandaModules import CollisionNode
+        from panda3d.core import CollisionSphere
+        from panda3d.core import CollisionNode
         coll = CollisionSphere(cx, cy, cz, r)
         coll = CollisionSphere(cx, cy, cz, r)
         collNode = CollisionNode(name)
         collNode = CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
@@ -1267,8 +567,8 @@ Dtool_funcToMethod(attachCollisionSphere, NodePath)
 del attachCollisionSphere
 del attachCollisionSphere
 #####################################################################
 #####################################################################
 def attachCollisionSegment(self, name, ax, ay, az, bx, by, bz, fromCollide, intoCollide):
 def attachCollisionSegment(self, name, ax, ay, az, bx, by, bz, fromCollide, intoCollide):
-        from pandac.PandaModules import CollisionSegment
-        from pandac.PandaModules import CollisionNode
+        from panda3d.core import CollisionSegment
+        from panda3d.core import CollisionNode
         coll = CollisionSegment(ax, ay, az, bx, by, bz)
         coll = CollisionSegment(ax, ay, az, bx, by, bz)
         collNode = CollisionNode(name)
         collNode = CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
@@ -1281,8 +581,8 @@ Dtool_funcToMethod(attachCollisionSegment, NodePath)
 del attachCollisionSegment
 del attachCollisionSegment
 #####################################################################
 #####################################################################
 def attachCollisionRay(self, name, ox, oy, oz, dx, dy, dz, fromCollide, intoCollide):
 def attachCollisionRay(self, name, ox, oy, oz, dx, dy, dz, fromCollide, intoCollide):
-        from pandac.PandaModules import CollisionRay
-        from pandac.PandaModules import CollisionNode
+        from panda3d.core import CollisionRay
+        from panda3d.core import CollisionNode
         coll = CollisionRay(ox, oy, oz, dx, dy, dz)
         coll = CollisionRay(ox, oy, oz, dx, dy, dz)
         collNode = CollisionNode(name)
         collNode = CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
@@ -1296,7 +596,7 @@ del attachCollisionRay
 #####################################################################
 #####################################################################
 def flattenMultitex(self, stateFrom = None, target = None,
 def flattenMultitex(self, stateFrom = None, target = None,
                         useGeom = 0, allowTexMat = 0, win = None):
                         useGeom = 0, allowTexMat = 0, win = None):
-        from pandac.PandaModules import MultitexReducer
+        from panda3d.core import MultitexReducer
         mr = MultitexReducer()
         mr = MultitexReducer()
         if target != None:
         if target != None:
             mr.setTarget(target)
             mr.setTarget(target)
@@ -1466,26 +766,31 @@ del r_constructCollisionTree
 
 
 #####################################################################
 #####################################################################
 def analyze(self):
 def analyze(self):
-        from pandac.PandaModules import SceneGraphAnalyzer
+        """
+        Analyzes the geometry below this node and reports the
+        number of vertices, triangles, etc.  This is the same
+        information reported by the bam-info program.
+        """
+        from panda3d.core import SceneGraphAnalyzer
         sga = SceneGraphAnalyzer()
         sga = SceneGraphAnalyzer()
         sga.addNode(self.node())
         sga.addNode(self.node())
         if sga.getNumLodNodes() == 0:
         if sga.getNumLodNodes() == 0:
-                print sga
+                print(sga)
         else:
         else:
-                print "At highest LOD:"
+                print("At highest LOD:")
                 sga2 = SceneGraphAnalyzer()
                 sga2 = SceneGraphAnalyzer()
                 sga2.setLodMode(sga2.LMHighest)
                 sga2.setLodMode(sga2.LMHighest)
                 sga2.addNode(self.node())
                 sga2.addNode(self.node())
-                print sga2
+                print(sga2)
 
 
-                print "\nAt lowest LOD:"
+                print("\nAt lowest LOD:")
                 sga2.clear()
                 sga2.clear()
                 sga2.setLodMode(sga2.LMLowest)
                 sga2.setLodMode(sga2.LMLowest)
                 sga2.addNode(self.node())
                 sga2.addNode(self.node())
-                print sga2
+                print(sga2)
 
 
-                print "\nAll nodes:"
-                print sga
+                print("\nAll nodes:")
+                print(sga)
 
 
 Dtool_funcToMethod(analyze, NodePath)
 Dtool_funcToMethod(analyze, NodePath)
 del analyze
 del analyze

+ 1 - 1
direct/src/extensions_native/VBase3_extensions.py

@@ -14,7 +14,7 @@ def asTuple(self):
     """
     """
     Returns the vector as a tuple.
     Returns the vector as a tuple.
     """
     """
-    print "Warning: VBase3.asTuple() is no longer needed and deprecated.  Use the vector directly instead."
+    print("Warning: VBase3.asTuple() is no longer needed and deprecated.  Use the vector directly instead.")
     return tuple(self)
     return tuple(self)
 Dtool_funcToMethod(asTuple, VBase3)
 Dtool_funcToMethod(asTuple, VBase3)
 del asTuple
 del asTuple

+ 1 - 1
direct/src/extensions_native/VBase4_extensions.py

@@ -14,7 +14,7 @@ def asTuple(self):
     """
     """
     Returns the vector as a tuple.
     Returns the vector as a tuple.
     """
     """
-    print "Warning: VBase4.asTuple() is no longer needed and deprecated.  Use the vector directly instead."
+    print("Warning: VBase4.asTuple() is no longer needed and deprecated.  Use the vector directly instead.")
     return tuple(self)
     return tuple(self)
 
 
 Dtool_funcToMethod(asTuple, VBase4)
 Dtool_funcToMethod(asTuple, VBase4)

+ 28 - 0
direct/src/extensions_native/core_extensions.py

@@ -0,0 +1,28 @@
+import sys
+
+main_dir = Filename()
+
+if sys.argv and sys.argv[0]:
+    main_dir = Filename.from_os_specific(sys.argv[0])
+
+if main_dir.empty():
+    # We must be running in the Python interpreter directly, so return the CWD.
+    main_dir = ExecutionEnvironment.get_cwd()
+else:
+    main_dir.make_absolute()
+    main_dir = Filename(main_dir.get_dirname())
+ExecutionEnvironment.shadow_environment_variable('MAIN_DIR', main_dir.to_os_specific())
+del sys, main_dir
+
+
+def Dtool_funcToMethod(func, cls, method_name=None):
+    """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
+    The new method is accessible to any instance immediately."""
+    #if sys.version_info < (3, 0):
+    #    func.im_class = cls
+    func.im_func = func
+    func.im_self = None
+    if not method_name:
+        method_name = func.__name__
+    cls.DtoolClassDict[method_name] = func;
+

+ 4 - 5
direct/src/extensions_native/extension_native_helpers.py

@@ -107,14 +107,13 @@ def Dtool_PreloadDLL(module):
 # Dtool_FindModule to find our panda3d.core module.  However, we
 # Dtool_FindModule to find our panda3d.core module.  However, we
 # should be able to import it.  To differentiate the old-style Panda
 # should be able to import it.  To differentiate the old-style Panda
 # build (with .dll's) from the new-style Panda build (with .pyd's), we
 # build (with .dll's) from the new-style Panda build (with .pyd's), we
-# first try to import libpandaexpress directly; if it succeeds we're
-# in an old-style build, and if it fails we must be in a new-style
-# build.
+# first try to import panda3d.core directly; if it succeeds we're in a
+# new-style build, and if it fails we must be in an old-style build.
 try:
 try:
+    from panda3d.core import *
+except ImportError:
     Dtool_PreloadDLL("libpandaexpress")
     Dtool_PreloadDLL("libpandaexpress")
     from libpandaexpress import *
     from libpandaexpress import *
-except ImportError:
-    from panda3d.core import *
 
 
 def Dtool_ObjectToDict(cls, name, obj):
 def Dtool_ObjectToDict(cls, name, obj):
     cls.DtoolClassDict[name] = obj;
     cls.DtoolClassDict[name] = obj;

+ 2 - 4
direct/src/ffi/DoGenPyCode.py

@@ -5,8 +5,6 @@ the user to specify alternate parameters on the command line. """
 import getopt
 import getopt
 import sys
 import sys
 import os
 import os
-import glob
-import types
 import time
 import time
 from direct.ffi import FFIConstants
 from direct.ffi import FFIConstants
 
 
@@ -224,7 +222,7 @@ def doErrorCheck():
         FFIConstants.CodeModuleNameList = codeLibs
         FFIConstants.CodeModuleNameList = codeLibs
 
 
 def generateNativeWrappers():
 def generateNativeWrappers():
-    from direct.extensions_native.extension_native_helpers import Dtool_FindModule, Dtool_PreloadDLL
+    from direct.extensions_native.extension_native_helpers import Dtool_PreloadDLL
 
 
     # Empty out the output directories of unnecessary crud from
     # Empty out the output directories of unnecessary crud from
     # previous runs before we begin.
     # previous runs before we begin.
@@ -337,7 +335,7 @@ def run():
 
 
     if doHTML:
     if doHTML:
         from direct.directscripts import gendocs
         from direct.directscripts import gendocs
-        from pandac.PandaModules import PandaSystem
+        from panda3d.core import PandaSystem
         versionString = '%s %s' % (
         versionString = '%s %s' % (
             PandaSystem.getDistributor(), PandaSystem.getVersionString())
             PandaSystem.getDistributor(), PandaSystem.getVersionString())
 
 

+ 0 - 1
direct/src/ffi/FFITypes.py

@@ -8,7 +8,6 @@ They get constructed by and stored in FFIInterrogateDatabase.
 
 
 """
 """
 
 
-import sys
 import os
 import os
 import string
 import string
 import FFIConstants
 import FFIConstants

+ 0 - 1
direct/src/ffi/jGenPyCode.py

@@ -72,7 +72,6 @@ if (EXTENSIONS is None):
 ##############################################################
 ##############################################################
 
 
 from direct.ffi import DoGenPyCode
 from direct.ffi import DoGenPyCode
-from direct.ffi import FFIConstants
 DoGenPyCode.outputCodeDir = PANDAC
 DoGenPyCode.outputCodeDir = PANDAC
 DoGenPyCode.outputHTMLDir = os.path.join(PANDAC,"..","doc")
 DoGenPyCode.outputHTMLDir = os.path.join(PANDAC,"..","doc")
 DoGenPyCode.directDir = DIRECT
 DoGenPyCode.directDir = DIRECT

+ 9 - 10
direct/src/filter/CommonFilters.py

@@ -16,12 +16,11 @@ clunky approach.  - Josh
 """
 """
 
 
 from FilterManager import FilterManager
 from FilterManager import FilterManager
-from pandac.PandaModules import Point3, Vec3, Vec4, Point2
-from pandac.PandaModules import NodePath, PandaNode
-from pandac.PandaModules import Filename
-from pandac.PandaModules import AuxBitplaneAttrib
-from pandac.PandaModules import RenderState, Texture, Shader, ATSNone
-import sys,os
+from panda3d.core import LVecBase4, LPoint2
+from panda3d.core import Filename
+from panda3d.core import AuxBitplaneAttrib
+from panda3d.core import Texture, Shader, ATSNone
+import os
 
 
 CARTOON_BODY="""
 CARTOON_BODY="""
 float4 cartoondelta = k_cartoonseparation * texpix_txaux.xwyw;
 float4 cartoondelta = k_cartoonseparation * texpix_txaux.xwyw;
@@ -348,13 +347,13 @@ class CommonFilters:
         if (changed == "CartoonInk") or fullrebuild:
         if (changed == "CartoonInk") or fullrebuild:
             if ("CartoonInk" in configuration):
             if ("CartoonInk" in configuration):
                 c = configuration["CartoonInk"]
                 c = configuration["CartoonInk"]
-                self.finalQuad.setShaderInput("cartoonseparation", Vec4(c.separation, 0, c.separation, 0))
+                self.finalQuad.setShaderInput("cartoonseparation", LVecBase4(c.separation, 0, c.separation, 0))
                 self.finalQuad.setShaderInput("cartooncolor", c.color)
                 self.finalQuad.setShaderInput("cartooncolor", c.color)
 
 
         if (changed == "BlurSharpen") or fullrebuild:
         if (changed == "BlurSharpen") or fullrebuild:
             if ("BlurSharpen" in configuration):
             if ("BlurSharpen" in configuration):
                 blurval = configuration["BlurSharpen"]
                 blurval = configuration["BlurSharpen"]
-                self.finalQuad.setShaderInput("blurval", Vec4(blurval, blurval, blurval, blurval))
+                self.finalQuad.setShaderInput("blurval", LVecBase4(blurval, blurval, blurval, blurval))
 
 
         if (changed == "Bloom") or fullrebuild:
         if (changed == "Bloom") or fullrebuild:
             if ("Bloom" in configuration):
             if ("Bloom" in configuration):
@@ -386,9 +385,9 @@ class CommonFilters:
 
 
         if "VolumetricLighting" in self.configuration:
         if "VolumetricLighting" in self.configuration:
             caster = self.configuration["VolumetricLighting"].caster
             caster = self.configuration["VolumetricLighting"].caster
-            casterpos = Point2()
+            casterpos = LPoint2()
             self.manager.camera.node().getLens().project(caster.getPos(self.manager.camera), casterpos)
             self.manager.camera.node().getLens().project(caster.getPos(self.manager.camera), casterpos)
-            self.finalQuad.setShaderInput("casterpos", Vec4(casterpos.getX() * 0.5 + 0.5, (casterpos.getY() * 0.5 + 0.5), 0, 0))
+            self.finalQuad.setShaderInput("casterpos", LVecBase4(casterpos.getX() * 0.5 + 0.5, (casterpos.getY() * 0.5 + 0.5), 0, 0))
         if task != None:
         if task != None:
             return task.cont
             return task.cont
 
 

+ 20 - 22
direct/src/filter/FilterManager.py

@@ -14,16 +14,14 @@ Still need to implement:
 
 
 """
 """
 
 
-from pandac.PandaModules import Point3, Vec3, Vec4
-from pandac.PandaModules import NodePath, PandaNode
-from pandac.PandaModules import RenderState, Texture, Shader
-from pandac.PandaModules import CardMaker
-from pandac.PandaModules import TextureStage
-from pandac.PandaModules import GraphicsPipe, GraphicsOutput
-from pandac.PandaModules import WindowProperties, FrameBufferProperties
-from pandac.PandaModules import Camera, DisplayRegion
-from pandac.PandaModules import OrthographicLens
-from pandac.PandaModules import AuxBitplaneAttrib
+from panda3d.core import NodePath
+from panda3d.core import Texture
+from panda3d.core import CardMaker
+from panda3d.core import GraphicsPipe, GraphicsOutput
+from panda3d.core import WindowProperties, FrameBufferProperties
+from panda3d.core import Camera
+from panda3d.core import OrthographicLens
+from panda3d.core import AuxBitplaneAttrib
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 
 
@@ -111,16 +109,16 @@ class FilterManager(DirectObject):
 
 
         winx = self.forcex
         winx = self.forcex
         winy = self.forcey
         winy = self.forcey
-        if (winx == 0): winx = self.win.getXSize()
-        if (winy == 0): winy = self.win.getYSize()
+        if winx == 0: winx = self.win.getXSize()
+        if winy == 0: winy = self.win.getYSize()
 
 
-        if (div != 1):
-            winx = ((winx+align-1) / align) * align
-            winy = ((winy+align-1) / align) * align
-            winx = winx / div
-            winy = winy / div
+        if div != 1:
+            winx = ((winx+align-1) // align) * align
+            winy = ((winy+align-1) // align) * align
+            winx = winx // div
+            winy = winy // div
 
 
-        if (mul != 1):
+        if mul != 1:
             winx = winx * mul
             winx = winx * mul
             winy = winy * mul
             winy = winy * mul
 
 
@@ -198,7 +196,7 @@ class FilterManager(DirectObject):
         quad.setDepthTest(0)
         quad.setDepthTest(0)
         quad.setDepthWrite(0)
         quad.setDepthWrite(0)
         quad.setTexture(colortex)
         quad.setTexture(colortex)
-        quad.setColor(Vec4(1,0.5,0.5,1))
+        quad.setColor(1, 0.5, 0.5, 1)
 
 
         cs = NodePath("dummy")
         cs = NodePath("dummy")
         cs.setState(self.camstate)
         cs.setState(self.camstate)
@@ -221,7 +219,7 @@ class FilterManager(DirectObject):
         self.setStackedClears(buffer, self.rclears, self.wclears)
         self.setStackedClears(buffer, self.rclears, self.wclears)
         if (auxtex0):
         if (auxtex0):
             buffer.setClearActive(GraphicsOutput.RTPAuxRgba0, 1)
             buffer.setClearActive(GraphicsOutput.RTPAuxRgba0, 1)
-            buffer.setClearValue(GraphicsOutput.RTPAuxRgba0, Vec4(0.5, 0.5, 1.0, 0.0))
+            buffer.setClearValue(GraphicsOutput.RTPAuxRgba0, (0.5, 0.5, 1.0, 0.0))
         if (auxtex1):
         if (auxtex1):
             buffer.setClearActive(GraphicsOutput.RTPAuxRgba1, 1)
             buffer.setClearActive(GraphicsOutput.RTPAuxRgba1, 1)
         self.region.disableClears()
         self.region.disableClears()
@@ -262,7 +260,7 @@ class FilterManager(DirectObject):
         quad = NodePath(cm.generate())
         quad = NodePath(cm.generate())
         quad.setDepthTest(0)
         quad.setDepthTest(0)
         quad.setDepthWrite(0)
         quad.setDepthWrite(0)
-        quad.setColor(Vec4(1,0.5,0.5,1))
+        quad.setColor(1, 0.5, 0.5, 1)
 
 
         quadcamnode = Camera("filter-quad-cam")
         quadcamnode = Camera("filter-quad-cam")
         lens = OrthographicLens()
         lens = OrthographicLens()
@@ -294,7 +292,7 @@ class FilterManager(DirectObject):
 
 
         winprops = WindowProperties()
         winprops = WindowProperties()
         winprops.setSize(xsize, ysize)
         winprops.setSize(xsize, ysize)
-        props = FrameBufferProperties(self.win.getFbProperties())
+        props = FrameBufferProperties(FrameBufferProperties.getDefault())
         props.setBackBuffers(0)
         props.setBackBuffers(0)
         props.setRgbColor(1)
         props.setRgbColor(1)
         props.setDepthBits(depthbits)
         props.setDepthBits(depthbits)

+ 0 - 1
direct/src/fsm/FourState.py

@@ -8,7 +8,6 @@ from direct.directnotify import DirectNotifyGlobal
 #import DistributedObject
 #import DistributedObject
 import ClassicFSM
 import ClassicFSM
 import State
 import State
-from direct.task import Task
 
 
 
 
 class FourState:
 class FourState:

+ 0 - 1
direct/src/fsm/SampleFSM.py

@@ -3,7 +3,6 @@
 __all__ = ['ClassicStyle', 'NewStyle', 'ToonEyes']
 __all__ = ['ClassicStyle', 'NewStyle', 'ToonEyes']
 
 
 import FSM
 import FSM
-from pandac.PandaModules import *
 from direct.task import Task
 from direct.task import Task
 import string
 import string
 
 

+ 0 - 1
direct/src/fsm/State.py

@@ -4,7 +4,6 @@ __all__ = ['State']
 
 
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-import types
 
 
 
 
 class State(DirectObject):
 class State(DirectObject):

+ 1 - 1
direct/src/fsm/StatePush.py

@@ -5,7 +5,7 @@ __all__ = ['StateVar', 'FunctionCall', 'EnterExit', 'Pulse', 'EventPulse',
            'EventArgument', ]
            'EventArgument', ]
 
 
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-import types
+
 
 
 class PushesStateChanges:
 class PushesStateChanges:
     # base class for objects that broadcast state changes to a set of subscriber objects
     # base class for objects that broadcast state changes to a set of subscriber objects

+ 1 - 1
direct/src/gui/DirectButton.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['DirectButton']
 __all__ = ['DirectButton']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 
 

+ 1 - 1
direct/src/gui/DirectCheckBox.py

@@ -1,5 +1,5 @@
 from direct.gui.DirectGui import *
 from direct.gui.DirectGui import *
-from pandac.PandaModules import *
+from panda3d.core import *
 
 
 
 
 class DirectCheckBox(DirectButton):
 class DirectCheckBox(DirectButton):

+ 1 - 2
direct/src/gui/DirectCheckButton.py

@@ -2,8 +2,7 @@
 
 
 __all__ = ['DirectCheckButton']
 __all__ = ['DirectCheckButton']
 
 
-from pandac.PandaModules import *
-import DirectGuiGlobals as DGG
+from panda3d.core import *
 from DirectButton import *
 from DirectButton import *
 from DirectLabel import *
 from DirectLabel import *
 
 

+ 25 - 11
direct/src/gui/DirectDialog.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['findDialog', 'cleanupDialog', 'DirectDialog', 'OkDialog', 'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog']
 __all__ = ['findDialog', 'cleanupDialog', 'DirectDialog', 'OkDialog', 'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *
@@ -94,8 +94,9 @@ class DirectDialog(DirectFrame):
             ('text',              '',            None),
             ('text',              '',            None),
             ('text_align',        TextNode.ALeft,   None),
             ('text_align',        TextNode.ALeft,   None),
             ('text_scale',        0.06,          None),
             ('text_scale',        0.06,          None),
-            ('image',  DGG.getDefaultDialogGeom(),   None),
-            ('relief',            None,          None),
+            ('image',             None,          None),
+            ('relief',            DGG.RAISED,     None),
+            ('borderWidth',       (0.01, 0.01),  None),
             ('buttonTextList',    [],            DGG.INITOPT),
             ('buttonTextList',    [],            DGG.INITOPT),
             ('buttonGeomList',    [],            DGG.INITOPT),
             ('buttonGeomList',    [],            DGG.INITOPT),
             ('buttonImageList',   [],            DGG.INITOPT),
             ('buttonImageList',   [],            DGG.INITOPT),
@@ -210,10 +211,16 @@ class DirectDialog(DirectFrame):
         bounds = self.stateNodePath[0].getTightBounds()
         bounds = self.stateNodePath[0].getTightBounds()
         if image:
         if image:
             image.reparentTo(self.stateNodePath[0])
             image.reparentTo(self.stateNodePath[0])
-        l = bounds[0][0]
-        r = bounds[1][0]
-        b = bounds[0][2]
-        t = bounds[1][2]
+        if bounds is None:
+            l = 0
+            r = 0
+            b = 0
+            t = 0
+        else:
+            l = bounds[0][0]
+            r = bounds[1][0]
+            b = bounds[0][2]
+            t = bounds[1][2]
         # Center text and geom around origin
         # Center text and geom around origin
         # How far is center of text from origin?
         # How far is center of text from origin?
         xOffset = -(l+r)*0.5
         xOffset = -(l+r)*0.5
@@ -246,10 +253,16 @@ class DirectDialog(DirectFrame):
                 bl = br = bb = bt = 0
                 bl = br = bb = bt = 0
                 for button in self.buttonList:
                 for button in self.buttonList:
                     bounds = button.stateNodePath[0].getTightBounds()
                     bounds = button.stateNodePath[0].getTightBounds()
-                    bl = min(bl, bounds[0][0])
-                    br = max(br, bounds[1][0])
-                    bb = min(bb, bounds[0][2])
-                    bt = max(bt, bounds[1][2])
+                    if bounds is None:
+                        bl = 0
+                        br = 0
+                        bb = 0
+                        bt = 0
+                    else:
+                        bl = min(bl, bounds[0][0])
+                        br = max(br, bounds[1][0])
+                        bb = min(bb, bounds[0][2])
+                        bt = max(bt, bounds[1][2])
                 bl -= bpad[0]
                 bl -= bpad[0]
                 br += bpad[0]
                 br += bpad[0]
                 bb -= bpad[1]
                 bb -= bpad[1]
@@ -303,6 +316,7 @@ class DirectDialog(DirectFrame):
         # reduce bottom by pad, button height and 2*button pad
         # reduce bottom by pad, button height and 2*button pad
         b = min(b - self['midPad'] - bpad[1] - bHeight - bpad[1], b) - pad[1]
         b = min(b - self['midPad'] - bpad[1] - bHeight - bpad[1], b) - pad[1]
         t = t + self['topPad'] + pad[1]
         t = t + self['topPad'] + pad[1]
+        self['frameSize'] = (l, r, b, t)
         self['image_scale'] = (r - l, 1, t - b)
         self['image_scale'] = (r - l, 1, t - b)
         # Center frame about text and buttons
         # Center frame about text and buttons
         self['image_pos'] = ((l+r)*0.5, 0.0, (b+t)*0.5)
         self['image_pos'] = ((l+r)*0.5, 0.0, (b+t)*0.5)

+ 1 - 1
direct/src/gui/DirectEntry.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['DirectEntry']
 __all__ = ['DirectEntry']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from OnscreenText import OnscreenText
 from OnscreenText import OnscreenText

+ 2 - 4
direct/src/gui/DirectEntryScroll.py

@@ -1,6 +1,6 @@
 __all__ = ['DirectEntryScroll']
 __all__ = ['DirectEntryScroll']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectScrolledFrame import *
 from DirectScrolledFrame import *
 from DirectFrame import *
 from DirectFrame import *
@@ -114,6 +114,4 @@ class DirectEntryScroll(DirectFrame):
         
         
     def resetCanvas(self):
     def resetCanvas(self):
         self.canvas.setPos(0,0,0)
         self.canvas.setPos(0,0,0)
-        
-        
-        
+

+ 2 - 2
direct/src/gui/DirectFrame.py

@@ -2,12 +2,12 @@
 
 
 __all__ = ['DirectFrame']
 __all__ = ['DirectFrame']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectGuiBase import *
 from DirectGuiBase import *
 from OnscreenImage import OnscreenImage
 from OnscreenImage import OnscreenImage
 from OnscreenGeom import OnscreenGeom
 from OnscreenGeom import OnscreenGeom
-import string, types
+import types
 
 
 class DirectFrame(DirectGuiWidget):
 class DirectFrame(DirectGuiWidget):
     DefDynGroups = ('text', 'geom', 'image')
     DefDynGroups = ('text', 'geom', 'image')

+ 7 - 9
direct/src/gui/DirectGuiBase.py

@@ -3,7 +3,8 @@
 __all__ = ['DirectGuiBase', 'DirectGuiWidget']
 __all__ = ['DirectGuiBase', 'DirectGuiWidget']
 
 
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
+from panda3d.direct import get_config_showbase
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from OnscreenText import *
 from OnscreenText import *
 from OnscreenGeom import *
 from OnscreenGeom import *
@@ -11,9 +12,7 @@ from OnscreenImage import *
 from direct.directtools.DirectUtil import ROUND_TO
 from direct.directtools.DirectUtil import ROUND_TO
 from direct.showbase import DirectObject
 from direct.showbase import DirectObject
 from direct.task import Task
 from direct.task import Task
-from direct.showbase import ShowBase
 from direct.showbase.PythonUtil import recordCreationStackStr
 from direct.showbase.PythonUtil import recordCreationStackStr
-from pandac.PandaModules import PStatCollector
 import types
 import types
 
 
 guiObjectCollector = PStatCollector("Client::GuiObjects")
 guiObjectCollector = PStatCollector("Client::GuiObjects")
@@ -632,7 +631,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         """
         """
         # Need to tack on gui item specific id
         # Need to tack on gui item specific id
         gEvent = event + self.guiId
         gEvent = event + self.guiId
-        if base.config.GetBool('debug-directgui-msgs', False):
+        if get_config_showbase().GetBool('debug-directgui-msgs', False):
             from direct.showbase.PythonUtil import StackTrace
             from direct.showbase.PythonUtil import StackTrace
             print gEvent
             print gEvent
             print StackTrace()
             print StackTrace()
@@ -655,7 +654,7 @@ def setGuiGridSpacing(spacing):
 # this should trigger off of __dev__, but it's not available at this point.
 # this should trigger off of __dev__, but it's not available at this point.
 # __debug__ works because the production client is not __debug__ and the
 # __debug__ works because the production client is not __debug__ and the
 # production AI doesn't create any GUI.
 # production AI doesn't create any GUI.
-if config.GetBool('record-gui-creation-stack', __debug__):
+if get_config_showbase().GetBool('record-gui-creation-stack', __debug__):
     # this will help track down the code that created DirectGui objects
     # this will help track down the code that created DirectGui objects
     # call obj.printCreationStackTrace() to figure out what code created it
     # call obj.printCreationStackTrace() to figure out what code created it
     DirectGuiBase = recordCreationStackStr(DirectGuiBase)
     DirectGuiBase = recordCreationStackStr(DirectGuiBase)
@@ -668,8 +667,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
     # Determine the default initial state for inactive (or
     # Determine the default initial state for inactive (or
     # unclickable) components.  If we are in edit mode, these are
     # unclickable) components.  If we are in edit mode, these are
     # actually clickable by default.
     # actually clickable by default.
-    #guiEdit = base.config.GetBool('direct-gui-edit', 0)
-    guiEdit = config.GetBool('direct-gui-edit', 0)
+    guiEdit = get_config_showbase().GetBool('direct-gui-edit', 0)
     if guiEdit:
     if guiEdit:
         inactiveInitState = DGG.NORMAL
         inactiveInitState = DGG.NORMAL
     else:
     else:
@@ -1069,8 +1067,8 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
     def printConfig(self, indent = 0):
     def printConfig(self, indent = 0):
         space = ' ' * indent
         space = ' ' * indent
         print space + self.guiId, '-', self.__class__.__name__
         print space + self.guiId, '-', self.__class__.__name__
-        print space + 'Pos:   ' + self.getPos().pPrintValues()
-        print space + 'Scale: ' + self.getScale().pPrintValues()
+        print space + 'Pos:   %s' % tuple(self.getPos())
+        print space + 'Scale: %s' % tuple(self.getScale())
         # Print out children info
         # Print out children info
         for child in self.getChildren():
         for child in self.getChildren():
             messenger.send(DGG.PRINT + child.getName(), [indent + 2])
             messenger.send(DGG.PRINT + child.getName(), [indent + 2])

+ 1 - 1
direct/src/gui/DirectGuiGlobals.py

@@ -7,7 +7,7 @@ __all__ = []
 Global definitions used by Direct Gui Classes and handy constants
 Global definitions used by Direct Gui Classes and handy constants
 that can be used during widget construction
 that can be used during widget construction
 """
 """
-from pandac.PandaModules import *
+from panda3d.core import *
 
 
 defaultFont = None
 defaultFont = None
 defaultFontFunc = TextNode.getDefaultFont
 defaultFontFunc = TextNode.getDefaultFont

+ 3 - 1
direct/src/gui/DirectGuiTest.py

@@ -4,11 +4,13 @@ __all__ = []
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
-    from direct.directbase import DirectStart
+    from direct.showbase.ShowBase import ShowBase
     from DirectGui import *
     from DirectGui import *
     #from whrandom import *
     #from whrandom import *
     from random import *
     from random import *
 
 
+    base = ShowBase()
+
     # EXAMPLE CODE
     # EXAMPLE CODE
     # Load a model
     # Load a model
     smiley = loader.loadModel('models/misc/smiley')
     smiley = loader.loadModel('models/misc/smiley')

+ 1 - 2
direct/src/gui/DirectLabel.py

@@ -2,8 +2,7 @@
 
 
 __all__ = ['DirectLabel']
 __all__ = ['DirectLabel']
 
 
-from pandac.PandaModules import *
-import DirectGuiGlobals as DGG
+from panda3d.core import *
 from DirectFrame import *
 from DirectFrame import *
 
 
 class DirectLabel(DirectFrame):
 class DirectLabel(DirectFrame):

+ 1 - 1
direct/src/gui/DirectOptionMenu.py

@@ -4,7 +4,7 @@ __all__ = ['DirectOptionMenu']
 
 
 import types
 import types
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectButton import *
 from DirectButton import *
 from DirectLabel import *
 from DirectLabel import *

+ 6 - 4
direct/src/gui/DirectRadioButton.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['DirectRadioButton']
 __all__ = ['DirectRadioButton']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectButton import *
 from DirectButton import *
 from DirectLabel import *
 from DirectLabel import *
@@ -43,7 +43,7 @@ class DirectRadioButton(DirectButton):
             ('boxGeom', None, None),
             ('boxGeom', None, None),
             ('boxGeomColor', None, None),
             ('boxGeomColor', None, None),
             ('boxGeomScale', 1.0, None),
             ('boxGeomScale', 1.0, None),
-            ('boxImage', loader.loadModel('models/gui/radio_button_gui'), None),
+            ('boxImage', None, None),
             ('boxImageScale', 1.0, None),
             ('boxImageScale', 1.0, None),
             ('boxImageColor', VBase4(1, 1, 1, 1), None),
             ('boxImageColor', VBase4(1, 1, 1, 1), None),
             ('boxRelief', None, None),
             ('boxRelief', None, None),
@@ -69,9 +69,11 @@ class DirectRadioButton(DirectButton):
         # Call option initialization functions
         # Call option initialization functions
         self.initialiseoptions(DirectRadioButton)
         self.initialiseoptions(DirectRadioButton)
         # After initialization with X giving it the correct size, put back space
         # After initialization with X giving it the correct size, put back space
-        if self['boxGeom'] ==  None:
+        if self['boxGeom'] is None:
+            if not 'boxRelief' in kw and self['boxImage'] is None:
+                self.indicator['relief'] = DGG.SUNKEN
             self.indicator['text'] = (' ', '*')
             self.indicator['text'] = (' ', '*')
-            self.indicator['text_pos'] = (0, -.5)
+            self.indicator['text_pos'] = (0, -.25)
         else:
         else:
             self.indicator['text'] = (' ', ' ')
             self.indicator['text'] = (' ', ' ')
 
 

+ 1 - 1
direct/src/gui/DirectScrollBar.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['DirectScrollBar']
 __all__ = ['DirectScrollBar']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *

+ 1 - 1
direct/src/gui/DirectScrolledFrame.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['DirectScrolledFrame']
 __all__ = ['DirectScrolledFrame']
 
 
-from pandac.PandaModules import *
+from panda3d.core import *
 import DirectGuiGlobals as DGG
 import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectScrollBar import *
 from DirectScrollBar import *

Some files were not shown because too many files changed in this diff