Ejemplo n.º 1
0
 public void AddForce(ref CSForce v)
 {
     if (enabled)
     {
         m_forces.Add(v);
     }
 }
Ejemplo n.º 2
0
    void Update()
    {
        Vector3   zero = Vector3.zero;
        Vector3   one  = Vector3.one;
        Vector3   s    = transform.localScale;
        Matrix4x4 bt   = Matrix4x4.identity;

        bt.SetColumn(3, new Vector4(0.0f, 0.0f, 0.5f, 1.0f));
        bt          = Matrix4x4.Scale(new Vector3(s.x, s.y, s.z * range)) * bt;
        forceMatrix = transform.localToWorldMatrix * bt;

        CSForce force = new CSForce();

        force.info.shape_type = CSForceShape.Box;
        force.info.dir_type   = CSForceDirection.Directional;
        force.info.strength   = strength;
        force.info.direction  = transform.forward;
        MPGPImpl.BuildBox(ref force.box, ref forceMatrix, ref zero, ref one);
        MPGPWorld.GetInstances().ForEach((t) => { t.AddForce(ref force); });

        foreach (Transform child in transform)
        {
            child.Rotate(new Vector3(0.0f, 0.0f, 1.0f), strength * 0.33f);
        }
    }
Ejemplo n.º 3
0
    void Blow()
    {
        TestShooter ts = TestShooter.instance;
        if (ts.gameMode == TestShooter.GameMode.Exception)
        {
            Vector3 pos = trans.position;
            float strength = 2000.0f;

            CSForce force = new CSForce();
            force.info.shape_type = CSForceShape.Box;
            force.info.dir_type = CSForceDirection.Radial;
            force.info.strength = strength;
            force.info.center = pos - (trans.forward * 6.0f);
            CSImpl.BuildBox(ref force.box, blowMatrix, Vector3.one);
            GPUParticleWorld.GetInstances().ForEach((t) => { t.AddForce(ref force); });
        }
    }
Ejemplo n.º 4
0
    void Blow()
    {
        TestShooter ts = TestShooter.instance;

        if (ts.gameMode == TestShooter.GameMode.Exception)
        {
            Vector3 pos      = trans.position;
            float   strength = 2000.0f;

            CSForce force = new CSForce();
            force.info.shape_type = CSForceShape.Box;
            force.info.dir_type   = CSForceDirection.Radial;
            force.info.strength   = strength;
            force.info.center     = pos - (trans.forward * 6.0f);
            CSImpl.BuildBox(ref force.box, blowMatrix, Vector3.one);
            GPUParticleWorld.GetInstances().ForEach((t) => { t.AddForce(ref force); });
        }
    }
Ejemplo n.º 5
0
    void Update()
    {
        Vector3 s = transform.localScale;
        Matrix4x4 bt = Matrix4x4.identity;
        bt.SetColumn(3, new Vector4(0.0f, 0.0f, 0.5f, 1.0f));
        bt = Matrix4x4.Scale(new Vector3(s.x, s.y, s.z * range)) * bt;
        forceMatrix = transform.localToWorldMatrix * bt;

        CSForce force = new CSForce();
        force.info.shape_type = CSForceShape.Box;
        force.info.dir_type = CSForceDirection.Directional;
        force.info.strength = strength;
        force.info.direction = transform.forward;
        CSImpl.BuildBox(ref force.box, forceMatrix, Vector3.one);
        GPUParticleWorld.GetInstances().ForEach((t) => { t.AddForce(ref force); });

        foreach (Transform child in transform)
        {
            child.Rotate(new Vector3(0.0f, 0.0f, 1.0f), strength * 0.33f);
        }
    }
Ejemplo n.º 6
0
 public void AddForce(ref CSForce v)
 {
     if (enabled) m_forces.Add(v);
 }