mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-17 10:36:18 -05:00
18 lines
509 B
C#
18 lines
509 B
C#
using UnityEngine;
|
|
|
|
namespace VRM.SpringBone
|
|
{
|
|
struct SphereCollider
|
|
{
|
|
public readonly Vector3 Position;
|
|
public readonly float Radius;
|
|
|
|
public SphereCollider(Transform transform, VRMSpringBoneColliderGroup.SphereCollider collider)
|
|
{
|
|
Position = transform.TransformPoint(collider.Offset);
|
|
var ls = transform.lossyScale;
|
|
var scale = Mathf.Max(Mathf.Max(ls.x, ls.y), ls.z);
|
|
Radius = scale * collider.Radius;
|
|
}
|
|
}
|
|
} |