Exemple #1
0
 void Start()
 {
     _positions     = new PositionService(compute, capacity);
     _velocities    = new VelocityService(compute, capacity);
     _lifes         = new LifeService(compute, capacity);
     _velSimulation = new VelocitySimulation(compute, _velocities);
     _posSimulation = new PositionSimulation(compute, _velocities, _positions);
 }
Exemple #2
0
    public RotationService(ComputeShader c, VelocityService v, LifeService l, float radius, Vector2 angularSpeedRange)
    {
        Count       = v.V0.count;
        _compute    = c;
        _velocities = v;
        _lifes      = l;
        _kernelVelocityBasedRotate = c.FindKernel(KERNEL_VELOCITY_BASED_ROTATE);
        _data      = new Vector4[Count];
        _rotations = new ComputeBuffer(Count, Marshal.SizeOf(typeof(Vector4)));

        for (var i = 0; i < Count; i++)
        {
            _data[i] = QuaternionExtension.IDENTITY;
        }
        Upload();
        ShaderUtil.CalcWorkSize(Count, out SimSizeX, out SimSizeY, out SimSizeZ);

        _angularSpeedData = new float[ShaderConst.WARP_SIZE];
        _angularSpeed     = new ComputeBuffer(_angularSpeedData.Length, Marshal.SizeOf(typeof(float)));
        UpdateAngularSpeed(angularSpeedRange);
    }
Exemple #3
0
 public LifeController(WebMazeContext context,
                       IMapper mapper,
                       AccidentRepository accidentRepository,
                       AdressRepository addressRepository,
                       CitizenUserRepository citizenUserRepository,
                       VictimRepository victimRepository,
                       HouseDestroyedInFireRepository houseDestroyedInFireRepository,
                       FireDetailRepository fireDetailRepository,
                       CriminalOffenceArticleRepository criminalOffenceArticleRepository,
                       CriminalOffenderRepository criminalOffenderRepository,
                       LifeService lifeService)
 {
     this.context                          = context;
     this.accidentRepository               = accidentRepository;
     this.addressRepository                = addressRepository;
     this.citizenUserRepository            = citizenUserRepository;
     this.victimRepository                 = victimRepository;
     this.fireDetailRepository             = fireDetailRepository;
     this.houseDestroyedInFireRepository   = houseDestroyedInFireRepository;
     this.criminalOffenceArticleRepository = criminalOffenceArticleRepository;
     this.criminalOffenderRepository       = criminalOffenderRepository;
     this.lifeService                      = lifeService;
     this.mapper = mapper;
 }
Exemple #4
0
 void Start()
 {
     lifeService = FindObjectOfType <LifeService> ();
 }
 // Use this for initialization
 void Start()
 {
     scoreService = ScoreService.getInstance();
     lifeService  = FindObjectOfType <LifeService> ();
 }
Exemple #6
0
 void Start()
 {
     _positions = new PositionService(compute, capacity);
     _lifes     = new LifeService(compute, capacity);
 }