//========================================================================================= /// <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); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { if (!VRDF_Components.SetupVRIsReady) { return(inputDeps); } NativeArray <float3> rotationAxisOutput = new NativeArray <float3>(1, Allocator.TempJob); NativeArray <float> currentSpeedOutput = new NativeArray <float>(1, Allocator.TempJob); var job = new RotationJob { DeltaTime = Time.DeltaTime, RotationAxis = rotationAxisOutput, CurrentSpeed = currentSpeedOutput }.Schedule(this, inputDeps); job.Complete(); VRDF_Components.RotateVRCameraAround(rotationAxisOutput[0], currentSpeedOutput[0]); rotationAxisOutput.Dispose(); currentSpeedOutput.Dispose(); return(inputDeps); }
protected override JobHandle OnUpdate(JobHandle inputDependencies) { RotationJob job = new RotationJob { DeltaTime = Time.deltaTime }; return(job.Schedule(this, inputDependencies)); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var pJob = new RotationJob() { radianSpeed = Time.realtimeSinceStartup }; return(pJob.Schedule(this, inputDeps)); }
public JobHandle ProcessRotationJob(float deltaTime, JobHandle inputDependencies = default(JobHandle)) { RotationJob job = new RotationJob { DeltaTime = deltaTime }; return(job.Schedule(this, inputDependencies)); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var Job = new RotationJob { DeltaTime = Time.deltaTime }; return(Job.Schedule(this, 64, inputDeps)); }
#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() { time = Time.timeSinceLevelLoad, vector3 = Vector3.up }; var handle = job.Schedule(this, 1, inputDeps); return(handle); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { RotationJob rotJob = new RotationJob { target = GameManager.GM.getPlayerPosition() }; JobHandle rotHandle = rotJob.Schedule(this, inputDeps); return(rotHandle); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { float deltaTime = Mathf.Clamp(Time.deltaTime, 0.0f, 0.3f); var handle = new RotationJob() { DeltaTime = deltaTime, }.Schedule(this, inputDeps); return(handle); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { RotationJob rotateJob = new RotationJob { deltaTime = Time.deltaTime }; JobHandle rotationHandle = rotateJob.Schedule(this, inputDeps); return(rotationHandle); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { RotationJob rotationJob = new RotationJob { AllowedHorizontalWidth = Settings.RoadWidth, DeltaTime = Time.DeltaTime, MaxSpeed = Settings.MaxSpeed }; return(rotationJob.Schedule(this, inputDeps)); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var localToWorldJob = new LocalToWorldJob { commandBuffer = _entityCommandBufferSystem.CreateCommandBuffer().ToConcurrent(), entityType = GetArchetypeChunkEntityType() }.Schedule(_localToWorldGroup); var translationJob = new TranslationJob().Schedule(_translationQuery, inputDeps); var rotationJob = new RotationJob().Schedule(_rotationQuery, inputDeps); _entityCommandBufferSystem.AddJobHandleForProducer(localToWorldJob); return(JobHandle.CombineDependencies(localToWorldJob, translationJob, rotationJob)); }
protected override void OnUpdate() { var rotatorTypeHandle = GetComponentTypeHandle <Rotator>(); var rotationTypeHandle = GetComponentTypeHandle <Rotation>(); var job = new RotationJob { deltaTime = Time.DeltaTime, rotatorTypeHandle = rotatorTypeHandle, rotationTypeHandle = rotationTypeHandle, }; Dependency = job.ScheduleSingle(m_RotationGroup, Dependency); }
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)); }
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); }
//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); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { float deltaTime = Mathf.Clamp(Time.deltaTime, 0.0f, 0.3f); var job_RotationEast = new RotationJob { deltaTime = deltaTime, rotationDirection = new float3(1f, 0, 0), rotationType = GetArchetypeChunkComponentType <Rotation>(), rotationSpeedType = GetArchetypeChunkComponentType <LbRotationSpeed>(true) }.Schedule(m_Group_EastRotation, inputDeps); var job_RotationWest = new RotationJob { deltaTime = deltaTime, rotationDirection = new float3(-1f, 0, 0), rotationType = GetArchetypeChunkComponentType <Rotation>(), rotationSpeedType = GetArchetypeChunkComponentType <LbRotationSpeed>(true) }.Schedule(m_Group_WestRotation, inputDeps); var job_RotationNorth = new RotationJob { deltaTime = deltaTime, rotationDirection = new float3(0, 0, 1), rotationType = GetArchetypeChunkComponentType <Rotation>(), rotationSpeedType = GetArchetypeChunkComponentType <LbRotationSpeed>(true) }.Schedule(m_Group_NorthRotation, inputDeps); var job_RotationSouth = new RotationJob { deltaTime = deltaTime, rotationDirection = new float3(0, 0, -1), rotationType = GetArchetypeChunkComponentType <Rotation>(), rotationSpeedType = GetArchetypeChunkComponentType <LbRotationSpeed>(true) }.Schedule(m_Group_SouthRotation, inputDeps); var finalHandle = JobHandle.CombineDependencies(JobHandle.CombineDependencies(job_RotationEast, job_RotationWest, job_RotationNorth), job_RotationSouth); return(finalHandle); }
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); }