gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmGraphics::SphereGeometry Class Reference

SphereGeometry contains information for projection of graphics on a sphere. More...

#include <SphereGeometry.hh>

Inheritance diagram for gramods::gmGraphics::SphereGeometry:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmGraphics::SphereGeometry:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

void setPosition (Eigen::Vector3f p)
 Set the position of the sphere origin, its center. More...
 
void setRadius (float)
 Set the radius of the sphere. More...
 
void setFrustumSizeRatio (float)
 Until the render frustum estimation has been implemented to correctly cover the full view frustum, this frustum size modulation parameter can be used to enlarge the render frustum. More...
 
bool getCameraFromPosition (Camera vfrustum, Eigen::Vector3f position, Camera &rfrustum) override
 Calculates and returns a frustum, with optical center at the specified position, that contains the intersection between the provided frustum and the geometrical shape. More...
 
std::string getIntersectionCode () override
 Returns shader code that implements the necessary functions for the specific Geometry. More...
 
void setMapperUniforms (GLuint program) override
 Called by the code that is using this geometry object, to let the it set the uniforms used by the mapper code. More...
 
- Public Member Functions inherited from gramods::gmGraphics::Geometry
 Geometry (Impl *_impl=nullptr)
 
void setInside (bool on)
 Set true if the projection should be calculated for the inside of the geometry, and not the outside. More...
 
virtual std::string getDefaultKey () override
 Returns the default key, in Configuration, for the Object. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void initialize ()
 Called to initialize the Object. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
virtual void traverse (Visitor *visitor)
 Calls the child Object's accept method, if such exist. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmGraphics::Geometry
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Protected Attributes inherited from gramods::gmGraphics::Geometry
std::unique_ptr< Impl_impl
 

Detailed Description

SphereGeometry contains information for projection of graphics on a sphere.

This can be used for view correction of rendering in dome theatres.

Member Function Documentation

◆ getCameraFromPosition()

bool gramods::gmGraphics::SphereGeometry::getCameraFromPosition ( Camera  vfrustum,
Eigen::Vector3f  position,
Camera rfrustum 
)
overridevirtual

Calculates and returns a frustum, with optical center at the specified position, that contains the intersection between the provided frustum and the geometrical shape.

Parameters
[in]vfrustumThe view frustum, typically the frustum of a projector that projects onto a geometrical surface.
[in]positionThe rendering position, that will be the position of the returned render frustum.
[out]rfrustumThe render frustum, a frustum that will provide a rendering of the scene, from the provided position, onto the geometry where this geometry is seen by the vfrustum frustum.
Returns
True if a camera could be specified and false if there is no valid camera that fulfills the requirements.

Reimplemented from gramods::gmGraphics::Geometry.

◆ getIntersectionCode()

std::string gramods::gmGraphics::SphereGeometry::getIntersectionCode ( )
overridevirtual

Returns shader code that implements the necessary functions for the specific Geometry.

The code implements

  • vec3 getIntersection(vec3 pos, vec3 dir) - returns the intersection between the line defined by the specified position and direction vector and the SphereGeometry. Return (0,0) if there is no intersection.

Reimplemented from gramods::gmGraphics::Geometry.

◆ setFrustumSizeRatio()

void gramods::gmGraphics::SphereGeometry::setFrustumSizeRatio ( float  r)

Until the render frustum estimation has been implemented to correctly cover the full view frustum, this frustum size modulation parameter can be used to enlarge the render frustum.

Use this if you see D-shaped black regions at the edge of the view. Default is 1.0.

XML-attribute: frustumSizeRatio

◆ setMapperUniforms()

void gramods::gmGraphics::SphereGeometry::setMapperUniforms ( GLuint  program)
overridevirtual

Called by the code that is using this geometry object, to let the it set the uniforms used by the mapper code.

Reimplemented from gramods::gmGraphics::Geometry.

◆ setPosition()

void gramods::gmGraphics::SphereGeometry::setPosition ( Eigen::Vector3f  p)

Set the position of the sphere origin, its center.

XML-attribute: position

See also
gramods::operator>>(std::istream &, Eigen::Vector3f &)

◆ setRadius()

void gramods::gmGraphics::SphereGeometry::setRadius ( float  r)

Set the radius of the sphere.

XML-attribute: radius


The documentation for this class was generated from the following files: