Blender V5.3
blender::xpbd Namespace Reference

Classes

struct  AlignRotationsConstraintResult
class  AngularDampingConstraintSet
class  CollisionEdgeConstraintSet
class  CollisionFaceConstraintSet
struct  ConstraintColoring
class  ConstraintSet
class  ConstraintSetParams
struct  DistanceConstraintResult
class  DistanceConstraintSet
class  FrictionEdgeConstraintSet
class  FrictionFaceConstraintSet
class  GaussSeidelUpdater
struct  GeometryRef
class  LinearDampingConstraintSet
class  PinPositionConstraintSet
class  PinRotationConstraintSet
struct  PlaneIntersection
class  RodBendAndTwistConstraintSet
struct  RodStretchAndShearConstraintResult
class  RodStretchAndShearConstraintSet
struct  SegmentClosestToRay
class  TemplatedConstraintSet
class  TemplatedVelocityConstraintSet
class  VelocityConstraintSet
class  VelocityUpdater

Functions

AlignRotationsConstraintResult evaluate_align_rotations_constraint (const math::Quaternion &r0, const math::Quaternion &r1, const float3 &inertia0, const float3 &inertia1, const math::Quaternion &rest_rotation, const float compliance_term, const float4 &lambda_prev)
ConstraintColoring color_constraints__unary (const Span< int > affected_points, LinearAllocator<> &memory)
ConstraintColoring color_constraints__binary (const Span< int2 > affected_points, LinearAllocator<> &memory)
ConstraintColoring color_constraints__n_ary (const GroupedSpan< int > affected_points, LinearAllocator<> &memory)
ConstraintColoring color_constraints__all_independent (const int constraints_num)
DistanceConstraintResult evaluate_distance_constraint (const float3 &p0, const float3 &p1, const float inv_m0, const float inv_m1, const float rest_distance, const float compliance_term, const float lambda_prev)
std::optional< PlaneIntersection > intersect_plane (const float3 &pos0, const float3 &pos1, const float3 &origin, const float3 &edge, const float3 &normal)
SegmentClosestToRay closest_on_segment_to_ray (const float3 &pos0, const float3 &pos1, const float3 &ray_pos, const float3 &ray_dir, const bool clamp)
RodStretchAndShearConstraintResult evaluate_rod_stretch_and_shear_constraint (const float3 &p0, const float3 &p1, const math::Quaternion &rot, const float inv_m0, const float inv_m1, const float3 &inertia, const float rest_length, const float compliance_term, const float3 &lambda_pos_prev, const float3 &lambda_rot_prev)
math::Quaternion apply_rotation_offset (math::Quaternion rotation, float4 offset)
template<typename PointID, typename GetConstraintPointIdsFn>
int color_constraints (GetConstraintPointIdsFn &&get_constraint_point_ids_fn, MutableSpan< int > r_colors)
template<typename PointID, typename GetConstraintPointIdsFn>
ConstraintColoring generic_constraint_coloring (GetConstraintPointIdsFn &&get_constraint_points_fn, const int constraints_num, LinearAllocator<> &memory)

Function Documentation

◆ apply_rotation_offset()

math::Quaternion blender::xpbd::apply_rotation_offset ( math::Quaternion rotation,
float4 offset )
inline

◆ closest_on_segment_to_ray()

SegmentClosestToRay blender::xpbd::closest_on_segment_to_ray ( const float3 & pos0,
const float3 & pos1,
const float3 & ray_pos,
const float3 & ray_dir,
const bool clamp )
inline

Find closest point of a segment to a ray.

Parameters
pos0First point of the line segment.
pos1Second point of the line segment.
ray_posOrigin of the ray.
ray_dirDirection of the ray.
Returns
Closest point on the segment or null if the closest point is outside the segment.

Definition at line 72 of file GEO_xpbd_constraint_math.hh.

References b, blender::BLI_assert(), blender::math::clamp(), clamp(), closest_on_segment_to_ray(), blender::math::dot(), blender::e, blender::math::is_unit(), blender::math::length_squared(), and blender::math::safe_divide().

Referenced by closest_on_segment_to_ray(), and blender::xpbd::CollisionEdgeConstraintSet::solve_single().

◆ color_constraints()

◆ color_constraints__all_independent()

◆ color_constraints__binary()

◆ color_constraints__n_ary()

ConstraintColoring blender::xpbd::color_constraints__n_ary ( const GroupedSpan< int > affected_points,
LinearAllocator<> & memory )

◆ color_constraints__unary()

◆ evaluate_align_rotations_constraint()

◆ evaluate_distance_constraint()

DistanceConstraintResult blender::xpbd::evaluate_distance_constraint ( const float3 & p0,
const float3 & p1,
const float inv_m0,
const float inv_m1,
const float rest_distance,
const float compliance_term,
const float lambda_prev )
inline

◆ evaluate_rod_stretch_and_shear_constraint()

RodStretchAndShearConstraintResult blender::xpbd::evaluate_rod_stretch_and_shear_constraint ( const float3 & p0,
const float3 & p1,
const math::Quaternion & rot,
const float inv_m0,
const float inv_m1,
const float3 & inertia,
const float rest_length,
const float compliance_term,
const float3 & lambda_pos_prev,
const float3 & lambda_rot_prev )
inline

◆ generic_constraint_coloring()

template<typename PointID, typename GetConstraintPointIdsFn>
ConstraintColoring blender::xpbd::generic_constraint_coloring ( GetConstraintPointIdsFn && get_constraint_points_fn,
const int constraints_num,
LinearAllocator<> & memory )
inline

◆ intersect_plane()

std::optional< PlaneIntersection > blender::xpbd::intersect_plane ( const float3 & pos0,
const float3 & pos1,
const float3 & origin,
const float3 & edge,
const float3 & normal )
inline

Test intersection of a line segment with a plane defined by two tangent vectors.

Parameters
pos0First point of the line segment.
pos1Second point of the line segment.
originPoint on the half-plane edge.
edgeEdge of the half-plane.
normalDirection away from the half-plane.
Returns
Intersection if the line segment intersects the plane.

Definition at line 29 of file GEO_xpbd_constraint_math.hh.

References blender::math::abs(), blender::BLI_assert(), blender::math::cross(), blender::math::dot(), blender::e, blender::math::interpolate(), intersect_plane(), blender::math::is_unit(), len(), and position.

Referenced by intersect_plane(), and blender::xpbd::CollisionEdgeConstraintSet::solve_single().