|
Blender V4.3
|
#include <BLI_math_basis_types.hh>
Public Types | |
| enum class | Value : int8_t { X_POS = 0 , Y_POS = 1 , Z_POS = 2 , X_NEG = 3 , Y_NEG = 4 , Z_NEG = 5 } |
Public Member Functions | |
| AxisSigned ()=default | |
| constexpr | AxisSigned (Value axis) |
| constexpr | AxisSigned (Axis axis) |
| constexpr Axis | axis () const |
| AxisSigned | operator- () const |
| AxisSigned | next_after () const |
| constexpr | operator Value () const |
| constexpr int | as_int () const |
| constexpr int | sign () const |
| constexpr bool | is_negative () const |
| operator bool () const =delete | |
Static Public Member Functions | |
| static constexpr AxisSigned | from_int (int axis_int) |
Static Public Attributes | |
| static constexpr Value | X_POS = Value::X_POS |
| static constexpr Value | Y_POS = Value::Y_POS |
| static constexpr Value | Z_POS = Value::Z_POS |
| static constexpr Value | X_NEG = Value::X_NEG |
| static constexpr Value | Y_NEG = Value::Y_NEG |
| static constexpr Value | Z_NEG = Value::Z_NEG |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const AxisSigned axis) |
An enum class representing one of the 6 axis aligned direction. This is implemented using a class to allow operators and methods. NOTE: While this represents a 3D axis it can still be used to generate 2D basis vectors.
Definition at line 101 of file BLI_math_basis_types.hh.
|
strong |
| Enumerator | |
|---|---|
| X_POS | |
| Y_POS | |
| Z_POS | |
| X_NEG | |
| Y_NEG | |
| Z_NEG | |
Definition at line 103 of file BLI_math_basis_types.hh.
|
default |
|
inlineconstexpr |
Definition at line 127 of file BLI_math_basis_types.hh.
|
inlineconstexpr |
Definition at line 128 of file BLI_math_basis_types.hh.
|
inlineconstexpr |
Definition at line 162 of file BLI_math_basis_types.hh.
References int.
Referenced by axis(), next_after(), operator-(), blender::math::tests::TEST(), and blender::math::tests::TEST().
|
inlineconstexpr |
Return the axis without the sign. It changes the type whereas abs(axis) doesn't.
Definition at line 139 of file BLI_math_basis_types.hh.
References as_int(), and blender::math::Axis::from_int().
Referenced by from_int(), blender::math::from_tracking(), blender::math::from_vector(), blender::math::invert(), blender::math::tests::TEST(), and blender::math::transform_point().
|
inlinestaticconstexpr |
Allow casting from DNA enums stored as short / int.
Definition at line 131 of file BLI_math_basis_types.hh.
References axis(), BLI_assert, X_POS, and Z_NEG.
Referenced by next_after(), operator-(), blender::math::tests::TEST(), blender::math::tests::TEST(), and blender::math::to_vector().
|
inlineconstexpr |
Returns true if axis is negative, false otherwise.
Definition at line 174 of file BLI_math_basis_types.hh.
Referenced by blender::math::from_vector(), blender::math::invert(), sign(), and blender::math::transform_point().
|
inline |
Return next enum value.
Definition at line 151 of file BLI_math_basis_types.hh.
References as_int(), and from_int().
Referenced by blender::math::rotation_between().
|
explicitdelete |
Avoid hell.
|
inlineconstexpr |
Allow usage in switch() statements and comparisons.
Definition at line 157 of file BLI_math_basis_types.hh.
|
inline |
Return the opposing axis.
Definition at line 145 of file BLI_math_basis_types.hh.
References as_int(), and from_int().
|
inlineconstexpr |
Returns -1 if axis is negative, 1 otherwise.
Definition at line 168 of file BLI_math_basis_types.hh.
References is_negative().
|
friend |
Definition at line 25 of file math_basis_types.cc.
|
staticconstexpr |
Definition at line 117 of file BLI_math_basis_types.hh.
Referenced by blender::math::cross(), blender::math::invert(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::math::to_quaternion().
|
staticconstexpr |
Definition at line 114 of file BLI_math_basis_types.hh.
Referenced by blender::math::cross(), from_int(), blender::math::invert(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::math::to_quaternion().
|
staticconstexpr |
Definition at line 118 of file BLI_math_basis_types.hh.
Referenced by blender::math::cross(), blender::math::invert(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::math::to_quaternion().
|
staticconstexpr |
Definition at line 115 of file BLI_math_basis_types.hh.
Referenced by blender::math::cross(), blender::math::from_tracking(), blender::math::invert(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::math::to_quaternion().
|
staticconstexpr |
Definition at line 119 of file BLI_math_basis_types.hh.
Referenced by blender::math::cross(), from_int(), blender::math::invert(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::math::to_quaternion(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().
|
staticconstexpr |
Definition at line 116 of file BLI_math_basis_types.hh.
Referenced by blender::math::cross(), blender::math::from_tracking(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::get_axis_gizmo_matrix_basis(), blender::math::invert(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::math::to_quaternion(), and blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform().