17 b.add_input<
decl::Vector>(
"Axis").default_value({0.0f, 0.0f, 1.0f});
24 static auto fn = mf::build::SI2_SO<float3, float, math::Quaternion>(
25 "Axis Angle to Quaternion", [](
float3 axis,
float angle) {
39 RotationElem rotation_elem;
43 rotation_elem.euler = VectorElem::all();
51 const RotationElem rotation_elem = params.
get_output_elem<RotationElem>(
"Rotation");
52 VectorElem axis_elem = rotation_elem.axis;
53 FloatElem angle_elem = rotation_elem.angle;
63 params.
set_input(
"Axis", axis_angle.axis());
64 params.
set_input(
"Angle", axis_angle.angle().radian());
71 ntype.
ui_name =
"Axis Angle to Rotation";
#define NODE_CLASS_CONVERTER
#define FN_NODE_AXIS_ANGLE_TO_ROTATION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void set_matching_fn(const mf::MultiFunction *fn)
void set_input(const StringRef identifier, T value)
T get_output(const StringRef identifier) const
void set_output_elem(const StringRef identifier, T elem)
T get_input_elem(const StringRef identifier) const
T get_output_elem(const StringRef identifier) const
void set_input_elem(const StringRef identifier, T elem)
void node_register_type(bNodeType &ntype)
QuaternionBase< float > Quaternion
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
AxisAngleBase< float, AngleRadianBase< float > > AxisAngle
AxisAngleBase< T, AngleT > to_axis_angle(const EulerXYZBase< T > &euler)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
static void node_declare(NodeDeclarationBuilder &b)
static void node_eval_elem(value_elem::ElemEvalParams ¶ms)
static void node_eval_inverse_elem(value_elem::InverseElemEvalParams ¶ms)
static void node_eval_inverse(inverse_eval::InverseEvalParams ¶ms)
static void node_register()
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
VecBase< float, 3 > float3
void fn_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
NodeInverseElemEvalFunction eval_inverse_elem
NodeInverseEvalFunction eval_inverse
NodeElemEvalFunction eval_elem
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
NodeDeclareFunction declare
static QuaternionBase identity()