Browse Source

leave lvecbase2/3 and lmatrix3 unaligned; it's so much cleaner

David Rose 14 years ago
parent
commit
42e8f806f1
60 changed files with 163 additions and 854 deletions
  1. 3 3
      panda/src/chan/animChannelMatrixXfmTable.cxx
  2. 1 0
      panda/src/collide/collisionPolygon.h
  3. 4 4
      panda/src/collide/collisionTraverser.cxx
  4. 1 1
      panda/src/collide/collisionTube.cxx
  5. 1 1
      panda/src/egg/eggMesherStrip.h
  6. 3 1
      panda/src/gobj/config_gobj.cxx
  7. 0 6
      panda/src/linmath/aa_luse.h
  8. 0 6
      panda/src/linmath/config_linmath.cxx
  9. 0 154
      panda/src/linmath/lmatrix3_src.I
  10. 0 16
      panda/src/linmath/lmatrix3_src.cxx
  11. 5 54
      panda/src/linmath/lmatrix3_src.h
  12. 6 1
      panda/src/linmath/lmatrix4_src.h
  13. 1 1
      panda/src/linmath/lorientation_src.h
  14. 1 1
      panda/src/linmath/lpoint2_src.h
  15. 1 1
      panda/src/linmath/lpoint3_src.h
  16. 1 1
      panda/src/linmath/lpoint4_src.h
  17. 1 1
      panda/src/linmath/lquaternion_src.h
  18. 1 1
      panda/src/linmath/lrotation_src.h
  19. 5 4
      panda/src/linmath/lsimpleMatrix.h
  20. 0 11
      panda/src/linmath/lvecBase2_ext_src.I
  21. 0 149
      panda/src/linmath/lvecBase2_src.I
  22. 0 17
      panda/src/linmath/lvecBase2_src.cxx
  23. 10 53
      panda/src/linmath/lvecBase2_src.h
  24. 0 11
      panda/src/linmath/lvecBase3_ext_src.I
  25. 0 150
      panda/src/linmath/lvecBase3_src.I
  26. 0 17
      panda/src/linmath/lvecBase3_src.cxx
  27. 5 53
      panda/src/linmath/lvecBase3_src.h
  28. 6 1
      panda/src/linmath/lvecBase4_src.h
  29. 1 1
      panda/src/linmath/lvector2_src.h
  30. 1 1
      panda/src/linmath/lvector3_src.h
  31. 1 1
      panda/src/linmath/lvector4_src.h
  32. 5 5
      panda/src/mathutil/boundingBox.cxx
  33. 2 2
      panda/src/mathutil/boundingBox.h
  34. 6 6
      panda/src/mathutil/boundingSphere.cxx
  35. 2 2
      panda/src/mathutil/boundingSphere.h
  36. 12 12
      panda/src/mathutil/config_mathutil.N
  37. 3 3
      panda/src/mathutil/fftCompressor.cxx
  38. 3 3
      panda/src/mathutil/fftCompressor.h
  39. 1 1
      panda/src/mathutil/geometricBoundingVolume.I
  40. 1 1
      panda/src/mathutil/geometricBoundingVolume.cxx
  41. 3 4
      panda/src/mathutil/geometricBoundingVolume.h
  42. 1 1
      panda/src/mathutil/omniBoundingVolume.cxx
  43. 2 2
      panda/src/mathutil/omniBoundingVolume.h
  44. 12 20
      panda/src/mathutil/pta_LMatrix3.h
  45. 12 20
      panda/src/mathutil/pta_LVecBase2.h
  46. 12 20
      panda/src/mathutil/pta_LVecBase3.h
  47. 2 2
      panda/src/mathutil/triangulator.I
  48. 2 2
      panda/src/mathutil/triangulator.cxx
  49. 2 2
      panda/src/mathutil/triangulator.h
  50. 1 1
      panda/src/parametrics/nurbsCurveEvaluator.h
  51. 1 1
      panda/src/parametrics/nurbsSurfaceEvaluator.h
  52. 1 1
      panda/src/pgraph/occluderNode.I
  53. 5 8
      panda/src/pgraph/occluderNode.cxx
  54. 2 2
      panda/src/pgraph/occluderNode.h
  55. 1 1
      panda/src/pgraph/portalNode.I
  56. 4 4
      panda/src/pgraph/portalNode.cxx
  57. 3 3
      panda/src/pgraph/portalNode.h
  58. 1 1
      panda/src/pgui/pgItem.h
  59. 1 1
      panda/src/text/textNode.cxx
  60. 1 1
      pandatool/src/eggcharbase/eggJointData.cxx

+ 3 - 3
panda/src/chan/animChannelMatrixXfmTable.cxx

@@ -407,7 +407,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
 
 
     // Now, write out the joint angles.  For these we need to build up
     // Now, write out the joint angles.  For these we need to build up
     // a HPR array.
     // a HPR array.
-    pvector<UnalignedLVecBase3> hprs;
+    pvector<LVecBase3> hprs;
     int hprs_length = max(max(_tables[6].size(), _tables[7].size()), _tables[8].size());
     int hprs_length = max(max(_tables[6].size(), _tables[7].size()), _tables[8].size());
     hprs.reserve(hprs_length);
     hprs.reserve(hprs_length);
     for (i = 0; i < hprs_length; i++) {
     for (i = 0; i < hprs_length; i++) {
@@ -416,7 +416,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
       PN_stdfloat r = _tables[8].empty() ? 0.0f : _tables[8][i % _tables[8].size()];
       PN_stdfloat r = _tables[8].empty() ? 0.0f : _tables[8][i % _tables[8].size()];
       hprs.push_back(LVecBase3(h, p, r));
       hprs.push_back(LVecBase3(h, p, r));
     }
     }
-    const UnalignedLVecBase3 *hprs_array = NULL;
+    const LVecBase3 *hprs_array = NULL;
     if (hprs_length != 0) {
     if (hprs_length != 0) {
       hprs_array = &hprs[0];
       hprs_array = &hprs[0];
     }
     }
@@ -518,7 +518,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
     }
     }
 
 
     // Read in the HPR array and store it back in the joint angles.
     // Read in the HPR array and store it back in the joint angles.
-    pvector<UnalignedLVecBase3> hprs;
+    pvector<LVecBase3> hprs;
     compressor.read_hprs(scan, hprs, new_hpr);
     compressor.read_hprs(scan, hprs, new_hpr);
     PTA_stdfloat h_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());
     PTA_stdfloat h_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());
     PTA_stdfloat p_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());
     PTA_stdfloat p_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());

+ 1 - 0
panda/src/collide/collisionPolygon.h

@@ -51,6 +51,7 @@ PUBLISHED:
   INLINE LPoint3 get_point(int n) const;
   INLINE LPoint3 get_point(int n) const;
   MAKE_SEQ(get_points, get_num_points, get_point);
   MAKE_SEQ(get_points, get_num_points, get_point);
 
 
+
   INLINE static bool verify_points(const LPoint3 &a, const LPoint3 &b,
   INLINE static bool verify_points(const LPoint3 &a, const LPoint3 &b,
                                    const LPoint3 &c);
                                    const LPoint3 &c);
   INLINE static bool verify_points(const LPoint3 &a, const LPoint3 &b,
   INLINE static bool verify_points(const LPoint3 &a, const LPoint3 &b,

+ 4 - 4
panda/src/collide/collisionTraverser.cxx

@@ -1328,7 +1328,7 @@ compare_collider_to_geom(CollisionEntry &entry, const Geom *geom,
           // Indexed case.
           // Indexed case.
           GeomVertexReader index(tris->get_vertices(), 0);
           GeomVertexReader index(tris->get_vertices(), 0);
           while (!index.is_at_end()) {
           while (!index.is_at_end()) {
-            UnalignedLVecBase3 v[3];
+            LPoint3 v[3];
             
             
             vertex.set_row_unsafe(index.get_data1i());
             vertex.set_row_unsafe(index.get_data1i());
             v[0] = vertex.get_data3();
             v[0] = vertex.get_data3();
@@ -1339,7 +1339,7 @@ compare_collider_to_geom(CollisionEntry &entry, const Geom *geom,
             
             
             // Generate a temporary CollisionGeom on the fly for each
             // Generate a temporary CollisionGeom on the fly for each
             // triangle in the Geom.
             // triangle in the Geom.
-            if (CollisionPolygon::verify_points(LVecBase3(v[0]), LVecBase3(v[1]), LVecBase3(v[2]))) {
+            if (CollisionPolygon::verify_points(v[0], v[1], v[2])) {
               bool within_solid_bounds = true;
               bool within_solid_bounds = true;
               if (from_node_gbv != (GeometricBoundingVolume *)NULL) {
               if (from_node_gbv != (GeometricBoundingVolume *)NULL) {
                 PT(BoundingSphere) sphere = new BoundingSphere;
                 PT(BoundingSphere) sphere = new BoundingSphere;
@@ -1361,7 +1361,7 @@ compare_collider_to_geom(CollisionEntry &entry, const Geom *geom,
           vertex.set_row_unsafe(primitive->get_first_vertex());
           vertex.set_row_unsafe(primitive->get_first_vertex());
           int num_vertices = primitive->get_num_vertices();
           int num_vertices = primitive->get_num_vertices();
           for (int i = 0; i < num_vertices; i += 3) {
           for (int i = 0; i < num_vertices; i += 3) {
-            UnalignedLVecBase3 v[3];
+            LPoint3 v[3];
             
             
             v[0] = vertex.get_data3();
             v[0] = vertex.get_data3();
             v[1] = vertex.get_data3();
             v[1] = vertex.get_data3();
@@ -1369,7 +1369,7 @@ compare_collider_to_geom(CollisionEntry &entry, const Geom *geom,
             
             
             // Generate a temporary CollisionGeom on the fly for each
             // Generate a temporary CollisionGeom on the fly for each
             // triangle in the Geom.
             // triangle in the Geom.
-            if (CollisionPolygon::verify_points(LVecBase3(v[0]), LVecBase3(v[1]), LVecBase3(v[2]))) {
+            if (CollisionPolygon::verify_points(v[0], v[1], v[2])) {
               bool within_solid_bounds = true;
               bool within_solid_bounds = true;
               if (from_node_gbv != (GeometricBoundingVolume *)NULL) {
               if (from_node_gbv != (GeometricBoundingVolume *)NULL) {
                 PT(BoundingSphere) sphere = new BoundingSphere;
                 PT(BoundingSphere) sphere = new BoundingSphere;

+ 1 - 1
panda/src/collide/collisionTube.cxx

@@ -132,7 +132,7 @@ compute_internal_bounds() const {
     if (vec.normalize()) {
     if (vec.normalize()) {
       // The bounding volume includes both endpoints, plus a little
       // The bounding volume includes both endpoints, plus a little
       // bit more to include the radius in both directions.
       // bit more to include the radius in both directions.
-      UnalignedLVecBase3 points[2];
+      LPoint3 points[2];
       points[0] = _a - vec * _radius;
       points[0] = _a - vec * _radius;
       points[1] = _b + vec * _radius;
       points[1] = _b + vec * _radius;
 
 

+ 1 - 1
panda/src/egg/eggMesherStrip.h

@@ -140,7 +140,7 @@ public:
   MesherStatus _status;
   MesherStatus _status;
 
 
   bool _planar;
   bool _planar;
-  UnalignedLVecBase3d _plane_normal;
+  LNormald _plane_normal;
   PN_stdfloat _plane_offset;
   PN_stdfloat _plane_offset;
   int _row_id, _row_distance;
   int _row_id, _row_distance;
   MesherOrigin _origin;
   MesherOrigin _origin;

+ 3 - 1
panda/src/gobj/config_gobj.cxx

@@ -281,7 +281,9 @@ ConfigVariableInt vertex_column_alignment
           "alignment requirements on a per-column basis as you construct a "
           "alignment requirements on a per-column basis as you construct a "
           "GeomVertexFormat.  Setting this value globally could result in "
           "GeomVertexFormat.  Setting this value globally could result in "
           "much needless wasted space in all vertex data objects, but it "
           "much needless wasted space in all vertex data objects, but it "
-          "could be useful for simple experiments."));
+          "could be useful for simple experiments.  Also see "
+          "egg-vertex-animation-align-16 for a variable that controls "
+          "this alignment for the vertex-animation columns only."));
 
 
 ConfigVariableEnum<AutoTextureScale> textures_power_2
 ConfigVariableEnum<AutoTextureScale> textures_power_2
 ("textures-power-2", ATS_down,
 ("textures-power-2", ATS_down,

+ 0 - 6
panda/src/linmath/aa_luse.h

@@ -120,10 +120,7 @@ typedef LTexCoord3f LTexCoord3;
 typedef LColorf LColor;
 typedef LColorf LColor;
 typedef LRGBColorf LRGBColor;
 typedef LRGBColorf LRGBColor;
 
 
-typedef UnalignedLVecBase2f UnalignedLVecBase2;
-typedef UnalignedLVecBase3f UnalignedLVecBase3;
 typedef UnalignedLVecBase4f UnalignedLVecBase4;
 typedef UnalignedLVecBase4f UnalignedLVecBase4;
-typedef UnalignedLMatrix3f UnalignedLMatrix3;
 typedef UnalignedLMatrix4f UnalignedLMatrix4;
 typedef UnalignedLMatrix4f UnalignedLMatrix4;
 
 
 // Bogus typedefs for interrogate and legacy Python code.
 // Bogus typedefs for interrogate and legacy Python code.
@@ -167,10 +164,7 @@ typedef LTexCoord3d LTexCoord3;
 typedef LColord LColor;
 typedef LColord LColor;
 typedef LRGBColord LRGBColor;
 typedef LRGBColord LRGBColor;
 
 
-typedef UnalignedLVecBase2d UnalignedLVecBase2;
-typedef UnalignedLVecBase3d UnalignedLVecBase3;
 typedef UnalignedLVecBase4d UnalignedLVecBase4;
 typedef UnalignedLVecBase4d UnalignedLVecBase4;
-typedef UnalignedLMatrix3d UnalignedLMatrix3;
 typedef UnalignedLMatrix4d UnalignedLMatrix4;
 typedef UnalignedLMatrix4d UnalignedLMatrix4;
 
 
 // Bogus typedefs for interrogate and legacy Python code.
 // Bogus typedefs for interrogate and legacy Python code.

+ 0 - 6
panda/src/linmath/config_linmath.cxx

@@ -71,10 +71,7 @@ init_liblinmath() {
   LPoint4f::init_type();
   LPoint4f::init_type();
   LMatrix3f::init_type();
   LMatrix3f::init_type();
   LMatrix4f::init_type();
   LMatrix4f::init_type();
-  UnalignedLVecBase2f::init_type();
-  UnalignedLVecBase3f::init_type();
   UnalignedLVecBase4f::init_type();
   UnalignedLVecBase4f::init_type();
-  UnalignedLMatrix3f::init_type();
   UnalignedLMatrix4f::init_type();
   UnalignedLMatrix4f::init_type();
 
 
   LVecBase2d::init_type();
   LVecBase2d::init_type();
@@ -88,10 +85,7 @@ init_liblinmath() {
   LPoint4d::init_type();
   LPoint4d::init_type();
   LMatrix3d::init_type();
   LMatrix3d::init_type();
   LMatrix4d::init_type();
   LMatrix4d::init_type();
-  UnalignedLVecBase2d::init_type();
-  UnalignedLVecBase3d::init_type();
   UnalignedLVecBase4d::init_type();
   UnalignedLVecBase4d::init_type();
-  UnalignedLMatrix3d::init_type();
   UnalignedLMatrix4d::init_type();
   UnalignedLMatrix4d::init_type();
 
 
   LQuaternionf::init_type();
   LQuaternionf::init_type();

+ 0 - 154
panda/src/linmath/lmatrix3_src.I

@@ -115,16 +115,6 @@ INLINE_LINMATH FLOATNAME(LMatrix3)::
 FLOATNAME(LMatrix3)(const FLOATNAME(LMatrix3) &copy) : _m(copy._m) {
 FLOATNAME(LMatrix3)(const FLOATNAME(LMatrix3) &copy) : _m(copy._m) {
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: LMatrix3::Copy Constructor
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(LMatrix3)::
-FLOATNAME(LMatrix3)(const FLOATNAME(UnalignedLMatrix3) &copy) {
-  operator = (copy);
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LMatrix3::Copy Assignment Operator
 //     Function: LMatrix3::Copy Assignment Operator
 //       Access: Published
 //       Access: Published
@@ -138,19 +128,6 @@ operator = (const FLOATNAME(LMatrix3) &copy) {
   return *this;
   return *this;
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: LMatrix3::Copy Assignment Operator
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(LMatrix3) &FLOATNAME(LMatrix3)::
-operator = (const FLOATNAME(UnalignedLMatrix3) &copy) {
-  TAU_PROFILE("void LMatrix3::operator = (const UnalignedLMatrix3 &)", " ", TAU_USER);
-
-  memcpy(&_m(0, 0), copy.get_data(), sizeof(FLOATTYPE) * get_num_components());
-  return *this;
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LMatrix3::Fill Assignment Operator
 //     Function: LMatrix3::Fill Assignment Operator
 //       Access: Published
 //       Access: Published
@@ -1517,134 +1494,3 @@ invert(const FLOATNAME(LMatrix3) &a) {
 #endif
 #endif
   return result;
   return result;
 }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Default Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)::
-FLOATNAME(UnalignedLMatrix3)() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)::
-FLOATNAME(UnalignedLMatrix3)(const FLOATNAME(LMatrix3) &copy) {
-  operator = (copy);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)::
-FLOATNAME(UnalignedLMatrix3)(const FLOATNAME(UnalignedLMatrix3) &copy) : _m(copy._m) {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLMatrix3) &FLOATNAME(UnalignedLMatrix3)::
-operator = (const FLOATNAME(LMatrix3) &copy) {
-  memcpy(&_m(0, 0), copy.get_data(), sizeof(FLOATTYPE) * get_num_components());
-  return *this;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLMatrix3) &FLOATNAME(UnalignedLMatrix3)::
-operator = (const FLOATNAME(UnalignedLMatrix3) &copy) {
-  TAU_PROFILE("void UnalignedLMatrix3::operator =(UnalignedLMatrix3 &)", " ", TAU_USER);
-  _m = copy._m;
-  return *this;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)::
-FLOATNAME(UnalignedLMatrix3)(FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02,
-                             FLOATTYPE e10, FLOATTYPE e11, FLOATTYPE e12,
-                             FLOATTYPE e20, FLOATTYPE e21, FLOATTYPE e22) {
-  TAU_PROFILE("UnalignedLMatrix3::UnalignedLMatrix3(FLOATTYPE, ...)", " ", TAU_USER);
-  set(e00, e01, e02,
-      e10, e11, e12,
-      e20, e21, e22);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::set
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH void FLOATNAME(UnalignedLMatrix3)::
-set(FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02,
-    FLOATTYPE e10, FLOATTYPE e11, FLOATTYPE e12,
-    FLOATTYPE e20, FLOATTYPE e21, FLOATTYPE e22) {
-  TAU_PROFILE("void UnalignedLMatrix3::set()", " ", TAU_USER);
-  _m(0, 0) = e00;
-  _m(0, 1) = e01;
-  _m(0, 2) = e02;
-  _m(1, 0) = e10;
-  _m(1, 1) = e11;
-  _m(1, 2) = e12;
-  _m(2, 0) = e20;
-  _m(2, 1) = e21;
-  _m(2, 2) = e22;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Indexing operator
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATTYPE &FLOATNAME(UnalignedLMatrix3)::
-operator () (int row, int col) {
-  nassertr(row >= 0 && row < 3 && col >= 0 && col < 3, _m(0, 0));
-  return _m(row, col);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::Indexing operator
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATTYPE FLOATNAME(UnalignedLMatrix3)::
-operator () (int row, int col) const {
-  nassertr(row >= 0 && row < 3 && col >= 0 && col < 3, 0.0);
-  return _m(row, col);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::get_data
-//       Access: Published
-//  Description: Returns the address of the first of the nine data
-//               elements in the matrix.  The remaining elements
-//               occupy the next eight positions in row-major order.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH const FLOATTYPE *FLOATNAME(UnalignedLMatrix3)::
-get_data() const {
-  return &_m(0, 0);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::get_num_components
-//       Access: Published
-//  Description: Returns the number of elements in the matrix, nine.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH int FLOATNAME(UnalignedLMatrix3)::
-get_num_components() const {
-  return 9;
-}

+ 0 - 16
panda/src/linmath/lmatrix3_src.cxx

@@ -13,7 +13,6 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 TypeHandle FLOATNAME(LMatrix3)::_type_handle;
 TypeHandle FLOATNAME(LMatrix3)::_type_handle;
-TypeHandle FLOATNAME(UnalignedLMatrix3)::_type_handle;
 
 
 const FLOATNAME(LMatrix3) FLOATNAME(LMatrix3)::_ident_mat =
 const FLOATNAME(LMatrix3) FLOATNAME(LMatrix3)::_ident_mat =
   FLOATNAME(LMatrix3)(1.0f, 0.0f, 0.0f,
   FLOATNAME(LMatrix3)(1.0f, 0.0f, 0.0f,
@@ -515,18 +514,3 @@ init_type() {
     register_type(_type_handle, name);
     register_type(_type_handle, name);
   }
   }
 }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLMatrix3::init_type
-//       Access: Published, Static
-//  Description:
-////////////////////////////////////////////////////////////////////
-void FLOATNAME(UnalignedLMatrix3)::
-init_type() {
-  if (_type_handle == TypeHandle::none()) {
-    // Format a string to describe the type.
-    string name = "UnalignedLMatrix3";
-    name += FLOATTOKEN;
-    register_type(_type_handle, name);
-  }
-}

+ 5 - 54
panda/src/linmath/lmatrix3_src.h

@@ -13,7 +13,6 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 class FLOATNAME(LMatrix4);
 class FLOATNAME(LMatrix4);
-class FLOATNAME(UnalignedLMatrix3);
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : LMatrix3
 //       Class : LMatrix3
@@ -23,7 +22,7 @@ class FLOATNAME(UnalignedLMatrix3);
 //               (rotation, scale, translation) in 2-d, e.g. for a
 //               (rotation, scale, translation) in 2-d, e.g. for a
 //               texture matrix.
 //               texture matrix.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LMatrix3) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LMatrix3) {
 public:
 public:
   typedef const FLOATTYPE *iterator;
   typedef const FLOATTYPE *iterator;
   typedef const FLOATTYPE *const_iterator;
   typedef const FLOATTYPE *const_iterator;
@@ -55,11 +54,8 @@ PUBLISHED:
 
 
   INLINE_LINMATH FLOATNAME(LMatrix3)();
   INLINE_LINMATH FLOATNAME(LMatrix3)();
   INLINE_LINMATH FLOATNAME(LMatrix3)(const FLOATNAME(LMatrix3) &other);
   INLINE_LINMATH FLOATNAME(LMatrix3)(const FLOATNAME(LMatrix3) &other);
-  INLINE_LINMATH FLOATNAME(LMatrix3)(const FLOATNAME(UnalignedLMatrix3) &other);
   INLINE_LINMATH FLOATNAME(LMatrix3) &operator = (
   INLINE_LINMATH FLOATNAME(LMatrix3) &operator = (
       const FLOATNAME(LMatrix3) &other);
       const FLOATNAME(LMatrix3) &other);
-  INLINE_LINMATH FLOATNAME(LMatrix3) &operator = (
-      const FLOATNAME(UnalignedLMatrix3) &other);
   INLINE_LINMATH FLOATNAME(LMatrix3) &operator = (FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LMatrix3) &operator = (FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LMatrix3)(
   INLINE_LINMATH FLOATNAME(LMatrix3)(
     FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02,
     FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02,
@@ -300,7 +296,10 @@ PUBLISHED:
 
 
 public:
 public:
   // The underlying implementation is via the Eigen library, if available.
   // The underlying implementation is via the Eigen library, if available.
-  typedef LINMATH_MATRIX(FLOATTYPE, 3, 3) EMatrix3;
+
+  // We don't bother to align LMatrix3, since it won't benefit from
+  // SSE2 optimizations anyway (it's an add number of floats).
+  typedef UNALIGNED_LINMATH_MATRIX(FLOATTYPE, 3, 3) EMatrix3;
   EMatrix3 _m;
   EMatrix3 _m;
 
 
   INLINE_LINMATH FLOATNAME(LMatrix3)(const EMatrix3 &m) : _m(m) { }
   INLINE_LINMATH FLOATNAME(LMatrix3)(const EMatrix3 &m) : _m(m) { }
@@ -324,54 +323,6 @@ private:
   static TypeHandle _type_handle;
   static TypeHandle _type_handle;
 };
 };
 
 
-////////////////////////////////////////////////////////////////////
-//       Class : UnalignedLMatrix3
-// Description : This is an "unaligned" LMatrix3.  It has no
-//               functionality other than to store numbers, and it
-//               will pack them in as tightly as possible, avoiding
-//               any SSE2 alignment requirements shared by the primary
-//               LMatrix3 class.
-//
-//               Use it only when you need to pack numbers tightly
-//               without respect to alignment, and then copy it to a
-//               proper LMatrix3 to get actual use from it.
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH FLOATNAME(UnalignedLMatrix3) {
-PUBLISHED:
-  INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)();
-  INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)(const FLOATNAME(LMatrix3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)(const FLOATNAME(UnalignedLMatrix3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLMatrix3) &operator = (const FLOATNAME(LMatrix3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLMatrix3) &operator = (const FLOATNAME(UnalignedLMatrix3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLMatrix3)(FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02,
-                                              FLOATTYPE e10, FLOATTYPE e11, FLOATTYPE e12,
-                                              FLOATTYPE e20, FLOATTYPE e21, FLOATTYPE e22);
-
-  INLINE_LINMATH void set(FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02,
-                          FLOATTYPE e10, FLOATTYPE e11, FLOATTYPE e12,
-                          FLOATTYPE e20, FLOATTYPE e21, FLOATTYPE e22);
-
-  INLINE_LINMATH FLOATTYPE &operator () (int row, int col);
-  INLINE_LINMATH FLOATTYPE operator () (int row, int col) const;
-
-  INLINE_LINMATH const FLOATTYPE *get_data() const;
-  INLINE_LINMATH int get_num_components() const;
-
-public:
-  typedef SIMPLE_MATRIX(FLOATTYPE, 3, 3) UMatrix3;
-  UMatrix3 _m;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type();
-
-private:
-  static TypeHandle _type_handle;
-};
-
-
 INLINE ostream &operator << (ostream &out, const FLOATNAME(LMatrix3) &mat) {
 INLINE ostream &operator << (ostream &out, const FLOATNAME(LMatrix3) &mat) {
   mat.output(out);
   mat.output(out);
   return out;
   return out;

+ 6 - 1
panda/src/linmath/lmatrix4_src.h

@@ -263,6 +263,11 @@ PUBLISHED:
 
 
 public:
 public:
   // The underlying implementation is via the Eigen library, if available.
   // The underlying implementation is via the Eigen library, if available.
+
+  // Unlike LMatrix3, we fully align LMatrix4 to 16-byte boundaries,
+  // to take advantage of SSE2 optimizations when available.
+  // Sometimes this alignment requirement is inconvenient, so we also
+  // provide UnalignedLMatrix4, below.
   typedef LINMATH_MATRIX(FLOATTYPE, 4, 4) EMatrix4;
   typedef LINMATH_MATRIX(FLOATTYPE, 4, 4) EMatrix4;
   EMatrix4 _m;
   EMatrix4 _m;
 
 
@@ -328,7 +333,7 @@ PUBLISHED:
   INLINE_LINMATH int get_num_components() const;
   INLINE_LINMATH int get_num_components() const;
 
 
 public:
 public:
-  typedef SIMPLE_MATRIX(FLOATTYPE, 4, 4) UMatrix4;
+  typedef UNALIGNED_LINMATH_MATRIX(FLOATTYPE, 4, 4) UMatrix4;
   UMatrix4 _m;
   UMatrix4 _m;
 
 
 public:
 public:

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

@@ -18,7 +18,7 @@ class FLOATNAME(LRotation);
 //       Class : LOrientation
 //       Class : LOrientation
 // Description : This is a unit quaternion representing an orientation.
 // Description : This is a unit quaternion representing an orientation.
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LOrientation) : public FLOATNAME(LQuaternion) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LOrientation) : public FLOATNAME(LQuaternion) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LOrientation)();
   INLINE_LINMATH FLOATNAME(LOrientation)();
   INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LQuaternion)&);
   INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LQuaternion)&);

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

@@ -17,7 +17,7 @@
 //       Class : LPoint2
 //       Class : LPoint2
 // Description : This is a two-component point in space.
 // Description : This is a two-component point in space.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LPoint2) : public FLOATNAME(LVecBase2) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LPoint2) : public FLOATNAME(LVecBase2) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LPoint2)();
   INLINE_LINMATH FLOATNAME(LPoint2)();
   INLINE_LINMATH FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2) &copy);
   INLINE_LINMATH FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2) &copy);

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

@@ -22,7 +22,7 @@
 //               vector, while addition of a vector and a point yields
 //               vector, while addition of a vector and a point yields
 //               a point.
 //               a point.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LPoint3) : public FLOATNAME(LVecBase3) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LPoint3) : public FLOATNAME(LVecBase3) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LPoint3)();
   INLINE_LINMATH FLOATNAME(LPoint3)();
   INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) &copy);
   INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) &copy);

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

@@ -16,7 +16,7 @@
 //       Class : LPoint4
 //       Class : LPoint4
 // Description : This is a four-component point in space.
 // Description : This is a four-component point in space.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LPoint4) : public FLOATNAME(LVecBase4) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LPoint4) : public FLOATNAME(LVecBase4) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LPoint4)();
   INLINE_LINMATH FLOATNAME(LPoint4)();
   INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase4) &copy);
   INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase4) &copy);

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

@@ -16,7 +16,7 @@
 //       Class : FLOATNAME(LQuaternion)
 //       Class : FLOATNAME(LQuaternion)
 // Description : This is the base quaternion class
 // Description : This is the base quaternion class
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LQuaternion) : public FLOATNAME(LVecBase4) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LQuaternion) : public FLOATNAME(LVecBase4) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LQuaternion)();
   INLINE_LINMATH FLOATNAME(LQuaternion)();
   INLINE_LINMATH FLOATNAME(LQuaternion)(const FLOATNAME(LVecBase4) &copy);
   INLINE_LINMATH FLOATNAME(LQuaternion)(const FLOATNAME(LVecBase4) &copy);

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

@@ -16,7 +16,7 @@
 //       Class : LRotation
 //       Class : LRotation
 // Description : This is a unit quaternion representing a rotation.
 // Description : This is a unit quaternion representing a rotation.
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LRotation) : public FLOATNAME(LQuaternion) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LRotation) : public FLOATNAME(LQuaternion) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LRotation)();
   INLINE_LINMATH FLOATNAME(LRotation)();
   INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &);
   INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &);

+ 5 - 4
panda/src/linmath/lsimpleMatrix.h

@@ -47,18 +47,19 @@ private:
 
 
 // Now, do we actually use LSimpleMatrix, or do we use Eigen::Matrix?
 // Now, do we actually use LSimpleMatrix, or do we use Eigen::Matrix?
 #ifdef HAVE_EIGEN
 #ifdef HAVE_EIGEN
+#define UNALIGNED_LINMATH_MATRIX(FloatType, NumRows, NumCols) Eigen::Matrix<FloatType, NumRows, NumCols, Eigen::DontAlign | Eigen::RowMajor>
+
 #ifdef LINMATH_ALIGN
 #ifdef LINMATH_ALIGN
 #define LINMATH_MATRIX(FloatType, NumRows, NumCols) Eigen::Matrix<FloatType, NumRows, NumCols, Eigen::RowMajor>
 #define LINMATH_MATRIX(FloatType, NumRows, NumCols) Eigen::Matrix<FloatType, NumRows, NumCols, Eigen::RowMajor>
 #else  // LINMATH_ALIGN
 #else  // LINMATH_ALIGN
-#define LINMATH_MATRIX(FloatType, NumRows, NumCols) Eigen::Matrix<FloatType, NumRows, NumCols, Eigen::DontAlign | Eigen::RowMajor>
+#define LINMATH_MATRIX(FloatType, NumRows, NumCols) UNALIGNED_LINMATH_MATRIX(FloatType, NumRows, NumCols) 
 #endif  // LINMATH_ALIGN
 #endif  // LINMATH_ALIGN
 
 
 #else  // HAVE_EIGEN
 #else  // HAVE_EIGEN
-#define LINMATH_MATRIX(FloatType, NumRows, NumCols) LSimpleMatrix<FloatType, NumRows, NumCols>
+#define UNALIGNED_LINMATH_MATRIX(FloatType, NumRows, NumCols) LSimpleMatrix<FloatType, NumRows, NumCols>
+#define LINMATH_MATRIX(FloatType, NumRows, NumCols) UNALIGNED_LINMATH_MATRIX(FloatType, NumRows, NumCols) 
 #endif  // HAVE_EIGEN
 #endif  // HAVE_EIGEN
 
 
-#define SIMPLE_MATRIX(FloatType, NumRows, NumCols) LSimpleMatrix<FloatType, NumRows, NumCols>
-
 // This is as good a place as any to define this alignment macro.
 // This is as good a place as any to define this alignment macro.
 #ifdef LINMATH_ALIGN
 #ifdef LINMATH_ALIGN
 #define ALIGN_LINMATH ALIGN_16BYTE
 #define ALIGN_LINMATH ALIGN_16BYTE

+ 0 - 11
panda/src/linmath/lvecBase2_ext_src.I

@@ -187,14 +187,3 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
 
 
   return 0;
   return 0;
 }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::__setitem__
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void EXT_METHOD_ARGS(FLOATNAME(UnalignedLVecBase2),
-__setitem__, int i, FLOATTYPE v) {
-  nassertv(i >= 0 && i < 2);
-  this->_v(i) = v;
-}

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

@@ -31,16 +31,6 @@ INLINE_LINMATH FLOATNAME(LVecBase2)::
 FLOATNAME(LVecBase2)(const FLOATNAME(LVecBase2) &copy) : _v(copy._v) {
 FLOATNAME(LVecBase2)(const FLOATNAME(LVecBase2) &copy) : _v(copy._v) {
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: LVecBase2::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(LVecBase2)::
-FLOATNAME(LVecBase2)(const FLOATNAME(UnalignedLVecBase2) &copy) {
-  set(copy[0], copy[1]);
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase2::Copy Assignment Operator
 //     Function: LVecBase2::Copy Assignment Operator
 //       Access: Published
 //       Access: Published
@@ -53,17 +43,6 @@ operator = (const FLOATNAME(LVecBase2) &copy) {
   return *this;
   return *this;
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: LVecBase2::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(LVecBase2) &FLOATNAME(LVecBase2)::
-operator = (const FLOATNAME(UnalignedLVecBase2) &copy) {
-  set(copy[0], copy[1]);
-  return *this;
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase2::Fill Assignment Operator
 //     Function: LVecBase2::Fill Assignment Operator
 //       Access: Published
 //       Access: Published
@@ -837,131 +816,3 @@ read_datagram(DatagramIterator &source) {
   _v(0) = source.get_stdfloat();
   _v(0) = source.get_stdfloat();
   _v(1) = source.get_stdfloat();
   _v(1) = source.get_stdfloat();
 }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Default Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)::
-FLOATNAME(UnalignedLVecBase2)() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)::
-FLOATNAME(UnalignedLVecBase2)(const FLOATNAME(LVecBase2) &copy) {
-  set(copy[0], copy[1]);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)::
-FLOATNAME(UnalignedLVecBase2)(const FLOATNAME(UnalignedLVecBase2) &copy) : _v(copy._v) {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase2) &FLOATNAME(UnalignedLVecBase2)::
-operator = (const FLOATNAME(LVecBase2) &copy) {
-  set(copy[0], copy[1]);
-  return *this;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase2) &FLOATNAME(UnalignedLVecBase2)::
-operator = (const FLOATNAME(UnalignedLVecBase2) &copy) {
-  TAU_PROFILE("void UnalignedLVecBase2::operator =(UnalignedLVecBase2 &)", " ", TAU_USER);
-  _v = copy._v;
-  return *this;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)::
-FLOATNAME(UnalignedLVecBase2)(FLOATTYPE x, FLOATTYPE y) {
-  TAU_PROFILE("UnalignedLVecBase2::UnalignedLVecBase2(FLOATTYPE, ...)", " ", TAU_USER);
-  set(x, y);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::set
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH void FLOATNAME(UnalignedLVecBase2)::
-set(FLOATTYPE x, FLOATTYPE y) {
-  TAU_PROFILE("void UnalignedLVecBase2::set()", " ", TAU_USER);
-  _v(0) = x;
-  _v(1) = y;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Indexing Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATTYPE FLOATNAME(UnalignedLVecBase2)::
-operator [](int i) const {
-  nassertr(i >= 0 && i < 2, 0.0);
-  return _v(i);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::Indexing Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATTYPE &FLOATNAME(UnalignedLVecBase2)::
-operator [](int i) {
-  nassertr(i >= 0 && i < 2, _v(0));
-  return _v(i);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::size
-//       Access: Public, Static
-//  Description: Returns 2: the number of components of a LVecBase2.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH int FLOATNAME(UnalignedLVecBase2)::
-size() {
-  return 2;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::get_data
-//       Access: Public
-//  Description: Returns the address of the first of the three data
-//               elements in the vector.  The remaining elements
-//               occupy the next positions consecutively in memory.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH const FLOATTYPE *FLOATNAME(UnalignedLVecBase2)::
-get_data() const {
-  return &_v(0);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::get_num_components
-//       Access: Public
-//  Description: Returns the number of elements in the vector, 2.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH int FLOATNAME(UnalignedLVecBase2)::
-get_num_components() const {
-  return 2;
-}

+ 0 - 17
panda/src/linmath/lvecBase2_src.cxx

@@ -13,7 +13,6 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 TypeHandle FLOATNAME(LVecBase2)::_type_handle;
 TypeHandle FLOATNAME(LVecBase2)::_type_handle;
-TypeHandle FLOATNAME(UnalignedLVecBase2)::_type_handle;
 
 
 const FLOATNAME(LVecBase2) FLOATNAME(LVecBase2)::_zero =
 const FLOATNAME(LVecBase2) FLOATNAME(LVecBase2)::_zero =
   FLOATNAME(LVecBase2)(0.0f, 0.0f);
   FLOATNAME(LVecBase2)(0.0f, 0.0f);
@@ -36,19 +35,3 @@ init_type() {
     register_type(_type_handle, name);
     register_type(_type_handle, name);
   }
   }
 }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase2::init_type
-//       Access: Public, Static
-//  Description:
-////////////////////////////////////////////////////////////////////
-void FLOATNAME(UnalignedLVecBase2)::
-init_type() {
-  if (_type_handle == TypeHandle::none()) {
-    // Format a string to describe the type.
-    string name = "UnalignedLVecBase2";
-    name += FLOATTOKEN;
-    register_type(_type_handle, name);
-  }
-}
-

+ 10 - 53
panda/src/linmath/lvecBase2_src.h

@@ -13,23 +13,19 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 
 
-class FLOATNAME(UnalignedLVecBase2);
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : LVecBase2
 //       Class : LVecBase2
 // Description : This is the base class for all two-component
 // Description : This is the base class for all two-component
 //               vectors and points.
 //               vectors and points.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LVecBase2) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LVecBase2) {
 PUBLISHED:
 PUBLISHED:
   typedef const FLOATTYPE *iterator;
   typedef const FLOATTYPE *iterator;
   typedef const FLOATTYPE *const_iterator;
   typedef const FLOATTYPE *const_iterator;
 
 
   INLINE_LINMATH FLOATNAME(LVecBase2)();
   INLINE_LINMATH FLOATNAME(LVecBase2)();
   INLINE_LINMATH FLOATNAME(LVecBase2)(const FLOATNAME(LVecBase2) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase2)(const FLOATNAME(LVecBase2) &copy);
-  INLINE_LINMATH FLOATNAME(LVecBase2)(const FLOATNAME(UnalignedLVecBase2) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (const FLOATNAME(LVecBase2) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (const FLOATNAME(LVecBase2) &copy);
-  INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (const FLOATNAME(UnalignedLVecBase2) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE x, FLOATTYPE y);
   INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE x, FLOATTYPE y);
@@ -138,7 +134,15 @@ PUBLISHED:
 
 
 public:
 public:
   // The underlying implementation is via the Eigen library, if available.
   // The underlying implementation is via the Eigen library, if available.
-  typedef LINMATH_MATRIX(FLOATTYPE, 1, 2) EVector2;
+
+  // We don't bother to align LVecBase2.  The float version is too
+  // small to benefit from SSE2 optimizations.  The double version
+  // *would* benefit, but we use this class infrequently throughout
+  // the Panda codebase, and the nuisance value of maintaining aligned
+  // and unaligned versions of this class outweighs the benefits of
+  // having SSE2 optimizations in the stdfloat-double compilation
+  // mode.
+  typedef UNALIGNED_LINMATH_MATRIX(FLOATTYPE, 1, 2) EVector2;
   EVector2 _v;
   EVector2 _v;
 
 
   INLINE_LINMATH FLOATNAME(LVecBase2)(const EVector2 &v) : _v(v) { }
   INLINE_LINMATH FLOATNAME(LVecBase2)(const EVector2 &v) : _v(v) { }
@@ -158,53 +162,6 @@ private:
   static TypeHandle _type_handle;
   static TypeHandle _type_handle;
 };
 };
 
 
-////////////////////////////////////////////////////////////////////
-//       Class : UnalignedLVecBase2
-// Description : This is an "unaligned" LVecBase2.  It has no
-//               functionality other than to store numbers, and it
-//               will pack them in as tightly as possible, avoiding
-//               any SSE2 alignment requirements shared by the primary
-//               LVecBase2 class.
-//
-//               Use it only when you need to pack numbers tightly
-//               without respect to alignment, and then copy it to a
-//               proper LVecBase2 to get actual use from it.
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH FLOATNAME(UnalignedLVecBase2) {
-PUBLISHED:
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)();
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)(const FLOATNAME(LVecBase2) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)(const FLOATNAME(UnalignedLVecBase2) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase2) &operator = (const FLOATNAME(LVecBase2) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase2) &operator = (const FLOATNAME(UnalignedLVecBase2) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase2)(FLOATTYPE x, FLOATTYPE y);
-
-  INLINE_LINMATH void set(FLOATTYPE x, FLOATTYPE y);
-
-  INLINE_LINMATH FLOATTYPE operator [](int i) const;
-  INLINE_LINMATH FLOATTYPE &operator [](int i);
-
-  EXTENSION(INLINE_LINMATH void __setitem__(int i, FLOATTYPE v));
-  INLINE_LINMATH static int size();
-
-  INLINE_LINMATH const FLOATTYPE *get_data() const;
-  INLINE_LINMATH int get_num_components() const;
-
-public:
-  typedef SIMPLE_MATRIX(FLOATTYPE, 1, 2) UVector2;
-  UVector2 _v;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type();
-
-private:
-  static TypeHandle _type_handle;
-};
-
-
 INLINE ostream &operator << (ostream &out, const FLOATNAME(LVecBase2) &vec) {
 INLINE ostream &operator << (ostream &out, const FLOATNAME(LVecBase2) &vec) {
   vec.output(out);
   vec.output(out);
   return out;
   return out;

+ 0 - 11
panda/src/linmath/lvecBase3_ext_src.I

@@ -189,14 +189,3 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
   return 0;
   return 0;
 }
 }
 
 
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::__setitem__
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void EXT_METHOD_ARGS(FLOATNAME(UnalignedLVecBase3),
-__setitem__, int i, FLOATTYPE v) {
-  nassertv(i >= 0 && i < 3);
-  this->_v(i) = v;
-}

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

@@ -30,16 +30,6 @@ INLINE_LINMATH FLOATNAME(LVecBase3)::
 FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase3) &copy) : _v(copy._v) {
 FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase3) &copy) : _v(copy._v) {
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: LVecBase3::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(LVecBase3)::
-FLOATNAME(LVecBase3)(const FLOATNAME(UnalignedLVecBase3) &copy) {
-  set(copy[0], copy[1], copy[2]);
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase3::Copy Assignment Operator
 //     Function: LVecBase3::Copy Assignment Operator
 //       Access: Public
 //       Access: Public
@@ -52,17 +42,6 @@ operator = (const FLOATNAME(LVecBase3) &copy) {
   return *this;
   return *this;
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: LVecBase3::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(LVecBase3) &FLOATNAME(LVecBase3)::
-operator = (const FLOATNAME(UnalignedLVecBase3) &copy) {
-  set(copy[0], copy[1], copy[2]);
-  return *this;
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LVecBase3::Fill Assignment Operator
 //     Function: LVecBase3::Fill Assignment Operator
 //       Access: Public
 //       Access: Public
@@ -1016,132 +995,3 @@ read_datagram(DatagramIterator &source) {
   _v(1) = source.get_stdfloat();
   _v(1) = source.get_stdfloat();
   _v(2) = source.get_stdfloat();
   _v(2) = source.get_stdfloat();
 }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Default Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)::
-FLOATNAME(UnalignedLVecBase3)() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)::
-FLOATNAME(UnalignedLVecBase3)(const FLOATNAME(LVecBase3) &copy) {
-  set(copy[0], copy[1], copy[2]);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Copy Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)::
-FLOATNAME(UnalignedLVecBase3)(const FLOATNAME(UnalignedLVecBase3) &copy) : _v(copy._v) {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase3) &FLOATNAME(UnalignedLVecBase3)::
-operator = (const FLOATNAME(LVecBase3) &copy) {
-  set(copy[0], copy[1], copy[2]);
-  return *this;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Copy Assignment Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase3) &FLOATNAME(UnalignedLVecBase3)::
-operator = (const FLOATNAME(UnalignedLVecBase3) &copy) {
-  TAU_PROFILE("void UnalignedLVecBase3::operator =(UnalignedLVecBase3 &)", " ", TAU_USER);
-  _v = copy._v;
-  return *this;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)::
-FLOATNAME(UnalignedLVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z) {
-  TAU_PROFILE("UnalignedLVecBase3::UnalignedLVecBase3(FLOATTYPE, ...)", " ", TAU_USER);
-  set(x, y, z);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::set
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH void FLOATNAME(UnalignedLVecBase3)::
-set(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z) {
-  TAU_PROFILE("void UnalignedLVecBase3::set()", " ", TAU_USER);
-  _v(0) = x;
-  _v(1) = y;
-  _v(2) = z;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Indexing Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATTYPE FLOATNAME(UnalignedLVecBase3)::
-operator [](int i) const {
-  nassertr(i >= 0 && i < 3, 0.0);
-  return _v(i);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::Indexing Operator
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH FLOATTYPE &FLOATNAME(UnalignedLVecBase3)::
-operator [](int i) {
-  nassertr(i >= 0 && i < 3, _v(0));
-  return _v(i);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::size
-//       Access: Public, Static
-//  Description: Returns 3: the number of components of a LVecBase3.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH int FLOATNAME(UnalignedLVecBase3)::
-size() {
-  return 3;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::get_data
-//       Access: Public
-//  Description: Returns the address of the first of the three data
-//               elements in the vector.  The remaining elements
-//               occupy the next positions consecutively in memory.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH const FLOATTYPE *FLOATNAME(UnalignedLVecBase3)::
-get_data() const {
-  return &_v(0);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::get_num_components
-//       Access: Public
-//  Description: Returns the number of elements in the vector, 3.
-////////////////////////////////////////////////////////////////////
-INLINE_LINMATH int FLOATNAME(UnalignedLVecBase3)::
-get_num_components() const {
-  return 3;
-}

+ 0 - 17
panda/src/linmath/lvecBase3_src.cxx

@@ -14,7 +14,6 @@
 
 
 
 
 TypeHandle FLOATNAME(LVecBase3)::_type_handle;
 TypeHandle FLOATNAME(LVecBase3)::_type_handle;
-TypeHandle FLOATNAME(UnalignedLVecBase3)::_type_handle;
 
 
 const FLOATNAME(LVecBase3) FLOATNAME(LVecBase3)::_zero =
 const FLOATNAME(LVecBase3) FLOATNAME(LVecBase3)::_zero =
   FLOATNAME(LVecBase3)(0.0f, 0.0f, 0.0f);
   FLOATNAME(LVecBase3)(0.0f, 0.0f, 0.0f);
@@ -40,19 +39,3 @@ init_type() {
   }
   }
 }
 }
 
 
-
-////////////////////////////////////////////////////////////////////
-//     Function: UnalignedLVecBase3::init_type
-//       Access: Public, Static
-//  Description:
-////////////////////////////////////////////////////////////////////
-void FLOATNAME(UnalignedLVecBase3)::
-init_type() {
-  if (_type_handle == TypeHandle::none()) {
-    // Format a string to describe the type.
-    string name = "UnalignedLVecBase3";
-    name += FLOATTOKEN;
-    register_type(_type_handle, name);
-  }
-}
-

+ 5 - 53
panda/src/linmath/lvecBase3_src.h

@@ -13,23 +13,19 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 
 
-class FLOATNAME(UnalignedLVecBase3);
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : LVecBase3
 //       Class : LVecBase3
 // Description : This is the base class for all three-component
 // Description : This is the base class for all three-component
 //               vectors and points.
 //               vectors and points.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LVecBase3) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LVecBase3) {
 PUBLISHED:
 PUBLISHED:
   typedef const FLOATTYPE *iterator;
   typedef const FLOATTYPE *iterator;
   typedef const FLOATTYPE *const_iterator;
   typedef const FLOATTYPE *const_iterator;
 
 
   INLINE_LINMATH FLOATNAME(LVecBase3)();
   INLINE_LINMATH FLOATNAME(LVecBase3)();
   INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase3) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase3) &copy);
-  INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(UnalignedLVecBase3) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (const FLOATNAME(LVecBase3) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (const FLOATNAME(LVecBase3) &copy);
-  INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (const FLOATNAME(UnalignedLVecBase3) &copy);
   INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value);
   INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
   INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
@@ -151,7 +147,10 @@ PUBLISHED:
 
 
 public:
 public:
   // The underlying implementation is via the Eigen library, if available.
   // The underlying implementation is via the Eigen library, if available.
-  typedef LINMATH_MATRIX(FLOATTYPE, 1, 3) EVector3;
+
+  // We don't bother to align LVecBase3, since it won't benefit from
+  // SSE2 optimizations anyway (it's an add number of floats).
+  typedef UNALIGNED_LINMATH_MATRIX(FLOATTYPE, 1, 3) EVector3;
   EVector3 _v;
   EVector3 _v;
 
 
   INLINE_LINMATH FLOATNAME(LVecBase3)(const EVector3 &v) : _v(v) { }
   INLINE_LINMATH FLOATNAME(LVecBase3)(const EVector3 &v) : _v(v) { }
@@ -173,53 +172,6 @@ private:
 };
 };
 
 
 
 
-////////////////////////////////////////////////////////////////////
-//       Class : UnalignedLVecBase3
-// Description : This is an "unaligned" LVecBase3.  It has no
-//               functionality other than to store numbers, and it
-//               will pack them in as tightly as possible, avoiding
-//               any SSE2 alignment requirements shared by the primary
-//               LVecBase3 class.
-//
-//               Use it only when you need to pack numbers tightly
-//               without respect to alignment, and then copy it to a
-//               proper LVecBase3 to get actual use from it.
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH FLOATNAME(UnalignedLVecBase3) {
-PUBLISHED:
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)();
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)(const FLOATNAME(LVecBase3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)(const FLOATNAME(UnalignedLVecBase3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase3) &operator = (const FLOATNAME(LVecBase3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase3) &operator = (const FLOATNAME(UnalignedLVecBase3) &copy);
-  INLINE_LINMATH FLOATNAME(UnalignedLVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
-
-  INLINE_LINMATH void set(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
-
-  INLINE_LINMATH FLOATTYPE operator [](int i) const;
-  INLINE_LINMATH FLOATTYPE &operator [](int i);
-
-  EXTENSION(INLINE_LINMATH void __setitem__(int i, FLOATTYPE v));
-  INLINE_LINMATH static int size();
-
-  INLINE_LINMATH const FLOATTYPE *get_data() const;
-  INLINE_LINMATH int get_num_components() const;
-
-public:
-  typedef SIMPLE_MATRIX(FLOATTYPE, 1, 3) UVector3;
-  UVector3 _v;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type();
-
-private:
-  static TypeHandle _type_handle;
-};
-
-
 INLINE ostream &operator << (ostream &out, const FLOATNAME(LVecBase3) &vec) {
 INLINE ostream &operator << (ostream &out, const FLOATNAME(LVecBase3) &vec) {
   vec.output(out);
   vec.output(out);
   return out;
   return out;

+ 6 - 1
panda/src/linmath/lvecBase4_src.h

@@ -147,6 +147,11 @@ PUBLISHED:
 
 
 public:
 public:
   // The underlying implementation is via the Eigen library, if available.
   // The underlying implementation is via the Eigen library, if available.
+
+  // Unlike LVecBase2 and LVecBase3, we fully align LVecBase4 to
+  // 16-byte boundaries, to take advantage of SSE2 optimizations when
+  // available.  Sometimes this alignment requirement is inconvenient,
+  // so we also provide UnalignedLVecBase4, below.
   typedef LINMATH_MATRIX(FLOATTYPE, 1, 4) EVector4;
   typedef LINMATH_MATRIX(FLOATTYPE, 1, 4) EVector4;
   EVector4 _v;
   EVector4 _v;
 
 
@@ -202,7 +207,7 @@ PUBLISHED:
   INLINE_LINMATH int get_num_components() const;
   INLINE_LINMATH int get_num_components() const;
 
 
 public:
 public:
-  typedef SIMPLE_MATRIX(FLOATTYPE, 1, 4) UVector4;
+  typedef UNALIGNED_LINMATH_MATRIX(FLOATTYPE, 1, 4) UVector4;
   UVector4 _v;
   UVector4 _v;
 
 
 public:
 public:

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

@@ -16,7 +16,7 @@
 //       Class : LVector2
 //       Class : LVector2
 // Description : This is a two-component vector offset.
 // Description : This is a two-component vector offset.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LVector2) : public FLOATNAME(LVecBase2) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LVector2) : public FLOATNAME(LVecBase2) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LVector2)();
   INLINE_LINMATH FLOATNAME(LVector2)();
   INLINE_LINMATH FLOATNAME(LVector2)(const FLOATNAME(LVecBase2) &copy);
   INLINE_LINMATH FLOATNAME(LVector2)(const FLOATNAME(LVecBase2) &copy);

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

@@ -22,7 +22,7 @@
 //               vector, while addition of a vector and a point yields
 //               vector, while addition of a vector and a point yields
 //               a point.
 //               a point.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LVector3) : public FLOATNAME(LVecBase3) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LVector3) : public FLOATNAME(LVecBase3) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LVector3)();
   INLINE_LINMATH FLOATNAME(LVector3)();
   INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase3) &copy);
   INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase3) &copy);

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

@@ -16,7 +16,7 @@
 //       Class : LVector4
 //       Class : LVector4
 // Description : This is a four-component vector distance.
 // Description : This is a four-component vector distance.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA_LINMATH ALIGN_LINMATH FLOATNAME(LVector4) : public FLOATNAME(LVecBase4) {
+class EXPCL_PANDA_LINMATH FLOATNAME(LVector4) : public FLOATNAME(LVecBase4) {
 PUBLISHED:
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LVector4)();
   INLINE_LINMATH FLOATNAME(LVector4)();
   INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase4) &copy);
   INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase4) &copy);

+ 5 - 5
panda/src/mathutil/boundingBox.cxx

@@ -284,16 +284,16 @@ extend_by_finite(const FiniteBoundingVolume *volume) {
 //  Description: 
 //  Description: 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool BoundingBox::
 bool BoundingBox::
-around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
+around_points(const LPoint3 *first, const LPoint3 *last) {
   nassertr(first != last, false);
   nassertr(first != last, false);
 
 
   // Get the minmax of all the points to construct a bounding box.
   // Get the minmax of all the points to construct a bounding box.
-  const UnalignedLVecBase3 *p = first;
+  const LPoint3 *p = first;
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
   // Skip any NaN points.
   // Skip any NaN points.
   int skipped_nan = 0;
   int skipped_nan = 0;
-  while (p != last && LPoint3(*p).is_nan()) {
+  while (p != last && (*p).is_nan()) {
     ++p;
     ++p;
     ++skipped_nan;
     ++skipped_nan;
   }
   }
@@ -310,7 +310,7 @@ around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
   // Skip more NaN points.
   // Skip more NaN points.
-  while (p != last && LPoint3(*p).is_nan()) {
+  while (p != last && (*p).is_nan()) {
     ++p;
     ++p;
     ++skipped_nan;
     ++skipped_nan;
   }
   }
@@ -319,7 +319,7 @@ around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
   while (p != last) {
   while (p != last) {
 #ifndef NDEBUG
 #ifndef NDEBUG
     // Skip more NaN points.
     // Skip more NaN points.
-    if (LPoint3(*p).is_nan()) {
+    if ((*p).is_nan()) {
       ++skipped_nan;
       ++skipped_nan;
     } else
     } else
 #endif
 #endif

+ 2 - 2
panda/src/mathutil/boundingBox.h

@@ -76,8 +76,8 @@ protected:
   virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
   virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
   bool extend_by_finite(const FiniteBoundingVolume *volume);
   bool extend_by_finite(const FiniteBoundingVolume *volume);
 
 
-  virtual bool around_points(const UnalignedLVecBase3 *first,
-                             const UnalignedLVecBase3 *last);
+  virtual bool around_points(const LPoint3 *first,
+                             const LPoint3 *last);
   virtual bool around_spheres(const BoundingVolume **first,
   virtual bool around_spheres(const BoundingVolume **first,
                               const BoundingVolume **last);
                               const BoundingVolume **last);
   virtual bool around_boxes(const BoundingVolume **first,
   virtual bool around_boxes(const BoundingVolume **first,

+ 6 - 6
panda/src/mathutil/boundingSphere.cxx

@@ -297,17 +297,17 @@ extend_by_finite(const FiniteBoundingVolume *volume) {
 //  Description: 
 //  Description: 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool BoundingSphere::
 bool BoundingSphere::
-around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
+around_points(const LPoint3 *first, const LPoint3 *last) {
   nassertr(first != last, false);
   nassertr(first != last, false);
 
 
   // First, get the box of all the points to construct a bounding
   // First, get the box of all the points to construct a bounding
   // box.
   // box.
-  const UnalignedLVecBase3 *p = first;
+  const LPoint3 *p = first;
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
   // Skip any NaN points.
   // Skip any NaN points.
   int skipped_nan = 0;
   int skipped_nan = 0;
-  while (p != last && LPoint3(*p).is_nan()) {
+  while (p != last && (*p).is_nan()) {
     ++p;
     ++p;
     ++skipped_nan;
     ++skipped_nan;
   }
   }
@@ -324,7 +324,7 @@ around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
   // Skip more NaN points.
   // Skip more NaN points.
-  while (p != last && LPoint3(*p).is_nan()) {
+  while (p != last && (*p).is_nan()) {
     ++p;
     ++p;
     ++skipped_nan;
     ++skipped_nan;
   }
   }
@@ -342,7 +342,7 @@ around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
     while (p != last) {
     while (p != last) {
 #ifndef NDEBUG
 #ifndef NDEBUG
       // Skip more NaN points.
       // Skip more NaN points.
-      if (LPoint3(*p).is_nan()) {
+      if ((*p).is_nan()) {
         ++skipped_nan;
         ++skipped_nan;
       } else
       } else
 #endif
 #endif
@@ -363,7 +363,7 @@ around_points(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
     // Now walk back through to get the max distance from center.
     // Now walk back through to get the max distance from center.
     PN_stdfloat max_dist2 = 0.0f;
     PN_stdfloat max_dist2 = 0.0f;
     for (p = first; p != last; ++p) {
     for (p = first; p != last; ++p) {
-      LVector3 v = LPoint3(*p) - _center;
+      LVector3 v = (*p) - _center;
       PN_stdfloat dist2 = dot(v, v);
       PN_stdfloat dist2 = dot(v, v);
       max_dist2 = max(max_dist2, dist2);
       max_dist2 = max(max_dist2, dist2);
     }
     }

+ 2 - 2
panda/src/mathutil/boundingSphere.h

@@ -64,8 +64,8 @@ protected:
   virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
   virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
   bool extend_by_finite(const FiniteBoundingVolume *volume);
   bool extend_by_finite(const FiniteBoundingVolume *volume);
 
 
-  virtual bool around_points(const UnalignedLVecBase3 *first,
-                             const UnalignedLVecBase3 *last);
+  virtual bool around_points(const LPoint3 *first,
+                             const LPoint3 *last);
   virtual bool around_spheres(const BoundingVolume **first,
   virtual bool around_spheres(const BoundingVolume **first,
                               const BoundingVolume **last);
                               const BoundingVolume **last);
   virtual bool around_boxes(const BoundingVolume **first,
   virtual bool around_boxes(const BoundingVolume **first,

+ 12 - 12
panda/src/mathutil/config_mathutil.N

@@ -7,8 +7,8 @@ forcetype PointerToArrayBase<UnalignedLMatrix4f>
 forcetype PTA_LMatrix4f
 forcetype PTA_LMatrix4f
 forcetype CPTA_LMatrix4f
 forcetype CPTA_LMatrix4f
 
 
-forcetype PointerToBase<ReferenceCountedVector<UnalignedLMatrix3f> >
-forcetype PointerToArrayBase<UnalignedLMatrix3f>
+forcetype PointerToBase<ReferenceCountedVector<LMatrix3f> >
+forcetype PointerToArrayBase<LMatrix3f>
 forcetype PTA_LMatrix3f
 forcetype PTA_LMatrix3f
 forcetype CPTA_LMatrix3f
 forcetype CPTA_LMatrix3f
 
 
@@ -17,13 +17,13 @@ forcetype PointerToArrayBase<UnalignedLVecBase4f>
 forcetype PTA_LVecBase4f
 forcetype PTA_LVecBase4f
 forcetype CPTA_LVecBase4f
 forcetype CPTA_LVecBase4f
 
 
-forcetype PointerToBase<ReferenceCountedVector<UnalignedLVecBase3f> >
-forcetype PointerToArrayBase<UnalignedLVecBase3f>
+forcetype PointerToBase<ReferenceCountedVector<LVecBase3f> >
+forcetype PointerToArrayBase<LVecBase3f>
 forcetype PTA_LVecBase3f
 forcetype PTA_LVecBase3f
 forcetype CPTA_LVecBase3f
 forcetype CPTA_LVecBase3f
 
 
-forcetype PointerToBase<ReferenceCountedVector<UnalignedLVecBase2f> >
-forcetype PointerToArrayBase<UnalignedLVecBase2f>
+forcetype PointerToBase<ReferenceCountedVector<LVecBase2f> >
+forcetype PointerToArrayBase<LVecBase2f>
 forcetype PTA_LVecBase2f
 forcetype PTA_LVecBase2f
 forcetype CPTA_LVecBase2f
 forcetype CPTA_LVecBase2f
 
 
@@ -32,8 +32,8 @@ forcetype PointerToArrayBase<UnalignedLMatrix4d>
 forcetype PTA_LMatrix4d
 forcetype PTA_LMatrix4d
 forcetype CPTA_LMatrix4d
 forcetype CPTA_LMatrix4d
 
 
-forcetype PointerToBase<ReferenceCountedVector<UnalignedLMatrix3d> >
-forcetype PointerToArrayBase<UnalignedLMatrix3d>
+forcetype PointerToBase<ReferenceCountedVector<LMatrix3d> >
+forcetype PointerToArrayBase<LMatrix3d>
 forcetype PTA_LMatrix3d
 forcetype PTA_LMatrix3d
 forcetype CPTA_LMatrix3d
 forcetype CPTA_LMatrix3d
 
 
@@ -42,12 +42,12 @@ forcetype PointerToArrayBase<UnalignedLVecBase4d>
 forcetype PTA_LVecBase4d
 forcetype PTA_LVecBase4d
 forcetype CPTA_LVecBase4d
 forcetype CPTA_LVecBase4d
 
 
-forcetype PointerToBase<ReferenceCountedVector<UnalignedLVecBase3d> >
-forcetype PointerToArrayBase<UnalignedLVecBase3d>
+forcetype PointerToBase<ReferenceCountedVector<LVecBase3d> >
+forcetype PointerToArrayBase<LVecBase3d>
 forcetype PTA_LVecBase3d
 forcetype PTA_LVecBase3d
 forcetype CPTA_LVecBase3d
 forcetype CPTA_LVecBase3d
 
 
-forcetype PointerToBase<ReferenceCountedVector<UnalignedLVecBase2d> >
-forcetype PointerToArrayBase<UnalignedLVecBase2d>
+forcetype PointerToBase<ReferenceCountedVector<LVecBase2d> >
+forcetype PointerToArrayBase<LVecBase2d>
 forcetype PTA_LVecBase2d
 forcetype PTA_LVecBase2d
 forcetype CPTA_LVecBase2d
 forcetype CPTA_LVecBase2d

+ 3 - 3
panda/src/mathutil/fftCompressor.cxx

@@ -389,7 +389,7 @@ write_reals(Datagram &datagram, const PN_stdfloat *array, int length) {
 //               datagram.
 //               datagram.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void FFTCompressor::
 void FFTCompressor::
-write_hprs(Datagram &datagram, const UnalignedLVecBase3 *array, int length) {
+write_hprs(Datagram &datagram, const LVecBase3 *array, int length) {
 #ifndef NDEBUG
 #ifndef NDEBUG
   if (_quality >= 104) {
   if (_quality >= 104) {
     // If quality level is at least 104, we don't even convert hpr at
     // If quality level is at least 104, we don't even convert hpr at
@@ -689,7 +689,7 @@ read_reals(DatagramIterator &di, vector_stdfloat &array) {
 //               calculation.  See temp_hpr_fix.
 //               calculation.  See temp_hpr_fix.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool FFTCompressor::
 bool FFTCompressor::
-read_hprs(DatagramIterator &di, pvector<UnalignedLVecBase3> &array, bool new_hpr) {
+read_hprs(DatagramIterator &di, pvector<LVecBase3> &array, bool new_hpr) {
 #ifndef NDEBUG
 #ifndef NDEBUG
   if (_quality >= 104) {
   if (_quality >= 104) {
     // If quality level is at least 104, we don't even convert hpr to
     // If quality level is at least 104, we don't even convert hpr to
@@ -819,7 +819,7 @@ read_hprs(DatagramIterator &di, pvector<UnalignedLVecBase3> &array, bool new_hpr
 //               ensure that the array is initially empty.
 //               ensure that the array is initially empty.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool FFTCompressor::
 bool FFTCompressor::
-read_hprs(DatagramIterator &di, pvector<UnalignedLVecBase3> &array) {
+read_hprs(DatagramIterator &di, pvector<LVecBase3> &array) {
   return read_hprs(di, array, temp_hpr_fix);
   return read_hprs(di, array, temp_hpr_fix);
 }
 }
 
 

+ 3 - 3
panda/src/mathutil/fftCompressor.h

@@ -59,13 +59,13 @@ public:
 
 
   void write_header(Datagram &datagram);
   void write_header(Datagram &datagram);
   void write_reals(Datagram &datagram, const PN_stdfloat *array, int length);
   void write_reals(Datagram &datagram, const PN_stdfloat *array, int length);
-  void write_hprs(Datagram &datagram, const UnalignedLVecBase3 *array, int length);
+  void write_hprs(Datagram &datagram, const LVecBase3 *array, int length);
 
 
   bool read_header(DatagramIterator &di, int bam_minor_version);
   bool read_header(DatagramIterator &di, int bam_minor_version);
   bool read_reals(DatagramIterator &di, vector_stdfloat &array);
   bool read_reals(DatagramIterator &di, vector_stdfloat &array);
-  bool read_hprs(DatagramIterator &di, pvector<UnalignedLVecBase3> &array,
+  bool read_hprs(DatagramIterator &di, pvector<LVecBase3> &array,
                  bool new_hpr);
                  bool new_hpr);
-  bool read_hprs(DatagramIterator &di, pvector<UnalignedLVecBase3> &array);
+  bool read_hprs(DatagramIterator &di, pvector<LVecBase3> &array);
 
 
   static void free_storage();
   static void free_storage();
 
 

+ 1 - 1
panda/src/mathutil/geometricBoundingVolume.I

@@ -63,7 +63,7 @@ around(const GeometricBoundingVolume **first,
 //               indicated.
 //               indicated.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE_MATHUTIL bool GeometricBoundingVolume::
 INLINE_MATHUTIL bool GeometricBoundingVolume::
-around(const UnalignedLVecBase3 *first, const UnalignedLVecBase3 *last) {
+around(const LPoint3 *first, const LPoint3 *last) {
   _flags = F_empty;
   _flags = F_empty;
   if (first != last) {
   if (first != last) {
     return around_points(first, last);
     return around_points(first, last);

+ 1 - 1
panda/src/mathutil/geometricBoundingVolume.cxx

@@ -47,7 +47,7 @@ extend_by_point(const LPoint3 &) {
 //               identified by an STL-style begin/end list.
 //               identified by an STL-style begin/end list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool GeometricBoundingVolume::
 bool GeometricBoundingVolume::
-around_points(const UnalignedLVecBase3 *, const UnalignedLVecBase3 *) {
+around_points(const LPoint3 *, const LPoint3 *) {
   _flags = F_empty;
   _flags = F_empty;
   return false;
   return false;
 }
 }

+ 3 - 4
panda/src/mathutil/geometricBoundingVolume.h

@@ -41,8 +41,7 @@ PUBLISHED:
   // impossible for virtual functions.
   // impossible for virtual functions.
   INLINE_MATHUTIL bool around(const GeometricBoundingVolume **first,
   INLINE_MATHUTIL bool around(const GeometricBoundingVolume **first,
                               const GeometricBoundingVolume **last);
                               const GeometricBoundingVolume **last);
-  INLINE_MATHUTIL bool around(const UnalignedLVecBase3 *first, 
-                              const UnalignedLVecBase3 *last);
+  INLINE_MATHUTIL bool around(const LPoint3 *first, const LPoint3 *last);
 
 
   INLINE_MATHUTIL int contains(const GeometricBoundingVolume *vol) const;
   INLINE_MATHUTIL int contains(const GeometricBoundingVolume *vol) const;
   INLINE_MATHUTIL int contains(const LPoint3 &point) const;
   INLINE_MATHUTIL int contains(const LPoint3 &point) const;
@@ -59,8 +58,8 @@ protected:
   // operations on points in 3-d space.
   // operations on points in 3-d space.
 
 
   virtual bool extend_by_point(const LPoint3 &point);
   virtual bool extend_by_point(const LPoint3 &point);
-  virtual bool around_points(const UnalignedLVecBase3 *first,
-                             const UnalignedLVecBase3 *last);
+  virtual bool around_points(const LPoint3 *first,
+                             const LPoint3 *last);
   virtual int contains_point(const LPoint3 &point) const;
   virtual int contains_point(const LPoint3 &point) const;
   virtual int contains_lineseg(const LPoint3 &a, const LPoint3 &b) const;
   virtual int contains_lineseg(const LPoint3 &a, const LPoint3 &b) const;
 
 

+ 1 - 1
panda/src/mathutil/omniBoundingVolume.cxx

@@ -139,7 +139,7 @@ extend_by_hexahedron(const BoundingHexahedron *) {
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool OmniBoundingVolume::
 bool OmniBoundingVolume::
-around_points(const UnalignedLVecBase3 *, const UnalignedLVecBase3 *) {
+around_points(const LPoint3 *, const LPoint3 *) {
   return true;
   return true;
 }
 }
 
 

+ 2 - 2
panda/src/mathutil/omniBoundingVolume.h

@@ -49,8 +49,8 @@ protected:
   virtual bool extend_by_box(const BoundingBox *box);
   virtual bool extend_by_box(const BoundingBox *box);
   virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
   virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
 
 
-  virtual bool around_points(const UnalignedLVecBase3 *first,
-                             const UnalignedLVecBase3 *last);
+  virtual bool around_points(const LPoint3 *first,
+                             const LPoint3 *last);
   virtual bool around_spheres(const BoundingVolume **first,
   virtual bool around_spheres(const BoundingVolume **first,
                               const BoundingVolume **last);
                               const BoundingVolume **last);
   virtual bool around_boxes(const BoundingVolume **first,
   virtual bool around_boxes(const BoundingVolume **first,

+ 12 - 20
panda/src/mathutil/pta_LMatrix3.h

@@ -26,19 +26,15 @@
 //               to use a pta of this type (whether they need to
 //               to use a pta of this type (whether they need to
 //               export it or not) should include this header file,
 //               export it or not) should include this header file,
 //               rather than defining the pta again.
 //               rather than defining the pta again.
-//
-//               We actually wrap UnalignedLMatrix3f, in case we are
-//               building with SSE2 and LMatrix3f requires strict
-//               alignment.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<UnalignedLMatrix3f> >)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<UnalignedLMatrix3f>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<UnalignedLMatrix3f>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<UnalignedLMatrix3f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<LMatrix3f> >)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<LMatrix3f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<LMatrix3f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<LMatrix3f>)
 
 
-typedef PointerToArray<UnalignedLMatrix3f> PTA_LMatrix3f;
-typedef ConstPointerToArray<UnalignedLMatrix3f> CPTA_LMatrix3f;
+typedef PointerToArray<LMatrix3f> PTA_LMatrix3f;
+typedef ConstPointerToArray<LMatrix3f> CPTA_LMatrix3f;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PTA_LMatrix3d
 //       Class : PTA_LMatrix3d
@@ -47,19 +43,15 @@ typedef ConstPointerToArray<UnalignedLMatrix3f> CPTA_LMatrix3f;
 //               to use a pta of this type (whether they need to
 //               to use a pta of this type (whether they need to
 //               export it or not) should include this header file,
 //               export it or not) should include this header file,
 //               rather than defining the pta again.
 //               rather than defining the pta again.
-//
-//               We actually wrap UnalignedLMatrix3d, in case we are
-//               building with SSE2 and LMatrix3d requires strict
-//               alignment.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<UnalignedLMatrix3d> >)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<UnalignedLMatrix3d>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<UnalignedLMatrix3d>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<UnalignedLMatrix3d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<LMatrix3d> >)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<LMatrix3d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<LMatrix3d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<LMatrix3d>)
 
 
-typedef PointerToArray<UnalignedLMatrix3d> PTA_LMatrix3d;
-typedef ConstPointerToArray<UnalignedLMatrix3d> CPTA_LMatrix3d;
+typedef PointerToArray<LMatrix3d> PTA_LMatrix3d;
+typedef ConstPointerToArray<LMatrix3d> CPTA_LMatrix3d;
 
 
 #ifndef STDFLOAT_DOUBLE
 #ifndef STDFLOAT_DOUBLE
 typedef PTA_LMatrix3f PTA_LMatrix3;
 typedef PTA_LMatrix3f PTA_LMatrix3;

+ 12 - 20
panda/src/mathutil/pta_LVecBase2.h

@@ -26,19 +26,15 @@
 //               to use a pta of this type (whether they need to
 //               to use a pta of this type (whether they need to
 //               export it or not) should include this header file,
 //               export it or not) should include this header file,
 //               rather than defining the pta again.
 //               rather than defining the pta again.
-//
-//               We actually wrap UnalignedLVecBase2f, in case we are
-//               building with SSE2 and LVecBase2f requires strict
-//               alignment.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<UnalignedLVecBase2f> >)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<UnalignedLVecBase2f>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<UnalignedLVecBase2f>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<UnalignedLVecBase2f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<LVecBase2f> >)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<LVecBase2f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<LVecBase2f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<LVecBase2f>)
 
 
-typedef PointerToArray<UnalignedLVecBase2f> PTA_LVecBase2f;
-typedef ConstPointerToArray<UnalignedLVecBase2f> CPTA_LVecBase2f;
+typedef PointerToArray<LVecBase2f> PTA_LVecBase2f;
+typedef ConstPointerToArray<LVecBase2f> CPTA_LVecBase2f;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PTA_LVecBase2d
 //       Class : PTA_LVecBase2d
@@ -47,19 +43,15 @@ typedef ConstPointerToArray<UnalignedLVecBase2f> CPTA_LVecBase2f;
 //               to use a pta of this type (whether they need to
 //               to use a pta of this type (whether they need to
 //               export it or not) should include this header file,
 //               export it or not) should include this header file,
 //               rather than defining the pta again.
 //               rather than defining the pta again.
-//
-//               We actually wrap UnalignedLVecBase2d, in case we are
-//               building with SSE2 and LVecBase2d requires strict
-//               alignment.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<UnalignedLVecBase2d> >)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<UnalignedLVecBase2d>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<UnalignedLVecBase2d>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<UnalignedLVecBase2d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<LVecBase2d> >)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<LVecBase2d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<LVecBase2d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<LVecBase2d>)
 
 
-typedef PointerToArray<UnalignedLVecBase2d> PTA_LVecBase2d;
-typedef ConstPointerToArray<UnalignedLVecBase2d> CPTA_LVecBase2d;
+typedef PointerToArray<LVecBase2d> PTA_LVecBase2d;
+typedef ConstPointerToArray<LVecBase2d> CPTA_LVecBase2d;
 
 
 #ifndef STDFLOAT_DOUBLE
 #ifndef STDFLOAT_DOUBLE
 typedef PTA_LVecBase2f PTA_LVecBase2;
 typedef PTA_LVecBase2f PTA_LVecBase2;

+ 12 - 20
panda/src/mathutil/pta_LVecBase3.h

@@ -26,19 +26,15 @@
 //               to use a pta of this type (whether they need to
 //               to use a pta of this type (whether they need to
 //               export it or not) should include this header file,
 //               export it or not) should include this header file,
 //               rather than defining the pta again.
 //               rather than defining the pta again.
-//
-//               We actually wrap UnalignedLVecBase3f, in case we are
-//               building with SSE2 and LVecBase3f requires strict
-//               alignment.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<UnalignedLVecBase3f> >)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<UnalignedLVecBase3f>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<UnalignedLVecBase3f>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<UnalignedLVecBase3f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<LVecBase3f> >)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<LVecBase3f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<LVecBase3f>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<LVecBase3f>)
 
 
-typedef PointerToArray<UnalignedLVecBase3f> PTA_LVecBase3f;
-typedef ConstPointerToArray<UnalignedLVecBase3f> CPTA_LVecBase3f;
+typedef PointerToArray<LVecBase3f> PTA_LVecBase3f;
+typedef ConstPointerToArray<LVecBase3f> CPTA_LVecBase3f;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PTA_LVecBase3d
 //       Class : PTA_LVecBase3d
@@ -47,19 +43,15 @@ typedef ConstPointerToArray<UnalignedLVecBase3f> CPTA_LVecBase3f;
 //               to use a pta of this type (whether they need to
 //               to use a pta of this type (whether they need to
 //               export it or not) should include this header file,
 //               export it or not) should include this header file,
 //               rather than defining the pta again.
 //               rather than defining the pta again.
-//
-//               We actually wrap UnalignedLVecBase3d, in case we are
-//               building with SSE2 and LVecBase3d requires strict
-//               alignment.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<UnalignedLVecBase3d> >)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<UnalignedLVecBase3d>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<UnalignedLVecBase3d>)
-EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<UnalignedLVecBase3d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToBase<ReferenceCountedVector<LVecBase3d> >)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArrayBase<LVecBase3d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, PointerToArray<LVecBase3d>)
+EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL, ConstPointerToArray<LVecBase3d>)
 
 
-typedef PointerToArray<UnalignedLVecBase3d> PTA_LVecBase3d;
-typedef ConstPointerToArray<UnalignedLVecBase3d> CPTA_LVecBase3d;
+typedef PointerToArray<LVecBase3d> PTA_LVecBase3d;
+typedef ConstPointerToArray<LVecBase3d> CPTA_LVecBase3d;
 
 
 #ifndef STDFLOAT_DOUBLE
 #ifndef STDFLOAT_DOUBLE
 typedef PTA_LVecBase3f PTA_LVecBase3;
 typedef PTA_LVecBase3f PTA_LVecBase3;

+ 2 - 2
panda/src/mathutil/triangulator.I

@@ -43,10 +43,10 @@ get_num_vertices() const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the nth vertex.
 //  Description: Returns the nth vertex.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE LPoint2d Triangulator::
+INLINE const LPoint2d &Triangulator::
 get_vertex(int n) const {
 get_vertex(int n) const {
   nassertr(n >= 0 && n < (int)_vertices.size(), LPoint2d::zero());
   nassertr(n >= 0 && n < (int)_vertices.size(), LPoint2d::zero());
-  return LPoint2d(_vertices[n]);
+  return _vertices[n];
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 2
panda/src/mathutil/triangulator.cxx

@@ -333,8 +333,8 @@ check_left_winding(const vector_int &range) const {
   double area = 0.0;
   double area = 0.0;
   size_t j = range.size() - 1;
   size_t j = range.size() - 1;
   for (size_t i = 0; i < range.size(); ++i) {
   for (size_t i = 0; i < range.size(); ++i) {
-    const UnalignedLVecBase2d &p0 = _vertices[range[j]];
-    const UnalignedLVecBase2d &p1 = _vertices[range[i]];
+    const LPoint2d &p0 = _vertices[range[j]];
+    const LPoint2d &p1 = _vertices[range[i]];
     area += p0[0] * p1[1] - p0[1] * p1[0];
     area += p0[0] * p1[1] - p0[1] * p1[0];
     j = i;
     j = i;
   }
   }

+ 2 - 2
panda/src/mathutil/triangulator.h

@@ -44,7 +44,7 @@ PUBLISHED:
   INLINE int add_vertex(double x, double y);
   INLINE int add_vertex(double x, double y);
 
 
   INLINE int get_num_vertices() const;
   INLINE int get_num_vertices() const;
-  INLINE LPoint2d get_vertex(int n) const;
+  INLINE const LPoint2d &get_vertex(int n) const;
   MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
   MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
 
 
   void clear_polygon();
   void clear_polygon();
@@ -62,7 +62,7 @@ PUBLISHED:
   int get_triangle_v2(int n) const;
   int get_triangle_v2(int n) const;
 
 
 private:
 private:
-  typedef pvector<UnalignedLVecBase2d> Vertices;
+  typedef pvector<LPoint2d> Vertices;
   Vertices _vertices;
   Vertices _vertices;
 
 
   vector_int _polygon;
   vector_int _polygon;

+ 1 - 1
panda/src/parametrics/nurbsCurveEvaluator.h

@@ -82,7 +82,7 @@ PUBLISHED:
 
 
 public:
 public:
   typedef epvector<LVecBase4> Vert4Array;
   typedef epvector<LVecBase4> Vert4Array;
-  typedef pvector<UnalignedLVecBase3> Vert3Array;
+  typedef pvector<LPoint3> Vert3Array;
   void get_vertices(Vert4Array &verts, const NodePath &rel_to) const;
   void get_vertices(Vert4Array &verts, const NodePath &rel_to) const;
   void get_vertices(Vert3Array &verts, const NodePath &rel_to) const;
   void get_vertices(Vert3Array &verts, const NodePath &rel_to) const;
 
 

+ 1 - 1
panda/src/parametrics/nurbsSurfaceEvaluator.h

@@ -84,7 +84,7 @@ PUBLISHED:
 
 
 public:
 public:
   typedef epvector<LVecBase4> Vert4Array;
   typedef epvector<LVecBase4> Vert4Array;
-  typedef pvector<UnalignedLVecBase3> Vert3Array;
+  typedef pvector<LPoint3> Vert3Array;
   void get_vertices(Vert4Array &verts, const NodePath &rel_to) const;
   void get_vertices(Vert4Array &verts, const NodePath &rel_to) const;
   void get_vertices(Vert3Array &verts, const NodePath &rel_to) const;
   void get_vertices(Vert3Array &verts, const NodePath &rel_to) const;
 
 

+ 1 - 1
panda/src/pgraph/occluderNode.I

@@ -47,7 +47,7 @@ get_num_vertices() const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the nth vertex of the occluder polygon.
 //  Description: Returns the nth vertex of the occluder polygon.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE LPoint3 OccluderNode::
+INLINE const LPoint3 &OccluderNode::
 get_vertex(int n) const {
 get_vertex(int n) const {
   nassertr(n >= 0 && n < (int)_vertices.size(), LPoint3::zero());
   nassertr(n >= 0 && n < (int)_vertices.size(), LPoint3::zero());
   return LPoint3(_vertices[n]);
   return LPoint3(_vertices[n]);

+ 5 - 8
panda/src/pgraph/occluderNode.cxx

@@ -131,7 +131,7 @@ xform(const LMatrix4 &mat) {
   for (Vertices::iterator vi = _vertices.begin();
   for (Vertices::iterator vi = _vertices.begin();
        vi != _vertices.end();
        vi != _vertices.end();
        ++vi) {
        ++vi) {
-    (*vi) = LPoint3(*vi) * mat;
+    (*vi) = (*vi) * mat;
   }
   }
 }
 }
 
 
@@ -233,8 +233,8 @@ compute_internal_bounds(CPT(BoundingVolume) &internal_bounds,
   // Now actually compute the bounding volume by putting it around all
   // Now actually compute the bounding volume by putting it around all
   // of our vertices.
   // of our vertices.
   if (!_vertices.empty()) {
   if (!_vertices.empty()) {
-    const UnalignedLVecBase3 *vertices_begin = &_vertices[0];
-    const UnalignedLVecBase3 *vertices_end = vertices_begin + _vertices.size();
+    const LPoint3 *vertices_begin = &_vertices[0];
+    const LPoint3 *vertices_end = vertices_begin + _vertices.size();
     gbv->around(vertices_begin, vertices_end);
     gbv->around(vertices_begin, vertices_end);
   }
   }
 
 
@@ -262,10 +262,7 @@ get_occluder_viz(CullTraverser *trav, CullTraverserData &data) {
       (get_name(), GeomVertexFormat::get_v3n3t2(), Geom::UH_static);
       (get_name(), GeomVertexFormat::get_v3n3t2(), Geom::UH_static);
     
     
     // Compute the polygon normal from the first three vertices.
     // Compute the polygon normal from the first three vertices.
-    LPoint3 a(_vertices[0]);
-    LPoint3 b(_vertices[1]);
-    LPoint3 c(_vertices[2]);
-    LPlane plane(a, b, c);
+    LPlane plane(_vertices[0], _vertices[1], _vertices[2]);
     LVector3 poly_normal = plane.get_normal();
     LVector3 poly_normal = plane.get_normal();
     
     
     GeomVertexWriter vertex(vdata, InternalName::get_vertex());
     GeomVertexWriter vertex(vdata, InternalName::get_vertex());
@@ -391,7 +388,7 @@ write_datagram(BamWriter *manager, Datagram &dg) {
   for (Vertices::const_iterator vi = _vertices.begin();
   for (Vertices::const_iterator vi = _vertices.begin();
        vi != _vertices.end();
        vi != _vertices.end();
        ++vi) {
        ++vi) {
-    LPoint3(*vi).write_datagram(dg);
+    (*vi).write_datagram(dg);
   }
   }
 }
 }
 
 

+ 2 - 2
panda/src/pgraph/occluderNode.h

@@ -58,7 +58,7 @@ PUBLISHED:
   INLINE void set_vertices(const LPoint3 &v0, const LPoint3 &v1,
   INLINE void set_vertices(const LPoint3 &v0, const LPoint3 &v1,
                            const LPoint3 &v2, const LPoint3 &v3);
                            const LPoint3 &v2, const LPoint3 &v3);
   INLINE int get_num_vertices() const;
   INLINE int get_num_vertices() const;
-  INLINE LPoint3 get_vertex(int n) const;
+  INLINE const LPoint3 &get_vertex(int n) const;
   MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
   MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
 
 
 protected:
 protected:
@@ -73,7 +73,7 @@ protected:
 private:
 private:
   bool _double_sided;
   bool _double_sided;
   PN_stdfloat _min_coverage;
   PN_stdfloat _min_coverage;
-  typedef pvector<UnalignedLVecBase3> Vertices;
+  typedef pvector<LPoint3> Vertices;
   Vertices _vertices;
   Vertices _vertices;
 
 
   PT(Geom) _occluder_viz, _frame_viz;
   PT(Geom) _occluder_viz, _frame_viz;

+ 1 - 1
panda/src/pgraph/portalNode.I

@@ -158,7 +158,7 @@ get_num_vertices() const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the nth vertex of the portal polygon.
 //  Description: Returns the nth vertex of the portal polygon.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE LPoint3 PortalNode::
+INLINE const LPoint3 &PortalNode::
 get_vertex(int n) const {
 get_vertex(int n) const {
   nassertr(n >= 0 && n < (int)_vertices.size(), LPoint3::zero());
   nassertr(n >= 0 && n < (int)_vertices.size(), LPoint3::zero());
   return LPoint3(_vertices[n]);
   return LPoint3(_vertices[n]);

+ 4 - 4
panda/src/pgraph/portalNode.cxx

@@ -62,7 +62,7 @@ PortalNode(const string &name) :
 //               to create an arbitrary portal and setup from Python
 //               to create an arbitrary portal and setup from Python
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PortalNode::
 PortalNode::
-PortalNode(const string &name, const LPoint3 &pos, PN_stdfloat scale) :
+PortalNode(const string &name, LPoint3 pos, PN_stdfloat scale) :
   PandaNode(name),
   PandaNode(name),
   _from_portal_mask(PortalMask::all_on()),
   _from_portal_mask(PortalMask::all_on()),
   _into_portal_mask(PortalMask::all_on()),
   _into_portal_mask(PortalMask::all_on()),
@@ -394,8 +394,8 @@ compute_internal_bounds(CPT(BoundingVolume) &internal_bounds,
   // Now actually compute the bounding volume by putting it around all
   // Now actually compute the bounding volume by putting it around all
   // of our vertices.
   // of our vertices.
 
 
-  const UnalignedLVecBase3 *vertices_begin = &_vertices[0];
-  const UnalignedLVecBase3 *vertices_end = vertices_begin + _vertices.size();
+  const LPoint3 *vertices_begin = &_vertices[0];
+  const LPoint3 *vertices_end = vertices_begin + _vertices.size();
 
 
   // Now actually compute the bounding volume by putting it around all
   // Now actually compute the bounding volume by putting it around all
   gbv->around(vertices_begin, vertices_end);
   gbv->around(vertices_begin, vertices_end);
@@ -452,7 +452,7 @@ write_datagram(BamWriter *manager, Datagram &dg) {
   for (Vertices::const_iterator vi = _vertices.begin();
   for (Vertices::const_iterator vi = _vertices.begin();
        vi != _vertices.end();
        vi != _vertices.end();
        ++vi) {
        ++vi) {
-    LPoint3(*vi).write_datagram(dg);
+    (*vi).write_datagram(dg);
   }
   }
 }
 }
 
 

+ 3 - 3
panda/src/pgraph/portalNode.h

@@ -34,7 +34,7 @@
 class EXPCL_PANDA_PGRAPH PortalNode : public PandaNode {
 class EXPCL_PANDA_PGRAPH PortalNode : public PandaNode {
 PUBLISHED:
 PUBLISHED:
   PortalNode(const string &name);
   PortalNode(const string &name);
-  PortalNode(const string &name, const LPoint3 &pos, PN_stdfloat scale=10.0);
+  PortalNode(const string &name, LPoint3 pos, PN_stdfloat scale=10.0);
 
 
 protected:
 protected:
   PortalNode(const PortalNode &copy);
   PortalNode(const PortalNode &copy);
@@ -67,7 +67,7 @@ PUBLISHED:
   INLINE void add_vertex(const LPoint3 &vertex);
   INLINE void add_vertex(const LPoint3 &vertex);
 
 
   INLINE int get_num_vertices() const;
   INLINE int get_num_vertices() const;
-  INLINE LPoint3 get_vertex(int n) const;
+  INLINE const LPoint3 &get_vertex(int n) const;
   MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
   MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
 
 
   INLINE void set_cell_in(const NodePath &cell);
   INLINE void set_cell_in(const NodePath &cell);
@@ -111,7 +111,7 @@ private:
   };
   };
   int _flags;
   int _flags;
 
 
-  typedef pvector<UnalignedLVecBase3> Vertices;
+  typedef pvector<LPoint3> Vertices;
   Vertices _vertices;
   Vertices _vertices;
 
 
   NodePath _cell_in;  // This is the cell it resides in
   NodePath _cell_in;  // This is the cell it resides in

+ 1 - 1
panda/src/pgui/pgItem.h

@@ -201,7 +201,7 @@ private:
                                      PN_stdfloat &largest_area, 
                                      PN_stdfloat &largest_area, 
                                      const LVecBase4 *new_frame);
                                      const LVecBase4 *new_frame);
 
 
-  typedef pvector<UnalignedLVecBase2> ClipPoints;
+  typedef pvector<LVecBase2> ClipPoints;
   bool clip_frame(ClipPoints &source_points, const LPlane &plane) const;
   bool clip_frame(ClipPoints &source_points, const LPlane &plane) const;
 
 
 protected:
 protected:

+ 1 - 1
panda/src/text/textNode.cxx

@@ -732,7 +732,7 @@ compute_internal_bounds(CPT(BoundingVolume) &internal_bounds,
   // measured it.
   // measured it.
   check_measure();
   check_measure();
 
 
-  UnalignedLVecBase3 vertices[8];
+  LPoint3 vertices[8];
   vertices[0].set(_ul3d[0], _ul3d[1], _ul3d[2]);
   vertices[0].set(_ul3d[0], _ul3d[1], _ul3d[2]);
   vertices[1].set(_ul3d[0], _ul3d[1], _lr3d[2]);
   vertices[1].set(_ul3d[0], _ul3d[1], _lr3d[2]);
   vertices[2].set(_ul3d[0], _lr3d[1], _ul3d[2]);
   vertices[2].set(_ul3d[0], _lr3d[1], _ul3d[2]);

+ 1 - 1
pandatool/src/eggcharbase/eggJointData.cxx

@@ -199,7 +199,7 @@ score_reparent_to(EggJointData *new_parent, EggCharacterDb &db) {
   // would receive in all frames of all models, were it reparented to
   // would receive in all frames of all models, were it reparented to
   // the indicated joint.
   // the indicated joint.
   vector_stdfloat i, j, k, a, b, c, x, y, z;
   vector_stdfloat i, j, k, a, b, c, x, y, z;
-  pvector<UnalignedLVecBase3> hprs;
+  pvector<LVecBase3> hprs;
   int num_rows = 0;
   int num_rows = 0;
 
 
   int num_models = get_num_models();
   int num_models = get_num_models();