Exemplo n.º 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);
    }
Exemplo n.º 2
0
 [DllImport("MassParticle")] public static extern void mpAddForce(int context, ref MPForceProperties props, ref Matrix4x4 mat);
Exemplo n.º 3
0
 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);
     });
 }
Exemplo n.º 4
0
 public static extern void mpAddForce(int context, ref MPForceProperties props, ref Matrix4x4 mat);
Exemplo n.º 5
0
 [DllImport("MassParticle")] public static extern void mpAddForce(ref MPForceProperties regionType, ref Matrix4x4 regionMat);