Blender V4.3
math_float2.h File Reference

Go to the source code of this file.

Functions

CCL_NAMESPACE_BEGIN ccl_device_inline float2 zero_float2 ()
 
ccl_device_inline float2 one_float2 ()
 
ccl_device_inline float2 operator- (const float2 &a)
 
ccl_device_inline float2 operator* (const float2 a, const float2 b)
 
ccl_device_inline float2 operator* (const float2 a, float f)
 
ccl_device_inline float2 operator* (float f, const float2 a)
 
ccl_device_inline float2 operator/ (float f, const float2 a)
 
ccl_device_inline float2 operator/ (const float2 a, float f)
 
ccl_device_inline float2 operator/ (const float2 a, const float2 b)
 
ccl_device_inline float2 operator+ (const float2 a, const float2 b)
 
ccl_device_inline float2 operator+ (const float2 a, const float f)
 
ccl_device_inline float2 operator- (const float2 a, const float2 b)
 
ccl_device_inline float2 operator- (const float2 a, const float f)
 
ccl_device_inline float2 operator+= (float2 &a, const float2 b)
 
ccl_device_inline float2 operator*= (float2 &a, const float2 b)
 
ccl_device_inline float2 operator*= (float2 &a, float f)
 
ccl_device_inline float2 operator/= (float2 &a, const float2 b)
 
ccl_device_inline float2 operator/= (float2 &a, float f)
 
ccl_device_inline bool operator== (const float2 a, const float2 b)
 
ccl_device_inline bool operator!= (const float2 a, const float2 b)
 
ccl_device_inline bool is_zero (const float2 a)
 
ccl_device_inline float dot (const float2 a, const float2 b)
 
ccl_device_inline float average (const float2 a)
 
ccl_device_inline bool isequal (const float2 a, const float2 b)
 
ccl_device_inline float len (const float2 a)
 
ccl_device_inline float reduce_min (const float2 a)
 
ccl_device_inline float reduce_max (const float2 a)
 
ccl_device_inline float reduce_add (const float2 a)
 
ccl_device_inline float len_squared (const float2 a)
 
ccl_device_inline float2 safe_normalize (const float2 a)
 
ccl_device_inline float distance (const float2 a, const float2 b)
 
ccl_device_inline float cross (const float2 a, const float2 b)
 
ccl_device_inline float2 normalize (const float2 a)
 
ccl_device_inline float2 normalize_len (const float2 a, ccl_private float *t)
 
ccl_device_inline float2 min (const float2 a, const float2 b)
 
ccl_device_inline float2 max (const float2 a, const float2 b)
 
ccl_device_inline float2 clamp (const float2 a, const float2 mn, const float2 mx)
 
ccl_device_inline float2 fmod (const float2 a, const float b)
 
ccl_device_inline float2 fabs (const float2 a)
 
ccl_device_inline float2 as_float2 (const float4 &a)
 
ccl_device_inline float2 interp (const float2 a, const float2 b, float t)
 
ccl_device_inline float2 mix (const float2 a, const float2 b, float t)
 
ccl_device_inline float2 floor (const float2 a)
 
ccl_device_inline float2 power (float2 v, float e)
 
ccl_device_inline float2 safe_divide_float2_float (const float2 a, const float b)
 

Function Documentation

◆ as_float2()

ccl_device_inline float2 as_float2 ( const float4 & a)

Definition at line 220 of file math_float2.h.

References make_float2().

◆ average()

ccl_device_inline float average ( const float2 a)

◆ clamp()

ccl_device_inline float2 clamp ( const float2 a,
const float2 mn,
const float2 mx )

Definition at line 205 of file math_float2.h.

References max, and min.

◆ cross()

ccl_device_inline float cross ( const float2 a,
const float2 b )

Definition at line 179 of file math_float2.h.

References b.

Referenced by __anyhit__kernel_optix_local_hit(), angle_signed_on_axis_normalized_v3v3_v3(), Hair::apply_transform(), PointCloud::apply_transform(), area_light_rect_sample(), bevel_list_smooth(), BKE_gpencil_stroke_2d_flat(), BM_edge_is_convex(), BM_edgeloop_calc_normal_aligned(), BM_face_calc_area_uv_signed(), bm_face_split_by_concave(), bm_mesh_calc_volume_face(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_hair_reflection_sample(), bsdf_hair_transmission_sample(), bt_edge_plane(), btPrimitiveTriangle::buildTriPlane(), btTriangleShapeEx::buildTriPlane(), calcNormal(), camera_sample_panorama(), blender::compositor::check_corners(), SphereTriangleDetector::collide(), compute_emitter_centroid_and_dir(), compute_face_normal(), Mesh::Triangle::compute_normal(), computeAccelerationsArticulatedBodyAlgorithmMultiDof(), btRigidBody::computeImpulseDenominator(), continuousCollisionDetection(), cross_poly_v2(), ED_view3d_depth_read_cached_normal(), edbm_dupli_extrude_cursor_invoke(), edge_edge_angle_less_than_180(), edges_angle_kind(), BicubicPatch::eval(), fillConstraintJacobianMultiDof(), fillMultiBodyConstraint(), blender::bke::greasepencil::convert::get_legacy_layer_to_stroke_matrix(), blender::get_legacy_stroke_matrix(), blender::bke::greasepencil::get_local_to_stroke_matrix(), getJs(), getVelocityInLocalPointNoDelta(), getVelocityInLocalPointObsolete(), initialize2(), internalGetVelocityInLocalPointObsolete(), MyInternalTriangleIndexCallback::internalProcessTriangleIndex(), is_edge_convex_v3(), is_poly_convex_v2(), LightTreeEmitter::LightTreeEmitter(), lineIntersectsTriangle(), make_orthonormals(), make_orthonormals_safe_tangent(), make_orthonormals_tangent(), make_transform_frame(), mean_value_half_tan_v3(), microfacet_ggx_sample_vndf(), modify_mesh(), motion_triangle_shader_setup(), Mesh::SubdFace::normal(), osl_area(), osl_calculatenormal(), btDeformableMultiBodyDynamicsWorld::performGeometricCollisions(), pointOutsideOfPlane(), primitive_tangent(), btConnectivityProcessor::processTriangle(), btSoftBodyTriangleCallback::processTriangle(), DebugDrawcallback::processTriangle(), blender::eevee::IrradianceBake::raylists_build(), setupContactConstraint(), setupFrictionConstraint(), setupMultiBodyContactConstraint(), setupSpherical(), slide_check_corners(), sortCachedPoints(), spherical_stereo_transform(), svm_node_normal_map(), svm_node_set_bump(), svm_node_tangent(), svm_node_vector_displacement(), svm_vector_math(), tan_angle(), transform_inverse_cross(), transform_inverse_impl(), transform_negative_scale(), triangle_area(), triangle_light_pdf(), triangle_light_sample(), triangle_normal(), triangle_point_normal(), and wireframe().

◆ distance()

ccl_device_inline float distance ( const float2 a,
const float2 b )

Definition at line 174 of file math_float2.h.

References b, and len.

◆ dot()

ccl_device_inline float dot ( const float2 a,
const float2 b )

Definition at line 122 of file math_float2.h.

References b, and float2::x.

Referenced by len(), and len_squared().

◆ fabs()

ccl_device_inline float2 fabs ( const float2 a)

Definition at line 215 of file math_float2.h.

References fabsf, and make_float2().

Referenced by iTaSC::Cache::addCacheVectorIfDifferent(), adjustSwingAxisToUseEllipseNormal(), Freestyle::angle_from_cotan(), IK_QJacobian::AngleUpdateNorm(), area_split_factor(), background_cdf(), bake_offset_towards_center(), blend_offset_fcurve_segment(), blend_to_neighbor_fcurve_segment(), BLI_str_format_byte_unit(), BM_mesh_calc_volume(), bmo_extrude_face_region_exec(), Freestyle::ViewMapBuilder::BuildGrid(), blender::bke::curves::poly::calculate_normals_minimum(), BCAnimationCurve::closest_index_above(), cloth_calc_force(), collision_compute_barycentric(), blender::ed::sculpt_paint::color::color_filter_task(), colorfn(), Object::compute_volume_step_size(), computeConeLimitInfo(), Freestyle::FEdgeXDetector::computeCurvatures(), Freestyle::ViewMapBuilder::ComputeRayCastingVisibility(), Freestyle::Strip::computeTexCoordWithTips(), Freestyle::computeVisibility(), Freestyle::SteerableViewMap::ComputeWeight(), Freestyle::Strip::createStrip(), createTransActionData(), Freestyle::CurveInternal::__point_iterator< Traits >::decrement(), Freestyle::CurveInternal::CurvePointIterator::decrement(), DistanceBetweenLines(), double_round(), ElementResize(), Freestyle::OGF::NormalCycle::end(), Shader::estimate_emission(), libmv::euclidean_resection::EuclideanResectionAnsarDaniilidis(), Freestyle::firstIntersectionGridVisitor::examineOccluder(), blender::meshintersect::FatCo< double >::FatCo(), film_clamp_light(), find_superellipse_chord_endpoint(), Freestyle::ViewMapBuilder::FindOccludee(), Freestyle::findOccludee(), fresnel_dielectric_cos(), FuzzyZero(), blender::io::alembic::get_sample_interpolation_settings(), blender::meshintersect::get_vertex_by_coord(), KDL::Rotation::GetEulerZYZ(), GHOST_Wintab::getInput(), iTaSC::Armature::getMaxJointChange(), GHOST_WindowWin32::getPointerInfo(), GetPointForAngle(), KDL::Rotation::GetRPY(), gizmo_ruler_draw(), graph_key_shortest_dist(), grid_axis_start_and_count(), Freestyle::gts_vertex_principal_directions(), halton_ex(), Freestyle::SilhouetteGeomEngine::ImageToWorldParameter(), BCMatrix::in_range(), init_scene(), integer_digits_d(), integer_digits_f(), Freestyle::GeomUtils::intersect2dLine2dLine(), Freestyle::GeomUtils::intersect2dSeg2dSeg(), Freestyle::GeomUtils::intersect2dSeg2dSegParametric(), Freestyle::GeomUtils::intersect2dSegPoly(), Freestyle::GeomUtils::intersectRayPlane(), BCAnimationCurve::is_animated(), isect_seg_seg_v2_lambda_mu_db(), keyframe_time_differs(), Freestyle::LanczosWindowed(), btLemkeAlgorithm::LexicographicPositive(), light_sample_terminate(), light_tree_node_importance(), LightTreeEmitter::LightTreeEmitter(), lineart_chain_create_crossing_point(), lineart_create_edges_from_isec_data(), lineart_intersect_seg_seg(), lineart_line_isec_2d_ignore_line2pos(), lineart_shadow_cast_onto_triangle(), lineart_triangle_2v_intersection_math(), lineart_triangle_edge_image_space_occlusion(), mat3_normalized_to_quat_fast(), match_slope_fcurve_segment(), blender::meshintersect::math_abs(), blender::meshintersect::math_abs< double >(), KDL::Norm(), KDL::Vector2::Norm(), KDL::Vector::Norm(), Freestyle::notValid(), GHOST_DirectManipulationViewportEventHandler::OnContentUpdated(), Freestyle::less_SVertex2D::operator()(), Freestyle::GeomUtils::overlapTriangleBox(), blender::ed::sculpt_paint::paint_stroke_integrate_overlap(), path_state_continuation_probability(), pose_slide_apply_quat(), pose_slide_apply_val(), Freestyle::FEdgeXDetector::ProcessRidgeFace(), Freestyle::FEdgeXDetector::ProcessSuggestiveContourFace(), KDL::PYTHAG(), quadric_to_tensor_m3_inverse(), quat_to_mat4(), Freestyle::AppView::rabs(), recalcData_sequencer_image(), resolve_quad_uv_v2_deriv(), retiming_fake_key_frame_clicked(), safe_noise(), safe_noise(), safe_noise(), safe_noise(), safe_snoise(), safe_snoise(), safe_snoise(), safe_snoise(), scrollbar_start_scrolling(), Freestyle::OGF::MatrixUtil::semi_definite_symmetric_eigen(), SEQ_sound_equalizermodifier_recreator(), setMotorTargetInConstraintSpace(), Freestyle::CalligraphicShader::shade(), Freestyle::StrokeShaders::BezierCurveShader::shade(), KDL::SIGN(), sinc(), iTaSC::WDLSSolver::solve(), iTaSC::WSDLSSolver::solve(), libmv::SolveCubicPolynomial(), SolveP3(), SolveP4De(), SolveP5_1(), SphericalRangeParameters(), KDL::svd_eigen_HH(), svm_mix_diff(), svm_vector_math(), libmv::TrkltRegionTracker::Track(), blender::nodes::try_dispatch_float_math_fl_to_fl(), UI_calc_float_precision(), ui_draw_colorband_handle(), blender::compositor::MathAbsoluteOperation::update_memory_buffer_partial(), volume_sample_channel(), voronoi_distance(), and widgetbase_set_uniform_alpha_check().

◆ floor()

ccl_device_inline float2 floor ( const float2 a)

Definition at line 235 of file math_float2.h.

References floorf, and make_float2().

Referenced by blender::bke::pbvh::uv_islands::add_uv_island(), blender::animrig::bake_fcurve_segments(), BKE_fcurve_deduplicate_keys(), BKE_lattice_deform_data_eval_co(), BKE_ptcache_read(), BLI_cellNoiseU(), BLI_noise_cell_v3(), BLI_noise_voronoi(), boxsampleclip(), colorfn(), colorfn(), compute_2d_gabor_noise(), compute_3d_gabor_noise(), Freestyle::GaussianFilter::computeMaskSize(), Freestyle::Grid::configure(), cp_key(), displayed_channel_range_get(), do_2d_mapping(), blender::bke::pbvh::pixels::do_encode_pixels(), do_key(), draw_seq_fcurve_overlay(), fcm_cycles_time(), fract(), blender::compositor::RotateOperation::get_area_rotation_bounds(), BCMatrix::get_matrix(), BCMatrix::get_matrix(), blender::nodes::node_fn_float_to_int_cc::get_multi_function(), gpencil_frame_snap_nearest(), gridRaycast(), hsv_to_rgb(), imagewrap(), imagewraposa(), init_mv_jit(), Freestyle::Grid::initInfiniteRay(), Freestyle::Grid::initRay(), integer_digits_d(), integer_digits_f(), newPerlin(), blender::nodes::node_fn_random_value_cc::node_build_multi_function(), old_mdisps_bilinear(), KDL::Jacobian::operator()(), KDL::Jacobian::operator()(), orgBlenderNoise(), blender::ed::outliner::outliner_back(), blender::gpu::FrameBuffer::recursive_downsample(), libmv::RegionIsInBounds(), Freestyle::Stroke::Resample(), safe_floored_modulo(), Freestyle::StrokeShaders::BezierCurveShader::shade(), snap(), snap_mask_layer_nearest(), snapFrameTransform(), soft_range_round_down(), speed_effect_interpolation_ratio_get(), surfaceGenerateGrid(), svm_vector_math(), textview_draw_string(), blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl3(), blender::nodes::try_dispatch_float_math_fl3_to_fl3(), ui_but_hide_fraction(), ui_but_string_set(), ui_draw_aligned_panel(), UI_fontstyle_draw_ex(), UI_GetColorPtrBlendShade3ubv(), uilist_prepare(), unit_dual_convert(), iTaSC::Scene::update(), blender::compositor::MathFloorOperation::update_memory_buffer_partial(), blender::compositor::MathFractOperation::update_memory_buffer_partial(), blender::compositor::MathTruncOperation::update_memory_buffer_partial(), blender::compositor::PosterizeOperation::update_memory_buffer_partial(), valuefn(), voronoi_distance_to_edge(), voronoi_distance_to_edge(), voronoi_distance_to_edge(), voronoi_distance_to_edge(), voronoi_distance_to_edge(), voronoi_distance_to_edge(), voronoi_distance_to_edge(), voronoi_f1(), voronoi_f1(), voronoi_f1(), voronoi_f1(), voronoi_f1(), voronoi_f1(), voronoi_f1(), voronoi_f2(), voronoi_f2(), voronoi_f2(), voronoi_f2(), voronoi_f2(), voronoi_f2(), voronoi_f2(), voronoi_n_sphere_radius(), voronoi_n_sphere_radius(), voronoi_n_sphere_radius(), voronoi_n_sphere_radius(), voronoi_n_sphere_radius(), voronoi_n_sphere_radius(), voronoi_n_sphere_radius(), voronoi_smooth_f1(), voronoi_smooth_f1(), voronoi_smooth_f1(), voronoi_smooth_f1(), voronoi_smooth_f1(), voronoi_smooth_f1(), voronoi_smooth_f1(), WM_gesture_circle_modal(), wrap(), zbuf_add_to_span(), and zspan_scanconvert().

◆ fmod()

◆ interp()

ccl_device_inline float2 interp ( const float2 a,
const float2 b,
float t )

◆ is_zero()

◆ isequal()

◆ len()

ccl_device_inline float len ( const float2 a)

Definition at line 142 of file math_float2.h.

References dot(), and sqrtf.

◆ len_squared()

◆ max()

ccl_device_inline float2 max ( const float2 a,
const float2 b )

Definition at line 200 of file math_float2.h.

References b, make_float2(), and max.

◆ min()

ccl_device_inline float2 min ( const float2 a,
const float2 b )

Definition at line 195 of file math_float2.h.

References b, make_float2(), and min.

◆ mix()

ccl_device_inline float2 mix ( const float2 a,
const float2 b,
float t )

Definition at line 230 of file math_float2.h.

References b.

◆ normalize()

ccl_device_inline float2 normalize ( const float2 a)

Definition at line 184 of file math_float2.h.

References len.

◆ normalize_len()

◆ one_float2()

◆ operator!=()

ccl_device_inline bool operator!= ( const float2 a,
const float2 b )

Definition at line 112 of file math_float2.h.

References b.

Referenced by ccl_try_align().

◆ operator*() [1/3]

ccl_device_inline float2 operator* ( const float2 a,
const float2 b )

Definition at line 30 of file math_float2.h.

References b, and make_float2().

◆ operator*() [2/3]

ccl_device_inline float2 operator* ( const float2 a,
float f )

Definition at line 35 of file math_float2.h.

References make_float2().

◆ operator*() [3/3]

ccl_device_inline float2 operator* ( float f,
const float2 a )

Definition at line 40 of file math_float2.h.

References make_float2().

◆ operator*=() [1/2]

ccl_device_inline float2 operator*= ( float2 & a,
const float2 b )

Definition at line 86 of file math_float2.h.

References b.

◆ operator*=() [2/2]

ccl_device_inline float2 operator*= ( float2 & a,
float f )

Definition at line 91 of file math_float2.h.

◆ operator+() [1/2]

ccl_device_inline float2 operator+ ( const float2 a,
const float f )

Definition at line 66 of file math_float2.h.

References make_float2().

◆ operator+() [2/2]

ccl_device_inline float2 operator+ ( const float2 a,
const float2 b )

Definition at line 61 of file math_float2.h.

References b, and make_float2().

◆ operator+=()

ccl_device_inline float2 operator+= ( float2 & a,
const float2 b )

Definition at line 81 of file math_float2.h.

References b.

◆ operator-() [1/3]

ccl_device_inline float2 operator- ( const float2 & a)

Definition at line 25 of file math_float2.h.

References make_float2().

◆ operator-() [2/3]

ccl_device_inline float2 operator- ( const float2 a,
const float f )

Definition at line 76 of file math_float2.h.

References make_float2().

◆ operator-() [3/3]

ccl_device_inline float2 operator- ( const float2 a,
const float2 b )

Definition at line 71 of file math_float2.h.

References b, and make_float2().

◆ operator/() [1/3]

ccl_device_inline float2 operator/ ( const float2 a,
const float2 b )

Definition at line 56 of file math_float2.h.

References b, and make_float2().

◆ operator/() [2/3]

ccl_device_inline float2 operator/ ( const float2 a,
float f )

Definition at line 50 of file math_float2.h.

References make_float2().

◆ operator/() [3/3]

ccl_device_inline float2 operator/ ( float f,
const float2 a )

Definition at line 45 of file math_float2.h.

References make_float2().

◆ operator/=() [1/2]

ccl_device_inline float2 operator/= ( float2 & a,
const float2 b )

Definition at line 96 of file math_float2.h.

References b.

◆ operator/=() [2/2]

ccl_device_inline float2 operator/= ( float2 & a,
float f )

Definition at line 101 of file math_float2.h.

◆ operator==()

ccl_device_inline bool operator== ( const float2 a,
const float2 b )

Definition at line 107 of file math_float2.h.

References b.

◆ power()

◆ reduce_add()

◆ reduce_max()

◆ reduce_min()

ccl_device_inline float reduce_min ( const float2 a)

Definition at line 147 of file math_float2.h.

References min.

Referenced by area_light_rect_sample(), Object::compute_volume_step_size(), and ray_aabb_intersect().

◆ safe_divide_float2_float()

ccl_device_inline float2 safe_divide_float2_float ( const float2 a,
const float b )

Definition at line 248 of file math_float2.h.

References b, and zero_float2().

◆ safe_normalize()

◆ zero_float2()