@@ -43,6 +43,7 @@ void export_qangle(scope);
4343void export_quaternion (scope);
4444void export_cplane_t (scope);
4545void export_radian_euler (scope);
46+ void export_matrix3x4_t (scope);
4647
4748
4849// -----------------------------------------------------------------------------
@@ -55,6 +56,7 @@ DECLARE_SP_MODULE(_mathlib)
5556 export_quaternion (_mathlib);
5657 export_cplane_t (_mathlib);
5758 export_radian_euler (_mathlib);
59+ export_matrix3x4_t (_mathlib);
5860}
5961
6062
@@ -504,3 +506,65 @@ void export_radian_euler(scope _mathlib)
504506 ADD_MEM_TOOLS (RadianEuler)
505507 ;
506508}
509+
510+
511+ // -----------------------------------------------------------------------------
512+ // Exports matrix3x4_t.
513+ // -----------------------------------------------------------------------------
514+ void export_matrix3x4_t (scope _mathlib)
515+ {
516+ // TODO:
517+ // - Add support for e.g. matrix[0] = (1, 2, 3, 4)
518+ class_<matrix3x4_t >(" Matrix3x4" )
519+ .def (init<
520+ float , float , float , float ,
521+ float , float , float , float ,
522+ float , float , float , float >(
523+ " Create a new 3x4 matrix.\n\n "
524+ " .. note:: The matrix is not initialized with ``0.0``." ))
525+
526+ .def (init<matrix3x4_t &>(
527+ " Copy an existing matrix." ))
528+
529+ .def (init<const Vector&, const Vector&, const Vector&, const Vector&>())
530+ .def (" __repr__" , &matrix3x4_tExt::__repr__)
531+
532+ .def (
533+ " invalidate" ,
534+ &matrix3x4_t ::Invalidate,
535+ " Invalidate the the matrix (set all values to ``nan``)." )
536+
537+ .def (
538+ " __getitem__" ,
539+ &matrix3x4_tExt::__getitem__,
540+ manage_new_object_policy (),
541+ " Return a single row of the matrix (0 - 2).\n\n "
542+ " :rtype: tuple" )
543+
544+ ADD_MEM_TOOLS (matrix3x4_t )
545+ ;
546+
547+ class_<Matrix3x4Row>(" Matrix3x4Row" , no_init)
548+ .def (" __repr__" , &Matrix3x4Row::__repr__)
549+
550+ .def (
551+ " __getitem__" ,
552+ &GetItemIndexer<Matrix3x4Row, float , 0 , 3 >,
553+ (arg (" index" )),
554+ " Return the value of a column (0 - 3).\n "
555+ " \n "
556+ " :param int index: An index between 0 and 3 that identifies the column.\n "
557+ " :rtype: float"
558+ )
559+
560+ .def (
561+ " __setitem__" ,
562+ &SetItemIndexer<Matrix3x4Row, float , 0 , 3 >,
563+ (arg (" index" ), arg (" value" )),
564+ " Set the value of a column.\n "
565+ " \n "
566+ " :param int index: An index between 0 and 3 that identifies the column.\n "
567+ " :param float value: The value to set."
568+ )
569+ ;
570+ }
0 commit comments