Beispiel #1
0
    void MPUpdate()
    {
        Vector3 pos = m_trans.position;

        //MPAPI.mpScanAABBParallel(m_target.GetContext(), m_handler, ref pos, ref scale);
        MPAPI.mpScanSphereParallel(m_target.GetContext(), m_handler, ref pos, m_radius);
        //MPAPI.mpScanSphere(m_target.GetContext(), m_handler, ref pos, m_radius);

        //Vector3 mv = new Vector3(0.0f, 0.0f, 0.01f);
        //MPAPI.mpMoveAll(m_target.GetContext(), ref mv);
    }
Beispiel #2
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);
        });
    }
Beispiel #3
0
 public static int GetCurrentContext()
 {
     return(s_current.GetContext());
 }
Beispiel #4
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);
     });
 }