MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / register_QuatArray

Function register_QuatArray

src/python/PyImath/PyImathQuat.cpp:1040–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1038
1039template <class T>
1040class_<FixedArray<IMATH_NAMESPACE::Quat<T> > >
1041register_QuatArray()
1042{
1043 using boost::mpl::true_;
1044 using boost::mpl::false_;
1045
1046 typedef IMATH_NAMESPACE::Quat<T> QuatT;
1047
1048 class_<FixedArray<QuatT> > quatArray_class = FixedArray<QuatT>::register_("Fixed length array of IMATH_NAMESPACE::Quat");
1049 quatArray_class
1050 .add_property("r",&QuatArray_get<T,0>)
1051 .add_property("x",&QuatArray_get<T,1>)
1052 .add_property("y",&QuatArray_get<T,2>)
1053 .add_property("z",&QuatArray_get<T,3>)
1054 .def("setRotation", &QuatArray_setRotation<T>,
1055 "set rotation angles for each quat",
1056 (args("from", "to")))
1057 .def("orientToVectors", &QuatArray_orientToVectors<T>,
1058 "Sets the orientations to match the given forward and up vectors, "
1059 "matching the forward vector exactly if 'alignForward' is True, matching "
1060 "the up vector exactly if 'alignForward' is False. If the vectors are "
1061 "already orthogonal, both vectors will be matched exactly.",
1062 (args("forward", "up", "alignForward")))
1063 .def("extract", &QuatArray_extract<T>,
1064 "Extract the rotation component of an M44d and return it as a quaternion.",
1065 (args("lxform")))
1066 .def("axis", &QuatArray_axis<T>,
1067 "get rotation axis for each quat")
1068 .def("angle", &QuatArray_angle<T>,
1069 "get rotation angle about the axis returned by axis() for each quat")
1070 .def("setAxisAngle", &QuatArray_setAxisAngle<T>,
1071 "set the quaternion arrays from a given axis and angle",
1072 (args("axis", "angle")), return_value_policy<copy_non_const_reference>())
1073 .def("setEulerXYZ", &QuatArray_setEulerXYZ<T>,
1074 "set the quaternion arrays from a given euler XYZ angle vector",
1075 (args("euler")))
1076 .def("rotateVector", &QuatArray_rotateVector<T>,
1077 "Rotate the supplied vectors by the quaternions. Assumes quaternions are normalized.",
1078 (args("vector")))
1079 .def("inverse", &QuatArray_inverse<T>,
1080 "Return 1/Q for each quaternion.",
1081 (args("QuatArray")))
1082 .def("__rmul__", &QuatArray_rmulVec3<T>)
1083 .def("__rmul__", &QuatArray_rmulVec3Array<T>)
1084 .def("__init__", make_constructor(QuatArray_quatConstructor1<T>))
1085 ;
1086
1087 generate_member_bindings<op_quatDot<QuatT>, true_>
1088 (quatArray_class, "dot",
1089 "Return the element-by-element Euclidean inner product",
1090 args("qB"));
1091 generate_member_bindings<op_quatDot<QuatT>, true_>
1092 (quatArray_class, "euclideanInnerProduct",
1093 "Return the element-by-element Euclidean inner product",
1094 args("qB"));
1095 generate_member_bindings<op_quatNormalize<QuatT> >
1096 (quatArray_class, "normalize",
1097 "Normalize each quaternion in the array");

Callers

nothing calls this directly

Calls 1

add_comparison_functionsFunction · 0.70

Tested by

no test coverage detected