public Scene(Context context, SceneSettings sceneSettings, SerializedData dataAsset)
        {
            mContext = context;

            var serializedObject = new SerializedObject(context, dataAsset);
            var status           = API.iplSceneLoad(context.Get(), ref sceneSettings, serializedObject.Get(), null, IntPtr.Zero, out mScene);

            if (status != Error.Success)
            {
                throw new Exception(string.Format("Unable to load scene [{0}]", status.ToString()));
            }
        }
Example #2
0
        public Scene(Context context, SceneType type, EmbreeDevice embreeDevice, RadeonRaysDevice radeonRaysDevice, ClosestHitCallback closestHitCallback, AnyHitCallback anyHitCallback)
        {
            mContext = context;

            var sceneSettings = new SceneSettings {
            };

            sceneSettings.type               = type;
            sceneSettings.embreeDevice       = (embreeDevice != null) ? embreeDevice.Get() : IntPtr.Zero;
            sceneSettings.radeonRaysDevice   = (radeonRaysDevice != null) ? radeonRaysDevice.Get() : IntPtr.Zero;
            sceneSettings.closestHitCallback = closestHitCallback;
            sceneSettings.anyHitCallback     = anyHitCallback;

            var status = API.iplSceneCreate(context.Get(), ref sceneSettings, out mScene);

            if (status != Error.Success)
            {
                throw new Exception(string.Format("Unable to create scene [{0}]", status.ToString()));
            }
        }
Example #3
0
 public static extern Error iplSceneLoad(IntPtr context, ref SceneSettings settings, IntPtr serializedObject, ProgressCallback progressCallback, IntPtr progressCallbackUserData, out IntPtr scene);
Example #4
0
 public static extern Error iplSceneCreate(IntPtr context, ref SceneSettings settings, out IntPtr scene);