public override void Process(Action _action, Track _track)
 {
     this.actor = _action.GetActorHandle(this.targetId);
     if (this.actor == 0)
     {
         if (ActionManager.Instance.isPrintLog)
         {
         }
     }
     else
     {
         ActorRoot handle = this.actor.handle;
         if (this.type == ColliderType.Box)
         {
             VCollisionBox collisionShape = GetCollisionShape <VCollisionBox>(handle, CollisionShapeType.Box);
             collisionShape.Pos   = this.Pos;
             collisionShape.Size  = this.Size;
             collisionShape.dirty = true;
             collisionShape.ConditionalUpdateShape();
         }
         else if (this.type == ColliderType.Sphere)
         {
             VCollisionSphere sphere = GetCollisionShape <VCollisionSphere>(handle, CollisionShapeType.Sphere);
             sphere.Pos    = this.Pos;
             sphere.Radius = this.Radius;
             sphere.dirty  = true;
             sphere.ConditionalUpdateShape();
         }
     }
 }
        public override void Process(Action _action, Track _track)
        {
            this.actor = _action.GetActorHandle(this.targetId);
            if (!this.actor)
            {
                if (ActionManager.Instance.isPrintLog)
                {
                }
                return;
            }
            ActorRoot                 handle         = this.actor.get_handle();
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            PoolObjHandle <ActorRoot> originator     = refParamObject.Originator;
            int num = 0;

            if (originator && refParamObject != null)
            {
                SkillComponent skillControl = originator.get_handle().SkillControl;
                SkillSlot      skillSlot;
                if (skillControl.TryGetSkillSlot(refParamObject.SlotType, out skillSlot) && skillSlot != null)
                {
                    num = skillSlot.GetSkillLevel() - 1;
                }
            }
            if (num < 0)
            {
                num = 0;
            }
            if (this.type == SetCollisionTick.ColliderType.Box)
            {
                VCollisionBox collisionShape = SetCollisionTick.GetCollisionShape <VCollisionBox>(handle, CollisionShapeType.Box);
                collisionShape.Pos   = this.Pos;
                collisionShape.Size  = new VInt3(this.Size.x + this.SizeGrowthValue.x * num, this.Size.y + this.SizeGrowthValue.y * num, this.Size.z + this.SizeGrowthValue.z * num);
                collisionShape.dirty = true;
                collisionShape.ConditionalUpdateShape();
            }
            else if (this.type == SetCollisionTick.ColliderType.Sphere)
            {
                VCollisionSphere collisionShape2 = SetCollisionTick.GetCollisionShape <VCollisionSphere>(handle, CollisionShapeType.Sphere);
                collisionShape2.Pos    = this.Pos;
                collisionShape2.Radius = this.Radius + this.RadiusGrowthValue * num;
                collisionShape2.dirty  = true;
                collisionShape2.ConditionalUpdateShape();
            }
            else if (this.type == SetCollisionTick.ColliderType.CylinderSector)
            {
                VCollisionCylinderSector collisionShape3 = SetCollisionTick.GetCollisionShape <VCollisionCylinderSector>(handle, CollisionShapeType.CylinderSector);
                collisionShape3.Pos      = this.Pos;
                collisionShape3.Radius   = this.SectorRadius;
                collisionShape3.Height   = this.Height;
                collisionShape3.Degree   = this.Degree;
                collisionShape3.Rotation = this.Rotation;
                collisionShape3.dirty    = true;
                collisionShape3.ConditionalUpdateShape();
            }
        }
    public bool IntersectsOBB(VCollisionBox b)
    {
        base.ConditionalUpdateShape();
        b.ConditionalUpdateShape();
        long num = (long)(this.worldRadius + b.worldRadius);

        if ((this.worldPos - b.worldPos).sqrMagnitudeLong > num * num)
        {
            return(false);
        }
        VInt3 vInt  = new VInt3(IntMath.Divide(VInt3.Dot(ref this.axis[0], ref b.axis[0]), 1000), IntMath.Divide(VInt3.Dot(ref this.axis[0], ref b.axis[1]), 1000), IntMath.Divide(VInt3.Dot(ref this.axis[0], ref b.axis[2]), 1000));
        VInt3 vInt2 = new VInt3(IntMath.Divide(VInt3.Dot(ref this.axis[1], ref b.axis[0]), 1000), IntMath.Divide(VInt3.Dot(ref this.axis[1], ref b.axis[1]), 1000), IntMath.Divide(VInt3.Dot(ref this.axis[1], ref b.axis[2]), 1000));
        VInt3 vInt3 = new VInt3(IntMath.Divide(VInt3.Dot(ref this.axis[2], ref b.axis[0]), 1000), IntMath.Divide(VInt3.Dot(ref this.axis[2], ref b.axis[1]), 1000), IntMath.Divide(VInt3.Dot(ref this.axis[2], ref b.axis[2]), 1000));
        VInt3 abs   = vInt.abs;
        VInt3 abs2  = vInt2.abs;
        VInt3 abs3  = vInt3.abs;
        VInt3 vInt4 = b.worldPos - this.worldPos;

        vInt4 = new VInt3(IntMath.Divide(VInt3.Dot(ref vInt4, ref this.axis[0]), 1000), IntMath.Divide(VInt3.Dot(ref vInt4, ref this.axis[1]), 1000), IntMath.Divide(VInt3.Dot(ref vInt4, ref this.axis[2]), 1000));
        int num2 = this.worldExtends.x * 1000;
        int num3 = VInt3.Dot(ref b.worldExtends, ref abs);

        if (Mathf.Abs(vInt4.x) * 1000 > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.y * 1000;
        num3 = VInt3.Dot(ref b.worldExtends, ref abs2);
        if (Mathf.Abs(vInt4.y) * 1000 > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.z * 1000;
        num3 = VInt3.Dot(ref b.worldExtends, ref abs3);
        if (Mathf.Abs(vInt4.z) * 1000 > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs.x + this.worldExtends.y * abs2.x + this.worldExtends.z * abs3.x;
        num3 = b.worldExtends.x * 1000;
        if (Math.Abs(vInt4.x * vInt.x + vInt4.y * vInt2.x + vInt4.z * vInt3.x) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs.y + this.worldExtends.y * abs2.y + this.worldExtends.z * abs3.y;
        num3 = b.worldExtends.y * 1000;
        if (Math.Abs(vInt4.x * vInt.y + vInt4.y * vInt2.y + vInt4.z * vInt3.y) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs.z + this.worldExtends.y * abs2.z + this.worldExtends.z * abs3.z;
        num3 = b.worldExtends.z * 1000;
        if (Math.Abs(vInt4.x * vInt.z + vInt4.y * vInt2.z + vInt4.z * vInt3.z) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.y * abs3.x + this.worldExtends.z * abs2.x;
        num3 = b.worldExtends.y * abs.z + b.worldExtends.z * abs.y;
        if (Mathf.Abs(vInt4.z * vInt2.x - vInt4.y * vInt3.x) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.y * abs3.y + this.worldExtends.z * abs2.y;
        num3 = b.worldExtends.x * abs.z + b.worldExtends.z * abs.x;
        if (Mathf.Abs(vInt4.z * vInt2.y - vInt4.y * vInt3.y) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.y * abs3.z + this.worldExtends.z * abs2.z;
        num3 = b.worldExtends.x * abs.y + b.worldExtends.y * abs.x;
        if (Mathf.Abs(vInt4.z * vInt2.z - vInt4.y * vInt3.z) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs3.x + this.worldExtends.z * abs.x;
        num3 = b.worldExtends.y * abs2.z + b.worldExtends.z * abs2.y;
        if (Mathf.Abs(vInt4.x * vInt3.x - vInt4.z * vInt.x) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs3.y + this.worldExtends.z * abs.y;
        num3 = b.worldExtends.x * abs2.z + b.worldExtends.z * abs2.x;
        if (Mathf.Abs(vInt4.x * vInt3.y - vInt4.z * vInt.y) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs3.z + this.worldExtends.z * abs.z;
        num3 = b.worldExtends.x * abs2.y + b.worldExtends.y * abs2.x;
        if (Mathf.Abs(vInt4.x * vInt3.z - vInt4.z * vInt.z) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs2.x + this.worldExtends.y * abs.x;
        num3 = b.worldExtends.y * abs3.z + b.worldExtends.z * abs3.y;
        if (Mathf.Abs(vInt4.y * vInt.x - vInt4.x * vInt2.x) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs2.y + this.worldExtends.y * abs.y;
        num3 = b.worldExtends.x * abs3.z + b.worldExtends.z * abs3.x;
        if (Mathf.Abs(vInt4.y * vInt.y - vInt4.x * vInt2.y) > num2 + num3)
        {
            return(false);
        }
        num2 = this.worldExtends.x * abs2.z + this.worldExtends.y * abs.z;
        num3 = b.worldExtends.x * abs3.y + b.worldExtends.y * abs3.x;
        return(Mathf.Abs(vInt4.y * vInt.z - vInt4.x * vInt2.z) <= num2 + num3);
    }
        public override void Process(Action _action, Track _track)
        {
            this.actor = _action.GetActorHandle(this.targetId);
            if (!this.actor)
            {
                if (ActionManager.Instance.isPrintLog)
                {
                }
                return;
            }
            ActorRoot       handle         = this.actor.handle;
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            int             num            = 1;

            if (refParamObject != null && refParamObject.Originator)
            {
                SkillSlot skillSlot;
                refParamObject.Originator.handle.SkillControl.TryGetSkillSlot(refParamObject.SlotType, out skillSlot);
                if (skillSlot != null)
                {
                    num = skillSlot.GetSkillLevel();
                }
                BaseSkill refParamObject2 = _action.refParams.GetRefParamObject <BaseSkill>("SkillObj");
                if (refParamObject2 != null)
                {
                    BuffSkill buffSkill = refParamObject2.isBuff ? ((BuffSkill)refParamObject2) : null;
                    if (buffSkill != null)
                    {
                        byte b = buffSkill.cfgData.bGrowthType;
                        b %= 10;
                        if (b > 0 && (SkillSlotType)b != refParamObject.SlotType + 1)
                        {
                            SSkillFuncContext sSkillFuncContext = default(SSkillFuncContext);
                            sSkillFuncContext.inOriginator = refParamObject.Originator;
                            sSkillFuncContext.inBuffSkill  = new PoolObjHandle <BuffSkill>(buffSkill);
                            sSkillFuncContext.inTargetObj  = refParamObject.TargetActor;
                            sSkillFuncContext.inUseContext = refParamObject;
                            num = sSkillFuncContext.iSkillLevel;
                        }
                    }
                }
            }
            if (this.type == SetCollisionTick.ColliderType.Box)
            {
                VCollisionBox collisionShape = SetCollisionTick.GetCollisionShape <VCollisionBox>(handle, CollisionShapeType.Box);
                collisionShape.Pos   = this.Pos;
                collisionShape.Size  = this.Size + this.SizeGrowthValue * (num - 1);
                collisionShape.dirty = true;
                collisionShape.ConditionalUpdateShape();
            }
            else if (this.type == SetCollisionTick.ColliderType.Sphere)
            {
                VCollisionSphere collisionShape2 = SetCollisionTick.GetCollisionShape <VCollisionSphere>(handle, CollisionShapeType.Sphere);
                collisionShape2.Pos    = this.Pos;
                collisionShape2.Radius = this.Radius + this.RadiusGrowthValue * (num - 1);
                collisionShape2.dirty  = true;
                collisionShape2.ConditionalUpdateShape();
            }
            else if (this.type == SetCollisionTick.ColliderType.CylinderSector)
            {
                VCollisionCylinderSector collisionShape3 = SetCollisionTick.GetCollisionShape <VCollisionCylinderSector>(handle, CollisionShapeType.CylinderSector);
                collisionShape3.Pos      = this.Pos;
                collisionShape3.Radius   = this.SectorRadius + this.SectorRadiusGrow * (num - 1);
                collisionShape3.Height   = this.Height + this.HeightGrow * (num - 1);
                collisionShape3.Degree   = this.Degree + this.DegreeGrow * (num - 1);
                collisionShape3.Rotation = this.Rotation + this.RotationGrow * (num - 1);
                collisionShape3.dirty    = true;
                collisionShape3.ConditionalUpdateShape();
            }
        }
Exemple #5
0
    public bool IntersectsOBB(VCollisionBox b)
    {
        base.ConditionalUpdateShape();
        b.ConditionalUpdateShape();
        long  num   = this.worldRadius + b.worldRadius;
        VInt3 num11 = this.worldPos - b.worldPos;

        if (num11.sqrMagnitudeLong > (num * num))
        {
            return(false);
        }
        VInt3 num2         = new VInt3(IntMath.Divide(VInt3.Dot(ref this.axis[0], ref b.axis[0]), 0x3e8), IntMath.Divide(VInt3.Dot(ref this.axis[0], ref b.axis[1]), 0x3e8), IntMath.Divide(VInt3.Dot(ref this.axis[0], ref b.axis[2]), 0x3e8));
        VInt3 num3         = new VInt3(IntMath.Divide(VInt3.Dot(ref this.axis[1], ref b.axis[0]), 0x3e8), IntMath.Divide(VInt3.Dot(ref this.axis[1], ref b.axis[1]), 0x3e8), IntMath.Divide(VInt3.Dot(ref this.axis[1], ref b.axis[2]), 0x3e8));
        VInt3 num4         = new VInt3(IntMath.Divide(VInt3.Dot(ref this.axis[2], ref b.axis[0]), 0x3e8), IntMath.Divide(VInt3.Dot(ref this.axis[2], ref b.axis[1]), 0x3e8), IntMath.Divide(VInt3.Dot(ref this.axis[2], ref b.axis[2]), 0x3e8));
        VInt3 abs          = num2.abs;
        VInt3 rhs          = num3.abs;
        VInt3 num7         = num4.abs;
        VInt3 lhs          = b.worldPos - this.worldPos;
        int   introduced11 = IntMath.Divide(VInt3.Dot(ref lhs, ref this.axis[0]), 0x3e8);
        int   introduced12 = IntMath.Divide(VInt3.Dot(ref lhs, ref this.axis[1]), 0x3e8);

        lhs = new VInt3(introduced11, introduced12, IntMath.Divide(VInt3.Dot(ref lhs, ref this.axis[2]), 0x3e8));
        int num9  = this.worldExtends.x * 0x3e8;
        int num10 = VInt3.Dot(ref b.worldExtends, ref abs);

        if ((Mathf.Abs(lhs.x) * 0x3e8) > (num9 + num10))
        {
            return(false);
        }
        num9  = this.worldExtends.y * 0x3e8;
        num10 = VInt3.Dot(ref b.worldExtends, ref rhs);
        if ((Mathf.Abs(lhs.y) * 0x3e8) > (num9 + num10))
        {
            return(false);
        }
        num9  = this.worldExtends.z * 0x3e8;
        num10 = VInt3.Dot(ref b.worldExtends, ref num7);
        if ((Mathf.Abs(lhs.z) * 0x3e8) > (num9 + num10))
        {
            return(false);
        }
        num9  = ((this.worldExtends.x * abs.x) + (this.worldExtends.y * rhs.x)) + (this.worldExtends.z * num7.x);
        num10 = b.worldExtends.x * 0x3e8;
        if (Math.Abs((int)(((lhs.x * num2.x) + (lhs.y * num3.x)) + (lhs.z * num4.x))) > (num9 + num10))
        {
            return(false);
        }
        num9  = ((this.worldExtends.x * abs.y) + (this.worldExtends.y * rhs.y)) + (this.worldExtends.z * num7.y);
        num10 = b.worldExtends.y * 0x3e8;
        if (Math.Abs((int)(((lhs.x * num2.y) + (lhs.y * num3.y)) + (lhs.z * num4.y))) > (num9 + num10))
        {
            return(false);
        }
        num9  = ((this.worldExtends.x * abs.z) + (this.worldExtends.y * rhs.z)) + (this.worldExtends.z * num7.z);
        num10 = b.worldExtends.z * 0x3e8;
        if (Math.Abs((int)(((lhs.x * num2.z) + (lhs.y * num3.z)) + (lhs.z * num4.z))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.y * num7.x) + (this.worldExtends.z * rhs.x);
        num10 = (b.worldExtends.y * abs.z) + (b.worldExtends.z * abs.y);
        if (Mathf.Abs((int)((lhs.z * num3.x) - (lhs.y * num4.x))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.y * num7.y) + (this.worldExtends.z * rhs.y);
        num10 = (b.worldExtends.x * abs.z) + (b.worldExtends.z * abs.x);
        if (Mathf.Abs((int)((lhs.z * num3.y) - (lhs.y * num4.y))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.y * num7.z) + (this.worldExtends.z * rhs.z);
        num10 = (b.worldExtends.x * abs.y) + (b.worldExtends.y * abs.x);
        if (Mathf.Abs((int)((lhs.z * num3.z) - (lhs.y * num4.z))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.x * num7.x) + (this.worldExtends.z * abs.x);
        num10 = (b.worldExtends.y * rhs.z) + (b.worldExtends.z * rhs.y);
        if (Mathf.Abs((int)((lhs.x * num4.x) - (lhs.z * num2.x))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.x * num7.y) + (this.worldExtends.z * abs.y);
        num10 = (b.worldExtends.x * rhs.z) + (b.worldExtends.z * rhs.x);
        if (Mathf.Abs((int)((lhs.x * num4.y) - (lhs.z * num2.y))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.x * num7.z) + (this.worldExtends.z * abs.z);
        num10 = (b.worldExtends.x * rhs.y) + (b.worldExtends.y * rhs.x);
        if (Mathf.Abs((int)((lhs.x * num4.z) - (lhs.z * num2.z))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.x * rhs.x) + (this.worldExtends.y * abs.x);
        num10 = (b.worldExtends.y * num7.z) + (b.worldExtends.z * num7.y);
        if (Mathf.Abs((int)((lhs.y * num2.x) - (lhs.x * num3.x))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.x * rhs.y) + (this.worldExtends.y * abs.y);
        num10 = (b.worldExtends.x * num7.z) + (b.worldExtends.z * num7.x);
        if (Mathf.Abs((int)((lhs.y * num2.y) - (lhs.x * num3.y))) > (num9 + num10))
        {
            return(false);
        }
        num9  = (this.worldExtends.x * rhs.z) + (this.worldExtends.y * abs.z);
        num10 = (b.worldExtends.x * num7.y) + (b.worldExtends.y * num7.x);
        if (Mathf.Abs((int)((lhs.y * num2.z) - (lhs.x * num3.z))) > (num9 + num10))
        {
            return(false);
        }
        return(true);
    }