2
0
Эх сурвалжийг харах

small changes and added add_x() to vectors

Dave Schuyler 22 жил өмнө
parent
commit
078f4c50c5

+ 2 - 2
direct/src/actor/Actor.py

@@ -483,7 +483,7 @@ class Actor(PandaObject, NodePath):
         return controls[0].getPlayRate()
         return controls[0].getPlayRate()
     
     
     def setPlayRate(self, rate, animName, partName=None):
     def setPlayRate(self, rate, animName, partName=None):
-        """getPlayRate(self, float, string, string=None)
+        """setPlayRate(self, float, string, string=None)
         Set the play rate of given anim for a given part.
         Set the play rate of given anim for a given part.
         If no part is given, set for all parts in dictionary.
         If no part is given, set for all parts in dictionary.
 
 
@@ -508,7 +508,7 @@ class Actor(PandaObject, NodePath):
             return None
             return None
 
 
         animControl = controls[0]
         animControl = controls[0]
-        return (animControl.getNumFrames() / animControl.getFrameRate())
+        return animControl.getNumFrames() / animControl.getFrameRate()
 
 
     def getNumFrames(self, animName=None, partName=None):
     def getNumFrames(self, animName=None, partName=None):
         """ getNumFrames(animName, partName)
         """ getNumFrames(animName, partName)

+ 0 - 9
direct/src/distributed/ClientRepository.py

@@ -78,7 +78,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
             # List the cdc in the number and name dictionaries
             # List the cdc in the number and name dictionaries
             self.number2cdc[dcClass.getNumber()]=clientDistClass
             self.number2cdc[dcClass.getNumber()]=clientDistClass
             self.name2cdc[dcClass.getName()]=clientDistClass
             self.name2cdc[dcClass.getName()]=clientDistClass
-        return None
 
 
     def handleGenerateWithRequired(self, di):
     def handleGenerateWithRequired(self, di):
         # Get the class Id
         # Get the class Id
@@ -89,7 +88,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         cdc = self.number2cdc[classId]
         cdc = self.number2cdc[classId]
         # Create a new distributed object, and put it in the dictionary
         # Create a new distributed object, and put it in the dictionary
         distObj = self.generateWithRequiredFields(cdc, doId, di)
         distObj = self.generateWithRequiredFields(cdc, doId, di)
-        return None
 
 
     def handleGenerateWithRequiredOther(self, di):
     def handleGenerateWithRequiredOther(self, di):
         # Get the class Id
         # Get the class Id
@@ -100,7 +98,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         cdc = self.number2cdc[classId]
         cdc = self.number2cdc[classId]
         # Create a new distributed object, and put it in the dictionary
         # Create a new distributed object, and put it in the dictionary
         distObj = self.generateWithRequiredOtherFields(cdc, doId, di)
         distObj = self.generateWithRequiredOtherFields(cdc, doId, di)
-        return None
 
 
     def handleQuietZoneGenerateWithRequired(self, di):
     def handleQuietZoneGenerateWithRequired(self, di):
         # Special handler for quiet zone generates -- we need to filter
         # Special handler for quiet zone generates -- we need to filter
@@ -115,7 +112,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         if cdc.constructor.neverDisable:
         if cdc.constructor.neverDisable:
             # Create a new distributed object, and put it in the dictionary
             # Create a new distributed object, and put it in the dictionary
             distObj = self.generateWithRequiredFields(cdc, doId, di)
             distObj = self.generateWithRequiredFields(cdc, doId, di)
-        return None
 
 
     def handleQuietZoneGenerateWithRequiredOther(self, di):
     def handleQuietZoneGenerateWithRequiredOther(self, di):
         # Special handler for quiet zone generates -- we need to filter
         # Special handler for quiet zone generates -- we need to filter
@@ -241,7 +237,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
             ClientRepository.notify.warning("Disable failed. DistObj " +
             ClientRepository.notify.warning("Disable failed. DistObj " +
                                             str(doId) +
                                             str(doId) +
                                             " is not in dictionary")
                                             " is not in dictionary")
-        return None
 
 
     def handleDelete(self, di):
     def handleDelete(self, di):
         # Get the DO Id
         # Get the DO Id
@@ -282,7 +277,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         else:
         else:
             ClientRepository.notify.warning(
             ClientRepository.notify.warning(
                 "Asked to delete non-existent DistObj " + str(doId))
                 "Asked to delete non-existent DistObj " + str(doId))
-        return None
 
 
     def handleUpdateField(self, di):
     def handleUpdateField(self, di):
         # Get the DO Id
         # Get the DO Id
@@ -300,7 +294,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         else:
         else:
             ClientRepository.notify.warning(
             ClientRepository.notify.warning(
                 "Asked to update non-existent DistObj " + str(doId))
                 "Asked to update non-existent DistObj " + str(doId))
-        return None
 
 
     def handleGoGetLost(self, di):
     def handleGoGetLost(self, di):
         # The server told us it's about to drop the connection on us.
         # The server told us it's about to drop the connection on us.
@@ -347,7 +340,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
                 currentLoginStateName +
                 currentLoginStateName +
                 " game state: " +
                 " game state: " +
                 currentGameStateName)
                 currentGameStateName)
-        return None
 
 
     def sendSetShardMsg(self, shardId):
     def sendSetShardMsg(self, shardId):
         datagram = Datagram()
         datagram = Datagram()
@@ -357,7 +349,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         datagram.addUint32(shardId)
         datagram.addUint32(shardId)
         # send the message
         # send the message
         self.send(datagram)
         self.send(datagram)
-        return None
 
 
     def sendSetZoneMsg(self, zoneId, visibleZoneList=None):
     def sendSetZoneMsg(self, zoneId, visibleZoneList=None):
         datagram = Datagram()
         datagram = Datagram()

+ 1 - 3
direct/src/showbase/Loader.py

@@ -67,9 +67,7 @@ class Loader:
         times before parenting each instance somewhere, or when you
         times before parenting each instance somewhere, or when you
         want to load a model and immediately set a transform on it.
         want to load a model and immediately set a transform on it.
         But also consider loadModelCopy().
         But also consider loadModelCopy().
-        
         """
         """
-
         assert(Loader.notify.debug("Loading model once: %s under %s" % (modelPath, underNode)))
         assert(Loader.notify.debug("Loading model once: %s under %s" % (modelPath, underNode)))
         if phaseChecker:
         if phaseChecker:
             phaseChecker(modelPath)
             phaseChecker(modelPath)
@@ -91,7 +89,7 @@ class Loader:
             phaseChecker(modelPath)
             phaseChecker(modelPath)
         node = ModelPool.loadModel(modelPath)
         node = ModelPool.loadModel(modelPath)
         if (node != None):
         if (node != None):
-            return (NodePath(node.copySubgraph()))
+            return NodePath(node.copySubgraph())
         else:
         else:
             return None
             return None
 
 

+ 0 - 1
panda/src/audiotraits/milesAudioSound.cxx

@@ -55,7 +55,6 @@ namespace {
       audio_debug("MilesAudioSound "<<get_status_char(_audio)<<" \""<<get_name() \
       audio_debug("MilesAudioSound "<<get_status_char(_audio)<<" \""<<get_name() \
       <<"\" "<< x )
       <<"\" "<< x )
 }
 }
-
 #else //][
 #else //][
 #define miles_audio_debug(x) ((void)0)
 #define miles_audio_debug(x) ((void)0)
 #endif //]
 #endif //]

+ 2 - 4
panda/src/chan/vector_PartGroupStar.h

@@ -19,10 +19,8 @@
 #ifndef VECTOR_PARTGROUPSTAR_H
 #ifndef VECTOR_PARTGROUPSTAR_H
 #define VECTOR_PARTGROUPSTAR_H
 #define VECTOR_PARTGROUPSTAR_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "partGroup.h"
 #include "partGroup.h"
-
 #include "pvector.h"
 #include "pvector.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -40,7 +38,7 @@
 #define TYPE PartGroup *
 #define TYPE PartGroup *
 #define NAME vector_PartGroupStar
 #define NAME vector_PartGroupStar
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 1 - 1
panda/src/display/graphicsWindowInputDevice.h

@@ -96,7 +96,7 @@ private:
 #define TYPE GraphicsWindowInputDevice
 #define TYPE GraphicsWindowInputDevice
 #define NAME vector_GraphicsWindowInputDevice
 #define NAME vector_GraphicsWindowInputDevice
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 4 - 4
panda/src/egg/eggMorphList.h

@@ -19,7 +19,7 @@
 #ifndef EGGMORPHLIST_H
 #ifndef EGGMORPHLIST_H
 #define EGGMORPHLIST_H
 #define EGGMORPHLIST_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "eggMorph.h"
 #include "eggMorph.h"
 
 
@@ -73,19 +73,19 @@ private:
 #define EXPTP EXPTP_PANDAEGG
 #define EXPTP EXPTP_PANDAEGG
 #define TYPE LVector3d
 #define TYPE LVector3d
 #define NAME vector_LVector3d
 #define NAME vector_LVector3d
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 #define EXPCL EXPCL_PANDAEGG
 #define EXPCL EXPCL_PANDAEGG
 #define EXPTP EXPTP_PANDAEGG
 #define EXPTP EXPTP_PANDAEGG
 #define TYPE LVector2d
 #define TYPE LVector2d
 #define NAME vector_LVector2d
 #define NAME vector_LVector2d
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 #define EXPCL EXPCL_PANDAEGG
 #define EXPCL EXPCL_PANDAEGG
 #define EXPTP EXPTP_PANDAEGG
 #define EXPTP EXPTP_PANDAEGG
 #define TYPE LVector4f
 #define TYPE LVector4f
 #define NAME vector_LVector4f
 #define NAME vector_LVector4f
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Now export each EggMorphList.
 // Now export each EggMorphList.
 
 

+ 2 - 2
panda/src/egg/vector_PT_EggMaterial.h

@@ -19,7 +19,7 @@
 #ifndef VECTOR_PT_EGGMATERIAL_H
 #ifndef VECTOR_PT_EGGMATERIAL_H
 #define VECTOR_PT_EGGMATERIAL_H
 #define VECTOR_PT_EGGMATERIAL_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "eggMaterial.h"
 #include "eggMaterial.h"
 #include "pt_EggMaterial.h"
 #include "pt_EggMaterial.h"
@@ -40,7 +40,7 @@
 #define TYPE PT_EggMaterial
 #define TYPE PT_EggMaterial
 #define NAME vector_PT_EggMaterial
 #define NAME vector_PT_EggMaterial
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 2 - 2
panda/src/egg/vector_PT_EggTexture.h

@@ -19,7 +19,7 @@
 #ifndef VECTOR_PT_EGGTEXTURE_H
 #ifndef VECTOR_PT_EGGTEXTURE_H
 #define VECTOR_PT_EGGTEXTURE_H
 #define VECTOR_PT_EGGTEXTURE_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "eggTexture.h"
 #include "eggTexture.h"
 #include "pt_EggTexture.h"
 #include "pt_EggTexture.h"
@@ -40,7 +40,7 @@
 #define TYPE PT_EggTexture
 #define TYPE PT_EggTexture
 #define NAME vector_PT_EggTexture
 #define NAME vector_PT_EggTexture
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 2 - 2
panda/src/egg/vector_PT_EggVertex.h

@@ -19,7 +19,7 @@
 #ifndef VECTOR_PT_EGGVERTEX_H
 #ifndef VECTOR_PT_EGGVERTEX_H
 #define VECTOR_PT_EGGVERTEX_H
 #define VECTOR_PT_EGGVERTEX_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "eggVertex.h"
 #include "eggVertex.h"
 #include "pt_EggVertex.h"
 #include "pt_EggVertex.h"
@@ -40,7 +40,7 @@
 #define TYPE PT_EggVertex
 #define TYPE PT_EggVertex
 #define NAME vector_PT_EggVertex
 #define NAME vector_PT_EggVertex
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 2 - 2
panda/src/express/vector_uchar.h

@@ -19,7 +19,7 @@
 #ifndef VECTOR_UCHAR_H
 #ifndef VECTOR_UCHAR_H
 #define VECTOR_UCHAR_H
 #define VECTOR_UCHAR_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "pvector.h"
 #include "pvector.h"
 
 
@@ -37,7 +37,7 @@
 #define TYPE unsigned char
 #define TYPE unsigned char
 #define NAME vector_uchar
 #define NAME vector_uchar
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 1 - 1
panda/src/gobj/LOD.h

@@ -73,7 +73,7 @@ protected:
 #define TYPE LODSwitch
 #define TYPE LODSwitch
 #define NAME LODSwitchVector
 #define NAME LODSwitchVector
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : LOD
 //       Class : LOD

+ 1 - 1
panda/src/linmath/cmath.h

@@ -19,7 +19,7 @@
 #ifndef CMATH_H
 #ifndef CMATH_H
 #define CMATH_H
 #define CMATH_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include <math.h>
 #include <math.h>
 
 

+ 2 - 2
panda/src/linmath/lrotation.h

@@ -19,11 +19,11 @@
 #ifndef __LROTATION_H__
 #ifndef __LROTATION_H__
 #define __LROTATION_H__
 #define __LROTATION_H__
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 #include "lquaternion.h"
 #include "lquaternion.h"
 #include "cmath.h"
 #include "cmath.h"
 
 
-#include <notify.h>
+#include "notify.h"
 
 
 #include "fltnames.h"
 #include "fltnames.h"
 #include "lrotation_src.h"
 #include "lrotation_src.h"

+ 1 - 1
panda/src/linmath/luse.h

@@ -62,7 +62,7 @@
 //
 //
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "lvec2_ops.h"
 #include "lvec2_ops.h"
 #include "lvec3_ops.h"
 #include "lvec3_ops.h"

+ 31 - 0
panda/src/linmath/lvecBase2_src.I

@@ -218,6 +218,37 @@ set_y(FLOATTYPE value) {
   _v.v._1 = value;
   _v.v._1 = value;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase2::add_to_cell
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase2)::
+add_to_cell(int i, FLOATTYPE value) {
+  nassertv(i >= 0 && i < 2);
+  _v.data[i] = value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase2::add_x
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase2)::
+add_x(FLOATTYPE value) {
+  _v.v._0 = value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase2::add_y
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase2)::
+add_y(FLOATTYPE value) {
+  _v.v._1 = value;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase2::get_data
 //     Function: LVecBase2::get_data
 //       Access: Public
 //       Access: Public

+ 9 - 0
panda/src/linmath/lvecBase2_src.h

@@ -50,10 +50,19 @@ PUBLISHED:
   INLINE_LINMATH FLOATTYPE get_cell(int i) const;
   INLINE_LINMATH FLOATTYPE get_cell(int i) const;
   INLINE_LINMATH FLOATTYPE get_x() const;
   INLINE_LINMATH FLOATTYPE get_x() const;
   INLINE_LINMATH FLOATTYPE get_y() const;
   INLINE_LINMATH FLOATTYPE get_y() const;
+
   INLINE_LINMATH void set_cell(int i, FLOATTYPE value);
   INLINE_LINMATH void set_cell(int i, FLOATTYPE value);
   INLINE_LINMATH void set_x(FLOATTYPE value);
   INLINE_LINMATH void set_x(FLOATTYPE value);
   INLINE_LINMATH void set_y(FLOATTYPE value);
   INLINE_LINMATH void set_y(FLOATTYPE value);
 
 
+  // These next functions add to an existing value.
+  // i.e. foo.set_x(foo.get_x() + value)
+  // These are useful to reduce overhead in scripting
+  // languages:
+  INLINE_LINMATH void add_to_cell(int i, FLOATTYPE value);
+  INLINE_LINMATH void add_x(FLOATTYPE value);
+  INLINE_LINMATH void add_y(FLOATTYPE value);
+
   INLINE_LINMATH const FLOATTYPE *get_data() const;
   INLINE_LINMATH const FLOATTYPE *get_data() const;
   INLINE_LINMATH int get_num_components() const;
   INLINE_LINMATH int get_num_components() const;
 
 

+ 41 - 0
panda/src/linmath/lvecBase3_src.I

@@ -250,6 +250,47 @@ set_z(FLOATTYPE value) {
   _v.v._2 = value;
   _v.v._2 = value;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase3::add_to_cell
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase3)::
+add_to_cell(int i, FLOATTYPE value) {
+  nassertv(i >= 0 && i < 3);
+  _v.data[i] += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase3::add_x
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase3)::
+add_x(FLOATTYPE value) {
+  _v.v._0 += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase3::add_y
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase3)::
+add_y(FLOATTYPE value) {
+  _v.v._1 += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase3::add_z
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase3)::
+add_z(FLOATTYPE value) {
+  _v.v._2 += value;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase3::get_data
 //     Function: LVecBase3::get_data
 //       Access: Public
 //       Access: Public

+ 10 - 0
panda/src/linmath/lvecBase3_src.h

@@ -49,11 +49,21 @@ PUBLISHED:
   INLINE_LINMATH FLOATTYPE get_x() const;
   INLINE_LINMATH FLOATTYPE get_x() const;
   INLINE_LINMATH FLOATTYPE get_y() const;
   INLINE_LINMATH FLOATTYPE get_y() const;
   INLINE_LINMATH FLOATTYPE get_z() const;
   INLINE_LINMATH FLOATTYPE get_z() const;
+
   INLINE_LINMATH void set_cell(int i, FLOATTYPE value);
   INLINE_LINMATH void set_cell(int i, FLOATTYPE value);
   INLINE_LINMATH void set_x(FLOATTYPE value);
   INLINE_LINMATH void set_x(FLOATTYPE value);
   INLINE_LINMATH void set_y(FLOATTYPE value);
   INLINE_LINMATH void set_y(FLOATTYPE value);
   INLINE_LINMATH void set_z(FLOATTYPE value);
   INLINE_LINMATH void set_z(FLOATTYPE value);
 
 
+  // These next functions add to an existing value.
+  // i.e. foo.set_x(foo.get_x() + value)
+  // These are useful to reduce overhead in scripting
+  // languages:
+  INLINE_LINMATH void add_to_cell(int i, FLOATTYPE value);
+  INLINE_LINMATH void add_x(FLOATTYPE value);
+  INLINE_LINMATH void add_y(FLOATTYPE value);
+  INLINE_LINMATH void add_z(FLOATTYPE value);
+
   INLINE_LINMATH const FLOATTYPE *get_data() const;
   INLINE_LINMATH const FLOATTYPE *get_data() const;
   INLINE_LINMATH int get_num_components() const;
   INLINE_LINMATH int get_num_components() const;
 
 

+ 6 - 6
panda/src/linmath/lvecBase4.h

@@ -19,12 +19,12 @@
 #ifndef LVECBASE4_H
 #ifndef LVECBASE4_H
 #define LVECBASE4_H
 #define LVECBASE4_H
 
 
-#include <pandabase.h>
-#include <typedObject.h>
-#include <notify.h>
-#include <datagram.h>
-#include <datagramIterator.h>
-#include <checksumHashGenerator.h>
+#include "pandabase.h"
+#include "typedObject.h"
+#include "notify.h"
+#include "datagram.h"
+#include "datagramIterator.h"
+#include "checksumHashGenerator.h"
 
 
 #include "cmath.h"
 #include "cmath.h"
 #include "nearly_zero.h"
 #include "nearly_zero.h"

+ 51 - 0
panda/src/linmath/lvecBase4_src.I

@@ -284,6 +284,57 @@ set_w(FLOATTYPE value) {
   _v.v._3 = value;
   _v.v._3 = value;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase4::add_to_cell
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase4)::
+add_to_cell(int i, FLOATTYPE value) {
+  nassertv(i >= 0 && i < 4);
+  _v.data[i] += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase4::add_x
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase4)::
+add_x(FLOATTYPE value) {
+  _v.v._0 += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase4::add_y
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase4)::
+add_y(FLOATTYPE value) {
+  _v.v._1 += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase4::add_z
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase4)::
+add_z(FLOATTYPE value) {
+  _v.v._2 += value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LVecBase4::add_w
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH void FLOATNAME(LVecBase4)::
+add_w(FLOATTYPE value) {
+  _v.v._3 += value;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase4::get_data
 //     Function: LVecBase4::get_data
 //       Access: Public
 //       Access: Public

+ 11 - 0
panda/src/linmath/lvecBase4_src.h

@@ -51,12 +51,23 @@ PUBLISHED:
   INLINE_LINMATH FLOATTYPE get_y() const;
   INLINE_LINMATH FLOATTYPE get_y() const;
   INLINE_LINMATH FLOATTYPE get_z() const;
   INLINE_LINMATH FLOATTYPE get_z() const;
   INLINE_LINMATH FLOATTYPE get_w() const;
   INLINE_LINMATH FLOATTYPE get_w() const;
+
   INLINE_LINMATH void set_cell(int i, FLOATTYPE value);
   INLINE_LINMATH void set_cell(int i, FLOATTYPE value);
   INLINE_LINMATH void set_x(FLOATTYPE value);
   INLINE_LINMATH void set_x(FLOATTYPE value);
   INLINE_LINMATH void set_y(FLOATTYPE value);
   INLINE_LINMATH void set_y(FLOATTYPE value);
   INLINE_LINMATH void set_z(FLOATTYPE value);
   INLINE_LINMATH void set_z(FLOATTYPE value);
   INLINE_LINMATH void set_w(FLOATTYPE value);
   INLINE_LINMATH void set_w(FLOATTYPE value);
 
 
+  // These next functions add to an existing value.
+  // i.e. foo.set_x(foo.get_x() + value)
+  // These are useful to reduce overhead in scripting
+  // languages:
+  INLINE_LINMATH void add_to_cell(int i, FLOATTYPE value);
+  INLINE_LINMATH void add_x(FLOATTYPE value);
+  INLINE_LINMATH void add_y(FLOATTYPE value);
+  INLINE_LINMATH void add_z(FLOATTYPE value);
+  INLINE_LINMATH void add_w(FLOATTYPE value);
+
   INLINE_LINMATH const FLOATTYPE *get_data() const;
   INLINE_LINMATH const FLOATTYPE *get_data() const;
   INLINE_LINMATH int get_num_components() const;
   INLINE_LINMATH int get_num_components() const;
 
 

+ 1 - 1
panda/src/linmath/lvector3.h

@@ -19,7 +19,7 @@
 #ifndef LVECTOR3_H
 #ifndef LVECTOR3_H
 #define LVECTOR3_H
 #define LVECTOR3_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "coordinateSystem.h"
 #include "coordinateSystem.h"
 #include "cmath.h"
 #include "cmath.h"

+ 2 - 2
panda/src/linmath/pta_Colorf.h

@@ -19,11 +19,11 @@
 #ifndef PTA_COLORF_H
 #ifndef PTA_COLORF_H
 #define PTA_COLORF_H
 #define PTA_COLORF_H
 
 
-#include <pandabase.h>
+#include "pandabase.h"
 
 
 #include "vector_Colorf.h"
 #include "vector_Colorf.h"
 
 
-#include <pointerToArray.h>
+#include "pointerToArray.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PTA_Colorf
 //       Class : PTA_Colorf

+ 2 - 4
panda/src/linmath/vector_Colorf.h

@@ -19,10 +19,8 @@
 #ifndef VECTOR_COLORF_H
 #ifndef VECTOR_COLORF_H
 #define VECTOR_COLORF_H
 #define VECTOR_COLORF_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "luse.h"
 #include "luse.h"
-
 #include "pvector.h"
 #include "pvector.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -39,7 +37,7 @@
 #define TYPE Colorf
 #define TYPE Colorf
 #define NAME vector_Colorf
 #define NAME vector_Colorf
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 2 - 4
panda/src/linmath/vector_LPoint2f.h

@@ -19,10 +19,8 @@
 #ifndef VECTOR_LPOINT2F_H
 #ifndef VECTOR_LPOINT2F_H
 #define VECTOR_LPOINT2F_H
 #define VECTOR_LPOINT2F_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "luse.h"
 #include "luse.h"
-
 #include "pvector.h"
 #include "pvector.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -39,7 +37,7 @@
 #define TYPE LPoint2f
 #define TYPE LPoint2f
 #define NAME vector_LPoint2f
 #define NAME vector_LPoint2f
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 2 - 4
panda/src/linmath/vector_LVecBase3f.h

@@ -19,10 +19,8 @@
 #ifndef VECTOR_LVECBASE3F_H
 #ifndef VECTOR_LVECBASE3F_H
 #define VECTOR_LVECBASE3F_H
 #define VECTOR_LVECBASE3F_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "luse.h"
 #include "luse.h"
-
 #include "pvector.h"
 #include "pvector.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -39,7 +37,7 @@
 #define TYPE LVecBase3f
 #define TYPE LVecBase3f
 #define NAME vector_LVecBase3f
 #define NAME vector_LVecBase3f
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 2 - 4
panda/src/linmath/vector_Normalf.h

@@ -19,10 +19,8 @@
 #ifndef VECTOR_NORMALF_H
 #ifndef VECTOR_NORMALF_H
 #define VECTOR_NORMALF_H
 #define VECTOR_NORMALF_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "luse.h"
 #include "luse.h"
-
 #include "pvector.h"
 #include "pvector.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -39,7 +37,7 @@
 #define TYPE Normalf
 #define TYPE Normalf
 #define NAME vector_Normalf
 #define NAME vector_Normalf
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__

+ 1 - 2
panda/src/linmath/vector_TexCoordf.h

@@ -19,8 +19,7 @@
 #ifndef VECTOR_TEXCOORDF_H
 #ifndef VECTOR_TEXCOORDF_H
 #define VECTOR_TEXCOORDF_H
 #define VECTOR_TEXCOORDF_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "vector_LPoint2f.h"
 #include "vector_LPoint2f.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 4
panda/src/linmath/vector_Vertexf.h

@@ -19,10 +19,8 @@
 #ifndef VECTOR_VERTEXF_H
 #ifndef VECTOR_VERTEXF_H
 #define VECTOR_VERTEXF_H
 #define VECTOR_VERTEXF_H
 
 
-#include <pandabase.h>
-
+#include "pandabase.h"
 #include "luse.h"
 #include "luse.h"
-
 #include "pvector.h"
 #include "pvector.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -39,7 +37,7 @@
 #define TYPE Vertexf
 #define TYPE Vertexf
 #define NAME vector_Vertexf
 #define NAME vector_Vertexf
 
 
-#include <vector_src.h>
+#include "vector_src.h"
 
 
 // Tell GCC that we'll take care of the instantiation explicitly here.
 // Tell GCC that we'll take care of the instantiation explicitly here.
 #ifdef __GNUC__
 #ifdef __GNUC__