GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
gpu_coverage::Channel Class Reference

Animation channel. More...

#include <Channel.h>

Public Member Functions

 Channel (Scene *const scene, const aiNodeAnim *const channel, const size_t id)
 Constructor. More...
 
virtual ~Channel ()
 Destructor.
 
void setFrame (const size_t frame)
 Set the current frame of the animation. More...
 
NodegetNode () const
 Returns the scene graph node that this camera is attached to. More...
 
const size_t & getStartFrame () const
 Frame number where this animation channel starts. More...
 
const size_t & getEndFrame () const
 Frame number where this animation channel ends. More...
 
const size_t & getNumFrames () const
 Duration of this animation channel in frames. More...
 
const glm::mat4 & getLocalTransform () const
 Returns the current local transform. More...
 

Protected Types

typedef std::map< size_t, glm::vec3 > Locations
 Location key frames, maps frame number to location vector.
 
typedef std::map< size_t, glm::quat > Rotations
 Rotation key frames, maps frame number to rotation quaternion.
 
typedef std::map< size_t, glm::vec3 > Scales
 Scale key frames, maps frame number to scale vector.
 

Protected Member Functions

size_t timeToFrame (const double &time) const
 Converts time in seconds to frame number. More...
 

Static Protected Member Functions

template<class M >
static std::pair< typename M::const_iterator, typename M::const_iterator > findInterval (const M &map, const typename M::key_type &key)
 

Protected Attributes

const size_t id
 Unique ID, see getId().
 
Node *const node
 The scene graph node assigned to this animation channel, see getNode().
 
Locations locations
 Location keyframes.
 
Rotations rotations
 Rotation keyframes.
 
Scales scales
 Scale keyframes.
 
glm::mat4 localTransform
 Local transform matrix of the animation channel.
 
size_t startFrame
 Start frame of the animation.
 
size_t endFrame
 End frame of the animation.
 
size_t numFrames
 Number of frames of the animation.
 

Detailed Description

Animation channel.

Corresponds to Assimp's aiNodeAnim.

Constructor & Destructor Documentation

gpu_coverage::Channel::Channel ( Scene *const  scene,
const aiNodeAnim *const  channel,
const size_t  id 
)

Constructor.

Parameters
[in]sceneScene that contains this channel.
[in]channelThe Assimp aiNodeAnim for creating this channel.
[in]idUnique ID of this channel.

Member Function Documentation

template<class M >
static std::pair<typename M::const_iterator, typename M::const_iterator> gpu_coverage::Channel::findInterval ( const M &  map,
const typename M::key_type &  key 
)
inlinestaticprotected

Finds the nearest two key frames in a keyframe map.

Template Parameters
MThe keyframe map type
Parameters
[in]mapKeyframe map
[in]keyKey
Returns
Pair of iterators to key frames.
const size_t& gpu_coverage::Channel::getEndFrame ( ) const
inline

Frame number where this animation channel ends.

Returns
End frame.
const glm::mat4& gpu_coverage::Channel::getLocalTransform ( ) const
inline

Returns the current local transform.

Returns
Local transform.

Call setFrame() first to set the frame and to recalculate the local transform.

Node* gpu_coverage::Channel::getNode ( ) const
inline

Returns the scene graph node that this camera is attached to.

Returns
The scene graph node.

The node is set in the constructor based on the aiNodeAnim::mNodeName field.

const size_t& gpu_coverage::Channel::getNumFrames ( ) const
inline

Duration of this animation channel in frames.

Returns
Number of frames.
const size_t& gpu_coverage::Channel::getStartFrame ( ) const
inline

Frame number where this animation channel starts.

Returns
Start frame.
void gpu_coverage::Channel::setFrame ( const size_t  frame)

Set the current frame of the animation.

Parameters
[in]frameFrame number of the animation.

Setting the frame usually changes the local transform that can be retrieved afterwards using getLocalTransform().

size_t gpu_coverage::Channel::timeToFrame ( const double &  time) const
protected

Converts time in seconds to frame number.

Parameters
[in]timeTime in seconds.
Returns
Corresponding frame number.

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