15#include <vsg/app/Camera.h>
16#include <vsg/maths/plane.h>
17#include <vsg/utils/Intersector.h>
18#include <vsg/utils/LineSegmentIntersector.h>
23 using Polytope = std::vector<dplane>;
35 class VSG_DECLSPEC Intersection :
public Inherit<Object, Intersection>
39 Intersection(
const dvec3& in_localIntersection,
const dvec3& in_worldIntersection,
const dmat4& in_localToWorld,
const NodePath& in_nodePath,
const DataList& in_arrays,
const std::vector<uint32_t>& in_indexRatios, uint32_t in_instanceIndex);
41 dvec3 localIntersection;
42 dvec3 worldIntersection;
47 std::vector<uint32_t> indices;
48 uint32_t instanceIndex = 0;
51 operator bool()
const {
return !nodePath.empty(); }
54 using Intersections = std::vector<ref_ptr<Intersection>>;
55 Intersections intersections;
57 ref_ptr<Intersection> add(
const dvec3& coord,
const std::vector<uint32_t>& indices, uint32_t instanceIndex);
60 void popTransform()
override;
65 bool intersectDraw(uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount)
override;
66 bool intersectDrawIndexed(uint32_t firstIndex, uint32_t indexCount, uint32_t firstInstance, uint32_t instanceCount)
override;
69 std::vector<Polytope> _polytopeStack;
PolytopeIntersector is an Intersector subclass that provides support for computing intersections betw...
Definition PolytopeIntersector.h:27
void pushTransform(const Transform &transform) override
clone and transform this Intersector to provide a new Intersector in local coordinates
bool intersectDrawIndexed(uint32_t firstIndex, uint32_t indexCount, uint32_t firstInstance, uint32_t instanceCount) override
intersect with a vkCmdDrawIndexed primitive
bool intersectDraw(uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) override
intersect with a vkCmdDraw primitive
bool intersects(const dsphere &bs) override
check for intersection with sphere
PolytopeIntersector(const Polytope &in_polytope, ref_ptr< ArrayState > initialArrayData={})
create intersector for specified polytope.
PolytopeIntersector(const Camera &camera, double xMin, double yMin, double xMax, double yMax, ref_ptr< ArrayState > initialArrayData={})
create intersector for a polytope with window space dimensions, projected into world coords using the...