ComputeSweepRadius() public method

Get the maximum radius about the parent body's center of mass.
public ComputeSweepRadius ( Vector2 pivot ) : float
pivot Vector2
return float
コード例 #1
0
ファイル: Contact.cs プロジェクト: rhy2020/box2d-unity
        public float ComputeTOI(Sweep sweepA, Sweep sweepB)
        {
            TOIInput input = new TOIInput();

            input.SweepA       = sweepA;
            input.SweepB       = sweepB;
            input.SweepRadiusA = _fixtureA.ComputeSweepRadius(sweepA.LocalCenter);
            input.SweepRadiusB = _fixtureB.ComputeSweepRadius(sweepB.LocalCenter);
            input.Tolerance    = Common.Settings.LinearSlop;

            return(Collision.Collision.TimeOfImpact(input, _fixtureA.Shape, _fixtureB.Shape));
        }