Esempio n. 1
0
        //=========================================================================================
        /// <summary>
        /// 拘束の解決
        /// </summary>
        /// <param name="dtime"></param>
        /// <param name="jobHandle"></param>
        /// <returns></returns>
        public override JobHandle SolverConstraint(float dtime, float updatePower, int iteration, JobHandle jobHandle)
        {
            if (groupList.Count == 0)
            {
                return(jobHandle);
            }

            // 回転拘束(パーティクルごとに実行する)
            var job1 = new RotationJob()
            {
                updatePower = updatePower,

                dataList    = dataList.ToJobArray(),
                groupList   = groupList.ToJobArray(),
                refDataList = refDataList.ToJobArray(),

                teamDataList = Manager.Team.teamDataList.ToJobArray(),
                teamIdList   = Manager.Particle.teamIdList.ToJobArray(),

                flagList  = Manager.Particle.flagList.ToJobArray(),
                depthList = Manager.Particle.depthList.ToJobArray(),
                //basePosList = Manager.Particle.basePosList.ToJobArray(),
                baseRotList  = Manager.Particle.baseRotList.ToJobArray(),
                nextPosList  = Manager.Particle.InNextPosList.ToJobArray(),
                frictionList = Manager.Particle.frictionList.ToJobArray(),

                outNextPosList = Manager.Particle.OutNextPosList.ToJobArray(),
                posList        = Manager.Particle.posList.ToJobArray(),
            };

            jobHandle = job1.Schedule(Manager.Particle.Length, 64, jobHandle);
            Manager.Particle.SwitchingNextPosList();

            return(jobHandle);
        }
        public JobHandle ProcessRotationJob(float deltaTime, JobHandle inputDependencies = default(JobHandle))
        {
            RotationJob job = new RotationJob
            {
                DeltaTime = deltaTime
            };

            return(job.Schedule(this, inputDependencies));
        }
Esempio n. 3
0
#pragma warning restore 649
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new RotationJob
            {
                Rotations = _planets.Data
            };

            return(job.Schedule(_planets.Transforms, inputDeps));
        }
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var Job = new RotationJob
        {
            DeltaTime = Time.deltaTime
        };

        return(Job.Schedule(this, 64, inputDeps));
    }
        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            RotationJob job = new RotationJob
            {
                DeltaTime = Time.deltaTime
            };

            return(job.Schedule(this, inputDependencies));
        }
Esempio n. 6
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var pJob = new RotationJob()
            {
                radianSpeed = Time.realtimeSinceStartup
            };

            return(pJob.Schedule(this, inputDeps));
        }
Esempio n. 7
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new RotationJob()
        {
            time = Time.timeSinceLevelLoad, vector3 = Vector3.up
        };
        var handle = job.Schedule(this, 1, inputDeps);

        return(handle);
    }
Esempio n. 8
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            RotationJob rotateJob = new RotationJob
            {
                deltaTime = Time.deltaTime
            };

            JobHandle rotationHandle = rotateJob.Schedule(this, inputDeps);

            return(rotationHandle);
        }
Esempio n. 9
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            RotationJob rotJob = new RotationJob
            {
                target = GameManager.GM.getPlayerPosition()
            };

            JobHandle rotHandle = rotJob.Schedule(this, inputDeps);

            return(rotHandle);
        }
Esempio n. 10
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        RotationJob rotationJob = new RotationJob
        {
            AllowedHorizontalWidth = Settings.RoadWidth,
            DeltaTime = Time.DeltaTime,
            MaxSpeed  = Settings.MaxSpeed
        };

        return(rotationJob.Schedule(this, inputDeps));
    }
Esempio n. 11
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        /*
         * Entities.ForEach((ref Rotation rotation, ref MotionProperties motionProperties) =>
         * {
         *  rotation.Value = quaternion.Euler(0, 0, math.PI * Time.realtimeSinceStartup * motionProperties.rotationSpeed);
         * });
         */
        RotationJob rotationJob = new RotationJob
        {
            realtimeSinceStartUp = Time.realtimeSinceStartup
        };

        return(rotationJob.Schedule(this, inputDeps));
    }
        //runs on main threads
        protected override void OnUpdate()
        {
            var deltaTime         = Time.DeltaTime;
            var rotationType      = GetArchetypeChunkComponentType <Rotation>();
            var rotationSpeedType = GetArchetypeChunkComponentType <RotationSpeedJobChunkData>(true); // it is readonly

            // do the job
            var job = new RotationJob()
            {
                rType             = rotationType,
                rotationSpeedType = rotationSpeedType,
                deltaTime         = deltaTime
            };

            Dependency = job.Schedule(_query, Dependency);
        }
Esempio n. 13
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new RotationJob()
        {
            Time        = Time.timeSinceLevelLoad,
            Vector3     = Vector3.up,
            YMoveFactor = ECSWorld.Settings.YMoveFactor //,
                                                        //Rotation = group.Rotation,
                                                        //Position = group.Position
        };
        var handle = job.Schedule(this);

        //var handle = job.Schedule(group.Length, 1, inputDeps);
        //handle.Complete();
        return(handle);
    }
Esempio n. 14
0
    protected override void OnUpdate()
    {
        var rotatorManager = GetSingletonEntity <Rotator>();
        var rotatorBuffer  = GetBuffer <Rotator>(rotatorManager);

        rotatorBufferCache.Clear();
        rotatorBufferCache.CopyFrom(rotatorBuffer.AsNativeArray());

        var rotationLookup = GetComponentDataFromEntity <Rotation>(false);

        var job = new RotationJob
        {
            deltaTime = Time.DeltaTime,

            rotatorBuffer = rotatorBufferCache,

            rotationLookup = rotationLookup
        };

        var innerLoopBatchCount = (int)math.floor(math.sqrt((float)rotatorBufferCache.Length));

        Dependency = job.Schedule(rotatorBufferCache.Length, innerLoopBatchCount, Dependency);
    }
Esempio n. 15
0
 void Update()
 {
     this.job.RotationalAxis = this.rotationAxis;
     this.jobHandle          = job.Schedule(transformArray, this.jobHandle);
 }