Exemple #1
0
    private static int _amInitOmni(object p)
    {
        AppMain.AMS_AME_CREATE_PARAM      amsAmeCreateParam = (AppMain.AMS_AME_CREATE_PARAM)p;
        AppMain.AMS_AME_NODE_OMNI         node = (AppMain.AMS_AME_NODE_OMNI)amsAmeCreateParam.node;
        AppMain.AMS_AME_RUNTIME_WORK_OMNI work = (AppMain.AMS_AME_RUNTIME_WORK_OMNI)amsAmeCreateParam.work;
        work.time = -node.start_time;
        AppMain.amVectorAdd(ref work.position, ref amsAmeCreateParam.parent_position.UnsafeValue, ref amsAmeCreateParam.position.UnsafeValue);
        AppMain.amVectorAdd(ref work.position, node.translate);
        AppMain.amVectorScale(ref work.velocity, amsAmeCreateParam.parent_velocity.Value, node.inheritance_rate);
        AppMain.amVectorAdd(ref work.velocity, amsAmeCreateParam.velocity.Value);
        work.rotate = node.rotate;
        float sizeRate = amsAmeCreateParam.ecb.size_rate;

        work.offset       = node.offset * sizeRate;
        work.offset_chaos = node.offset_chaos * sizeRate;
        return(0);
    }
Exemple #2
0
    private static int _amUpdateOmni(object r)
    {
        AppMain.AMS_AME_RUNTIME           amsAmeRuntime1 = (AppMain.AMS_AME_RUNTIME)r;
        AppMain.AMS_AME_NODE_OMNI         node           = (AppMain.AMS_AME_NODE_OMNI)amsAmeRuntime1.node;
        AppMain.AMS_AME_RUNTIME_WORK_OMNI work           = (AppMain.AMS_AME_RUNTIME_WORK_OMNI)amsAmeRuntime1.work;
        work.time += AppMain._am_unit_frame;
        if ((double)work.time <= 0.0)
        {
            return(0);
        }
        if ((double)node.life != -1.0 && (double)work.time >= (double)node.life)
        {
            return(1);
        }
        AppMain.NNS_VECTOR4D amEffectVel = AppMain._amEffect_vel;
        AppMain.amVectorScale(ref amEffectVel, work.velocity, AppMain._am_unit_time);
        AppMain.amVectorAdd(ref work.position, amEffectVel);
        float sizeRate = amsAmeRuntime1.ecb.size_rate;

        work.offset       = node.offset * sizeRate;
        work.offset_chaos = node.offset_chaos * sizeRate;
        AppMain.NNS_VECTOR4D amEffectPosition  = AppMain._amEffect_position;
        AppMain.NNS_VECTOR4D amEffectVelocity  = AppMain._amEffect_velocity;
        AppMain.NNS_VECTOR4D amEffectDirection = AppMain._amEffect_direction;
        AppMain.AMS_AME_LIST next = amsAmeRuntime1.child_head.next;
        for (AppMain.AMS_AME_LIST childTail = amsAmeRuntime1.child_tail; next != childTail; next = next.next)
        {
            AppMain.AMS_AME_RUNTIME amsAmeRuntime2 = (AppMain.AMS_AME_RUNTIME)next;
            amsAmeRuntime2.amount += node.frequency * AppMain._am_unit_frame;
            while ((double)amsAmeRuntime2.amount >= 1.0)
            {
                --amsAmeRuntime2.amount;
                ++amsAmeRuntime2.count;
                if ((double)node.max_count != -1.0 && (double)((int)amsAmeRuntime2.work_num + (int)amsAmeRuntime2.active_num) < (double)node.max_count)
                {
                    AppMain.AMS_AME_CREATE_PARAM effectCreateParam = AppMain._amEffect_create_param;
                    effectCreateParam.Clear();
                    AppMain.amVectorRandom(ref amEffectDirection);
                    AppMain.amVectorScale(ref amEffectVelocity, amEffectDirection, work.offset + work.offset_chaos * AppMain.nnRandom());
                    amEffectPosition.Assign(amEffectVelocity);
                    AppMain.amVectorScale(ref amEffectVelocity, amEffectDirection, node.speed + node.speed_chaos * AppMain.nnRandom());
                    effectCreateParam.ecb             = amsAmeRuntime1.ecb;
                    effectCreateParam.runtime         = amsAmeRuntime2;
                    effectCreateParam.node            = amsAmeRuntime2.node;
                    effectCreateParam.parent_position = work.position;
                    effectCreateParam.parent_velocity = work.velocity;
                    effectCreateParam.position        = amEffectPosition;
                    effectCreateParam.velocity        = amEffectVelocity;
                    switch (AppMain.AMD_AME_SUPER_CLASS_ID(amsAmeRuntime2.node))
                    {
                    case 256:
                        AppMain._amCreateEmitter(effectCreateParam);
                        continue;

                    case 512:
                        AppMain._amCreateParticle(effectCreateParam);
                        continue;

                    default:
                        continue;
                    }
                }
            }
        }
        return(0);
    }