Class Avogadro::Rendering::AmbientOcclusionSphereGeometry#

class AmbientOcclusionSphereGeometry : public Drawable#

The AmbientOcclusionSphereGeometry class contains one or more spheres.

<avogadro/rendering/ambientocclusionspheregeometry.h>

This

Drawable is capable of storing the geometry for one or more spheres. A sphere is defined by a center point, a radius and a color. If the spheres are not a densely packed one-to-one mapping with the objects indices they can also optionally use an identifier that will point to some numeric ID for the purposes of picking.
Author

Tim Vandermeersch

Unlike the SphereGeometry class, this class also supports ambient occlusion.

Public Functions

AmbientOcclusionSphereGeometry()#
AmbientOcclusionSphereGeometry(const AmbientOcclusionSphereGeometry &other)#
~AmbientOcclusionSphereGeometry() override#
inline AmbientOcclusionSphereGeometry &operator=(AmbientOcclusionSphereGeometry)#
virtual void accept(Visitor&) override#

Accept a visit from our friendly visitor.

void update()#

Update the VBOs, IBOs etc ready for rendering.

virtual void render(const Camera &camera) override#

Render the sphere geometry.

Parameters:

camera – The current camera to be used for rendering.

virtual std::multimap<float, Identifier> hits(const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const override#

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.

void addSphere(const Vector3f &position, const Vector3ub &color, float radius, size_t index = MaxIndex)#

Add a sphere to the geometry object.

inline Core::Array<SphereColor> &spheres()#

Get a reference to the spheres.

inline const Core::Array<SphereColor> &spheres() const#
virtual void clear() override#

Clear the contents of the node.

inline size_t size() const#

Get the number of spheres in the node object.