/// <summary> /// Creates a new empty geometry. /// </summary> public Geometry(SceneFlags sceneFlags, TraversalFlags traversalFlags = TraversalFlags.Single) { RTC.Register(); this.sceneFlags = sceneFlags; this.traversalFlags = traversalFlags; scenePtr = RTC.NewScene(sceneFlags, traversalFlags); }
/// <summary> /// Creates a new mesh from index and vertex buffers. /// </summary> public TriangleMeshMotion(IList <Int32> indices, IList <IEmbreePoint> vertices0, IList <IEmbreePoint> vertices1) { if (vertices0.Count != vertices1.Count) { throw new ArgumentException("Both vertex buffers must have the same length"); } RTC.Register(); this.indices = indices; this.vertices0 = vertices0; this.vertices1 = vertices1; this.vertexCount = vertices0.Count; this.triangleCount = indices.Count / 3; if (vertexCount == 0) { throw new ArgumentOutOfRangeException("No vertices in mesh"); } if (triangleCount == 0) { throw new ArgumentOutOfRangeException("No triangles in mesh"); } }