示例#1
0
        void UpdateKernelParams()
        {
            m_texture_needs_update = true;

            m_particle_num = MPAPI.mpGetNumParticles(GetContext());

            MPKernelParams p = default(MPKernelParams);

            MPAPI.mpGetKernelParams(GetContext(), ref p);
            p.world_center         = transform.position;
            p.world_size           = transform.localScale;
            p.world_div_x          = m_world_div_x;
            p.world_div_y          = m_world_div_y;
            p.world_div_z          = m_world_div_z;
            p.active_region_center = transform.position + m_active_region_center;
            p.active_region_extent = m_active_region_extent;
            p.solver_type          = (int)m_solver;
            p.enable_interaction   = m_enable_interaction ? 1 : 0;
            p.enable_colliders     = m_enable_colliders ? 1 : 0;
            p.enable_forces        = m_enable_forces ? 1 : 0;
            p.id_as_float          = m_id_as_float ? 1 : 0;
            p.timestep             = Time.deltaTime * m_timescale;
            p.damping            = m_damping;
            p.advection          = m_advection;
            p.pressure_stiffness = m_pressure_stiffness;
            p.scaler             = m_coord_scale;
            p.particle_size      = m_particle_size;
            p.max_particles      = m_max_particle_num;
            MPAPI.mpSetKernelParams(GetContext(), ref p);
        }
示例#2
0
文件: MP.cs 项目: davidlawson/ggj2016
 public static extern void mpSetKernelParams(int context, ref MPKernelParams p);
示例#3
0
 public static extern void mpSetKernelParams(int context, ref MPKernelParams p);