static void _DrawArrowGizmo(
Color color,
ref Vector3 position,
ref Vector3 direction,
ref Vector3 cameraForward,
BoneType boneType )
{
Vector3 nY = Vector3.Cross( cameraForward, direction );
if( SAFBIKVecNormalize( ref nY ) ) {
Gizmos.color = color;
float arrowGizmoLowerLength = _ArrowGizmoLowerLength;
float arrowGizmoLowerWidth = _ArrowGizmoLowerWidth;
float arrowGizmoMiddleLength = _ArrowGizmoMiddleLength;
float arrowGizmoMiddleWidth = _ArrowGizmoMiddleWidth;
float arrowGizmoUpperLength = _ArrowGizmoUpperLength;
float arrowGizmoThickness = _ArrowGizmoThickness;
float gizmoScale = 1.0f;
if( boneType == BoneType.HandFinger ) {
gizmoScale = _ArrowGizmoFingerScale;
}
if( boneType == BoneType.Eye ) {
gizmoScale = _ArrowGizmoEyeScale;
}
if( gizmoScale != 1.0f ) {
arrowGizmoLowerLength = _ArrowGizmoLowerLength * gizmoScale;
arrowGizmoLowerWidth = _ArrowGizmoLowerWidth * gizmoScale;
arrowGizmoMiddleLength = _ArrowGizmoMiddleLength * gizmoScale;
arrowGizmoMiddleWidth = _ArrowGizmoMiddleWidth * gizmoScale;
arrowGizmoUpperLength = _ArrowGizmoUpperLength * gizmoScale;
arrowGizmoThickness = _ArrowGizmoThickness * gizmoScale;
}
Vector3 posLower = position + direction * arrowGizmoLowerLength;
Vector3 posMiddle = position + direction * (arrowGizmoLowerLength + arrowGizmoMiddleLength);
Vector3 posUpper = position + direction * (arrowGizmoLowerLength + arrowGizmoMiddleLength + arrowGizmoUpperLength);
Vector3 lowerY = nY * arrowGizmoLowerWidth;
Vector3 middleY = nY * arrowGizmoMiddleWidth;
Vector3 thicknessY = nY * arrowGizmoThickness;
for( int i = 0; i < _ArrowGizmoDrawCycles; ++i ) {
Gizmos.DrawLine( position, posLower + lowerY );
Gizmos.DrawLine( position, posLower - lowerY );
Gizmos.DrawLine( posLower + lowerY, posMiddle + middleY );
Gizmos.DrawLine( posLower - lowerY, posMiddle - middleY );
Gizmos.DrawLine( posMiddle + middleY, posUpper );
Gizmos.DrawLine( posMiddle - middleY, posUpper );
lowerY -= thicknessY;
middleY -= thicknessY;
}
}
}