コード例 #1
0
ファイル: Scene.cs プロジェクト: mwikenma/usd-unity-sdk
        // ----------------------------------------------------------------------------------------- //
        // Private API
        // ----------------------------------------------------------------------------------------- //

        /// <remarks>
        /// Converts an std::vector to an array, but why?
        /// Swig's current implementation of std::vector returns references to private memory, which
        /// means any value obtained from it is extremely unsafe and will cause C++ style memory errors
        /// if used after the vector is disposed. For safety, our API should never return a raw vector.
        /// </remarks>
        private SdfPath[] VectorToArray(SdfPathVector vec)
        {
            var ret = new SdfPath[vec.Count];

            vec.CopyTo(ret);
            return(ret);
        }
コード例 #2
0
 public SampleCollection(Scene scene, SdfPathVector paths)
 {
     m_paths = new SdfPath[paths.Count];
     paths.CopyTo(m_paths);
     m_scene = scene;
 }