/// <summary> /// Create a new instance of SpringBoneInternalCollider with transform and collider. /// </summary> /// <param name="transform"></param> /// <param name="collider"></param> public SpringBoneInternalCollider(Transform transform, SpringBoneCollider collider) { colliderType = collider.colliderType; position = transform.TransformPoint(collider.offset); float scale = Mathf.Max( transform.lossyScale.x, Mathf.Max( transform.lossyScale.y, transform.lossyScale.z )); radius = scale * collider.radius; }
/// <summary> /// Create a new instance of SpringBoneCollider with colliderType and offset and radius. /// </summary> /// <param name="colliderType"></param> /// <param name="offset"></param> /// <param name="radius"></param> public SpringBoneCollider(SpringBoneColliderType colliderType, Vector3 offset = default, float radius = default) { this.colliderType = colliderType; this.offset = offset; this.radius = radius; }
/// <summary> /// Create a new instance of SpringBoneCollider with colliderType. /// </summary> /// <param name="colliderType"></param> public SpringBoneCollider(SpringBoneColliderType colliderType) { this.colliderType = colliderType; }