common/animation/blending_job.cc
// Blends bind pose to the output if accumulated weight is less than the
// threshold value.

Blends bind pose to the output if accumulated weight is less than the
threshold value.
Blends bind pose to the output if accumulated weight is less than the threshold value .
void BlendBindPose(ProcessArgs* _args)
			{
				assert(_args);
				assert(_args->job.bind_pose.end >=
					_args->job.bind_pose.begin + _args->num_soa_joints);
				if (_args->num_partial_passes == 0)
				{
					const float bp_weight = _args->job.threshold - _args->accumulated_weight;
					if (bp_weight > 0.f)
					{  
						if (_args->num_passes == 0)
						{
							_args->accumulated_weight = 1.f;
							for (size_t i = 0; i < _args->num_soa_joints; ++i)
							{
								_args->job.output.begin[i] = _args->job.bind_pose.begin[i];
							}
						}
						else
						{
							_args->accumulated_weight = _args->job.threshold;
							const math::SimdFloat4 simd_bp_weight =
								math::simd_float4::Load1(bp_weight);
							for (size_t i = 0; i < _args->num_soa_joints; ++i)
							{
								const math::SoaTransform& src = _args->job.bind_pose.begin[i];
								math::SoaTransform* dest = _args->job.output.begin + i;
								BLEND_N_PASS(src, simd_bp_weight, dest);
							}
						}
					}
				}
				else
				{
					const math::SimdFloat4 threshold =
						math::simd_float4::Load1(_args->job.threshold);
					assert(_args->num_passes != 0);
					for (size_t i = 0; i < _args->num_soa_joints; ++i)
					{
						const math::SoaTransform& src = _args->job.bind_pose.begin[i];
						math::SoaTransform* dest = _args->job.output.begin + i;
						const math::SimdFloat4 bp_weight =
							math::Max0(threshold - _args->accumulated_weights[i]);
						_args->accumulated_weights[i] =
							math::Max(threshold, _args->accumulated_weights[i]);
						BLEND_N_PASS(src, bp_weight, dest);
					}
				}
			}
void BlendBindPose ( ProcessArgs * _args ) { assert ( _args ) ; assert ( _args -> job . bind_pose . end >= _args -> job . bind_pose . begin + _args -> num_soa_joints ) ; if ( _args -> num_partial_passes == 0 ) { const float bp_weight = _args -> job . threshold - _args -> accumulated_weight ; if ( bp_weight > 0.f ) { if ( _args -> num_passes == 0 ) { _args -> accumulated_weight = 1.f ; for ( size_t i = 0 ; i < _args -> num_soa_joints ; ++ i ) { _args -> job . output . begin [ i ] = _args -> job . bind_pose . begin [ i ] ; } } else { _args -> accumulated_weight = _args -> job . threshold ; const math :: SimdFloat4 simd_bp_weight = math :: simd_float4 :: Load1 ( bp_weight ) ; for ( size_t i = 0 ; i < _args -> num_soa_joints ; ++ i ) { const math :: SoaTransform & src = _args -> job . bind_pose . begin [ i ] ; math :: SoaTransform * dest = _args -> job . output . begin + i ; BLEND_N_PASS ( src , simd_bp_weight , dest ) ; } } } } else { const math :: SimdFloat4 threshold = math :: simd_float4 :: Load1 ( _args -> job . threshold ) ; assert ( _args -> num_passes != 0 ) ; for ( size_t i = 0 ; i < _args -> num_soa_joints ; ++ i ) { const math :: SoaTransform & src = _args -> job . bind_pose . begin [ i ] ; math :: SoaTransform * dest = _args -> job . output . begin + i ; const math :: SimdFloat4 bp_weight = math :: Max0 ( threshold - _args -> accumulated_weights [ i ] ) ; _args -> accumulated_weights [ i ] = math :: Max ( threshold , _args -> accumulated_weights [ i ] ) ; BLEND_N_PASS ( src , bp_weight , dest ) ; } } }
Blends bind pose to the output if accumulated weight is less than the
threshold value.
Blends bind pose to the output if accumulated weight is less than the threshold value .
// Asserts buffer sizes, which must never fail as it has been validated.
 // No partial blending pass detected, threshold can be tested globally.
 // The bind-pose is needed if it has a weight.
 // Strictly copying bind-pose.
 // Updates global accumulated weight, but not per-joint weight any more
 // because normalization stage will be global also.
 // Blending passes contain partial blending, threshold must be tested for
 // each joint.
 // There's been at least 1 pass as num_partial_passes != 0.
