示例#1
0
    public static void AddRadialSphereForce(Vector3 pos, float radius, float strength)
    {
        Matrix4x4         mat = Matrix4x4.TRS(pos, Quaternion.identity, Vector3.one * radius);
        MPForceProperties p   = new MPForceProperties();

        p.shape_type      = MPForceShape.Sphere;
        p.dir_type        = MPForceDirection.Radial;
        p.radial_center   = pos;
        p.strength_near   = strength;
        p.strength_far    = 0.0f;
        p.attenuation_exp = 0.5f;
        p.range_inner     = 0.0f;
        p.range_outer     = radius;
        MPAPI.mpAddForce(ref p, ref mat);
    }
示例#2
0
文件: MP.cs 项目: Pheema/UnitySandBox
 [DllImport("MassParticle")] public static extern void mpAddForce(int context, ref MPForceProperties props, ref Matrix4x4 mat);
示例#3
0
文件: MP.cs 项目: stlck/FractalTest
 public static void AddRadialSphereForce(MPWorld world, Vector3 pos, float radius, float strength)
 {
     Matrix4x4 mat = Matrix4x4.TRS(pos, Quaternion.identity, Vector3.one * radius);
     MPForceProperties p = new MPForceProperties();
     p.shape_type = MPForceShape.Sphere;
     p.dir_type = MPForceDirection.Radial;
     p.center = pos;
     p.strength_near = strength;
     p.strength_far = 0.0f;
     p.attenuation_exp = 0.5f;
     p.range_inner = 0.0f;
     p.range_outer = radius;
     world.AddOneTimeAction(() => {
         MPAPI.mpAddForce(world.GetContext(), ref p, ref mat);
     });
 }
示例#4
0
文件: MP.cs 项目: stlck/FractalTest
 public static extern void mpAddForce(int context, ref MPForceProperties props, ref Matrix4x4 mat);
示例#5
0
 [DllImport("MassParticle")] public static extern void mpAddForce(ref MPForceProperties regionType, ref Matrix4x4 regionMat);