public void SyncDisplacement()
{
if( _parentBone != null && _parentBone.transformIsAlive && transformIsAlive ) {
Vector3 translate = this.worldPosition - _parentBone.worldPosition;
_defaultLocalLength = FastLength.FromVector3( ref translate );
if( _parentBone.transform == this.transform.parent ) {
Vector3 localPosition = this.transform.localPosition;
if( SAFBIKVecNormalize( ref localPosition ) ) {
Vector3 tempDirection;
SAFBIKMatMultVec( out tempDirection, ref _parentBone._defaultBasis, ref localPosition );
_defaultLocalDirection = tempDirection;
_defaultLocalTranslate = tempDirection * _defaultLocalLength.length;
} else {
_defaultLocalDirection = Vector3.zero;
_defaultLocalTranslate = Vector3.zero;
}
} else {
_defaultLocalTranslate = _defaultLocalDirection * _defaultLocalLength.length;
}
}
}