Avogadro::Rendering::GeometryNode#
-
class GeometryNode : public Node#
The GeometryNode class is the common base of all geometry nodes.
The GeometryNode contains any Drawable objects, and is the only node type that results in anything being rendered to the screen.
- Author
Marcus D. Hanwell
Public Functions
-
GeometryNode()#
-
~GeometryNode() override#
-
void addDrawable(Drawable *object)#
Add a drawable object to the geometry node.
- Parameters:
object – Drawable object to be added.
-
bool removeDrawable(Drawable *node)#
Remove child node, this node will no longer be deleted.
- Parameters:
node – Node to be removed.
- Returns:
True if the node was removed, false if it was not found.
-
Drawable *drawable(size_t index)#
Get the child Node at the specified index.
- Parameters:
index – The index of the child.
- Returns:
A pointer to the child node, or nullptr if the index is out of range.
-
void clearDrawables()#
Remove all drawable objects.
-
std::multimap<float, Identifier> hits(const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const#
Return the primitives that are hit by the ray.
- Parameters:
rayOrigin – Origin of the ray.
rayEnd – End point of the ray.
rayDirection – Normalized direction of the ray.
- Returns:
Sorted collection of primitives that were hit.