vsg  1.1.0
VulkanSceneGraph library
AccelerationGeometry.h
1 #pragma once
2 
3 /* <editor-fold desc="MIT License">
4 
5 Copyright(c) 2019 Thomas Hogarth
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 
9 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 
11 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 
13 </editor-fold> */
14 
15 #include <vsg/commands/Command.h>
16 #include <vsg/core/Value.h>
17 #include <vsg/maths/mat4.h>
18 #include <vsg/state/BufferInfo.h>
19 #include <vsg/state/Descriptor.h>
20 #include <vsg/vk/DeviceMemory.h>
21 
22 namespace vsg
23 {
24 
26  class VSG_DECLSPEC AccelerationGeometry : public Inherit<Object, AccelerationGeometry>
27  {
28  public:
30 
31  void compile(Context& context);
32 
33  operator VkAccelerationStructureGeometryKHR() const { return _geometry; }
34 
35  ref_ptr<Data> verts;
36  ref_ptr<Data> indices;
37 
38  void assignVertices(ref_ptr<vsg::Data> in_vertices);
39  void assignIndices(ref_ptr<vsg::Data> in_indices);
40 
41  protected:
42  // compiled data
43  ref_ptr<BufferInfo> _vertexBuffer;
44  ref_ptr<BufferInfo> _indexBuffer;
46  };
47  VSG_type_name(vsg::AccelerationGeometry);
48 
49  using AccelerationGeometries = std::vector<ref_ptr<AccelerationGeometry>>;
50 
51 } // namespace vsg
AccelerationGeometry encapsulates settings for acceleration geometries.
Definition: AccelerationGeometry.h:27
Definition: Context.h:67
Definition: Inherit.h:28
Definition: ref_ptr.h:22
Definition: vulkan.h:665