Beispiel #1
0
    void m_WheelModel_random_unbalance()
    {
        for (int i = 0; i < m_WheelModel.spokes_count; ++i)
        {
            //m_WheelModel.nippleSetRotate( i,  UnityEngine.Random.Range(0.7f,0.8f) );
            m_WheelModel.nippleSetRotate(i, 0.7f);
        }

        for (int i = 0; i < 12; ++i)
        {
            int   spoke_id = sys.Random.range(0, m_WheelModel.spokes_count);
            float rev      = sys.Random.sign() * 0.1f;

            m_WheelModel.nippleRotate((spoke_id + 0) % m_WheelModel.spokes_count, rev);
            // m_WheelModel.nippleRotate( (spoke_id + 2) % m_WheelModel.spokes_count, rev );
        }

        /*
         * for ( int i = 0; i < 2; ++i )
         * {
         *  int spoke_id = sys.Random.range ( 0, m_WheelModel.spokes_count );
         *
         *  float rev = sys.Random.sign() * 0.2f;
         *
         *  m_WheelModel.nippleRotate( (spoke_id + 0) % m_WheelModel.spokes_count, rev );
         *  m_WheelModel.nippleRotate( (spoke_id + 1) % m_WheelModel.spokes_count, rev );
         *  m_WheelModel.nippleRotate( (spoke_id + 2) % m_WheelModel.spokes_count, rev );
         *  m_WheelModel.nippleRotate( (spoke_id + 3) % m_WheelModel.spokes_count, rev );
         * }
         */

        m_WheelModel_compute_and_rebuild_mesh();
    }