faunus
Public Member Functions | List of all members
Faunus::Geometry::TwobodyAnglesState Class Reference

Structure for exploring a discrete, uniform angular space between two rigid bodies. More...

#include <geometry.h>

Inheritance diagram for Faunus::Geometry::TwobodyAnglesState:
Inheritance graph
[legend]
Collaboration diagram for Faunus::Geometry::TwobodyAnglesState:
Collaboration graph
[legend]

Public Member Functions

 TwobodyAnglesState (double angle_resolution)
 
TwobodyAnglesStateadvance ()
 Advance to next angle.
 
std::optional< std::pair< Eigen::Quaterniond, Eigen::Quaterniond > > get ()
 Get current pair of quaternions. More...
 
- Public Member Functions inherited from Faunus::Geometry::TwobodyAngles
 TwobodyAngles (double angle_resolution)
 
auto quaternionPairs () const
 Iterator to loop over pairs of quaternions to rotate two rigid bodies against each other. More...
 
size_t size () const
 Total number of points in angular space (i.e. the number of unique poses)
 

Additional Inherited Members

- Public Attributes inherited from Faunus::Geometry::TwobodyAngles
std::vector< Eigen::Quaterniond > quaternions_1
 Quaternions to explore all Euler angles.
 
std::vector< Eigen::Quaterniond > quaternions_2
 Quaternions to explore all Euler angles.
 
std::vector< Eigen::Quaterniond > dihedrals
 Quaternions to explore all dihedral angles.
 

Detailed Description

Structure for exploring a discrete, uniform angular space between two rigid bodies.

This version includes an iterator-like state that can be used to step through angular space.

Example:

TwobodyAnglesState angles(0.1);
if (const auto quaternions = angles.get(); quaternions) {
pos1 = quaternions->first * pos1; // first body
pos2 = quaternions->second * pos2; // second body
angles.advance();
} else {
// all angles have been explored
}

Member Function Documentation

◆ get()

std::optional< std::pair< Eigen::Quaterniond, Eigen::Quaterniond > > Faunus::Geometry::TwobodyAnglesState::get ( )

Get current pair of quaternions.

Returns
Pair of quaternions, one for each body, or std::nullopt of all angles have been explored.

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