Exemple #1
0
        public void Attach(EmbreeGeometry geometry, uint id)
        {
            EmbreeAPI.rtcAttachGeometryByID(Handle, geometry.Handle, id);
            m_device.CheckError("AddGeometry");

            m_geometries.Add(id, geometry);
        }
Exemple #2
0
        public uint Attach(EmbreeGeometry geometry)
        {
            var id = EmbreeAPI.rtcAttachGeometry(Handle, geometry.Handle);

            m_device.CheckError("AddGeometry");

            m_geometries.Add(id, geometry);

            return(id);
        }
Exemple #3
0
        /// <summary>
        /// Single geometry instance
        /// </summary>
        public GeometryInstance(Device device, EmbreeGeometry geometry, Affine3f transform)
            : base(device, RTCGeometryType.Instance)
        {
            m_scene = EmbreeAPI.rtcNewScene(device.Handle);
            EmbreeAPI.rtcSetSceneFlags(m_scene, RTCSceneFlags.Robust | RTCSceneFlags.ContextFilterFunction);
            EmbreeAPI.rtcSetSceneBuildQuality(m_scene, RTCBuildQuality.High);
            EmbreeAPI.rtcAttachGeometry(m_scene, geometry.Handle);
            EmbreeAPI.rtcCommitScene(m_scene);

            EmbreeAPI.rtcSetGeometryInstancedScene(Handle, m_scene);
            EmbreeAPI.rtcSetGeometryTimeStepCount(Handle, 1);
            Transform = transform;

            Commit();
        }