Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        x = y = 0;

        camInterface       = GameObject.Find("CameraInterface").GetComponent <RealsenseSandparty>();
        terrainUpdateDelay = new WaitForSeconds(1f);

        m_terrain     = (Terrain)gameObject.GetComponent <Terrain>();
        terrainWidth  = m_terrain.terrainData.heightmapWidth;
        terrainHeight = m_terrain.terrainData.heightmapHeight;

        // Create the game object containing the renderer
        mf = gameObject.AddComponent(typeof(MeshFilter)) as MeshFilter;
        mr = gameObject.AddComponent(typeof(MeshRenderer)) as MeshRenderer;

        // Retrieve a mesh instance
        mesh = gameObject.GetComponent <MeshFilter>().mesh;

        m_heightValues    = new float[terrainWidth, terrainHeight];
        prev_heightValues = new float[terrainWidth, terrainHeight];
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     realsenseInterface = GameObject.Find("CameraInterface").GetComponent <RealsenseSandparty>();
     heightMap          = GameObject.Find("HeightMap").GetComponent <HeightMapRealsense>();
 }