public static AscensionHitboxBodySnapshot Create(AscensionHitboxBody body)
        {
            AscensionHitboxBodySnapshot sn = Pool.Acquire();

            sn.Snapshot(body);
            return(sn);
        }
        public void Dispose()
        {
            body  = null;
            count = 0;
            wtl   = Matrix4x4.identity;
            ltw   = Matrix4x4.identity;

            Array.Clear(hbwtl, 0, hbwtl.Length);
            Array.Clear(hbltw, 0, hbltw.Length);

            Pool.Release(this);
        }
        public void Snapshot(AscensionHitboxBody body)
        {
            this.body = body;
            count     = Mathf.Min(body.hitboxes.Length, hbwtl.Length);

            if (body.proximity)
            {
                wtl = body.proximity.transform.worldToLocalMatrix;
                ltw = body.proximity.transform.localToWorldMatrix;
            }

            for (int i = 0; i < count; ++i)
            {
                hbwtl[i] = body.hitboxes[i].transform.worldToLocalMatrix;
                hbltw[i] = body.hitboxes[i].transform.localToWorldMatrix;
            }
        }
Ejemplo n.º 4
0
 internal void Snapshot(AscensionHitboxBody body)
 {
     bodySnapshots.AddLast(AscensionHitboxBodySnapshot.Create(body));
 }
Ejemplo n.º 5
0
 internal static void UnregisterBody(AscensionHitboxBody body)
 {
     HitboxBodies.Remove(body);
 }
Ejemplo n.º 6
0
 internal static void RegisterBody(AscensionHitboxBody body)
 {
     HitboxBodies.AddLast(body);
 }
Ejemplo n.º 7
0
 internal void AddHit(AscensionHitboxBody body, AscensionHitbox hitbox, float distance)
 {
     hits.Add(new AscensionPhysicsHit {
         body = body, hitbox = hitbox, distance = distance
     });
 }