# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CTrackSampledVector Class Reference

This track is supposed to be Lighter in memory than CTrackKeyFramerTCBVector, and also is maybe faster. More...

#include <track_sampled_vector.h>

Inheritance diagram for NL3D::CTrackSampledVector:

NL3D::CTrackSampledCommon NL3D::ITrack NLMISC::IStreamable NL3D::UTrack NLMISC::IClassable List of all members.

Public Methods

 CTrackSampledVector ()
 Constructor. More...

virtual ~CTrackSampledVector ()
 NLMISC_DECLARE_CLASS (CTrackSampledVector)
void build (const std::vector< uint16 > &timeList, const std::vector< CVector > &keyList, float beginTime, float endTime)
 Build the track from a list of keys nlassert if ! same length. More...

virtual void eval (const TAnimationTime &date)
 Evaluation of the value of the track for this time. More...

virtual const IAnimatedValuegetValue () const
 Get the track current value. More...

virtual void serial (NLMISC::IStream &f)

Protected Attributes

CAnimatedValueVector _Value
NLMISC::CObjectVector< CVector,
false > 
_Keys

Detailed Description

This track is supposed to be Lighter in memory than CTrackKeyFramerTCBVector, and also is maybe faster.

The track is an oversampled version of CTrackKeyFramerTCBVector (or any vector interpolator), to 30 fps for example, but each key is 13 bytes in memory, instead of 96. Only linear interpolation is performed between 2 keys. And Keys are precomputed

13 bytes per key is achieved by encoding this way: 1 byte for the length/key time, measured in samples, and not in second (hence we can skip at max 255 keys). 12 byte for the position. May be compressed in future to 6 bytes.

Author:
Lionel Berenguier , Nevrax France
Date:
2002

Definition at line 53 of file track_sampled_vector.h.


Constructor & Destructor Documentation

NL3D::CTrackSampledVector::CTrackSampledVector  
 

Constructor.

Definition at line 46 of file track_sampled_vector.cpp.

NL3D::CTrackSampledVector::~CTrackSampledVector   [virtual]
 

Definition at line 51 of file track_sampled_vector.cpp.


Member Function Documentation

void NL3D::CTrackSampledVector::build const std::vector< uint16 > &    timeList,
const std::vector< CVector > &    keyList,
float    beginTime,
float    endTime
 

Build the track from a list of keys nlassert if ! same length.

Parameters:
timeList  the list of key time. First must be ==0. nlassert if difference between 2 keys is > 255
keyList  the list of keys, not yet compressed (done internally in future)
beginTime  map to the timeList[0] time.
endTime  map to the timeList[size-1] time.

Definition at line 79 of file track_sampled_vector.cpp.

References _Keys, NL3D::CTrackSampledCommon::_TimeBlocks, NLMISC::CObjectVector< CTimeBlock >::clear, NLMISC::CObjectVector< CVector, false >::clear, nlassert, and NLMISC::CObjectVector< CVector, false >::resize.

void NL3D::CTrackSampledVector::eval const TAnimationTime   date [virtual]
 

Evaluation of the value of the track for this time.

The result is internaly stored to simplify access at the polymorphic values. To get the value, call ITrack::getValue().

Implements NL3D::ITrack.

Definition at line 107 of file track_sampled_vector.cpp.

References _Keys, _Value, NL3D::CTrackSampledCommon::EvalDiscard, NL3D::CTrackSampledCommon::EvalInterpolate, NL3D::CTrackSampledCommon::EvalKey0, NL3D::CTrackSampledCommon::evalTime, nlstop, NLMISC::CObjectVector< CVector, false >::size, NL3D::TAnimationTime, and NL3D::CTrackSampledCommon::TEvalType.

const IAnimatedValue & NL3D::CTrackSampledVector::getValue   const [virtual]
 

Get the track current value.

Returns:
the last value evaluated by ITrack::eval().

Implements NL3D::ITrack.

Definition at line 56 of file track_sampled_vector.cpp.

References _Value.

NL3D::CTrackSampledVector::NLMISC_DECLARE_CLASS CTrackSampledVector   
 

void NL3D::CTrackSampledVector::serial NLMISC::IStream   f [virtual]
 

Implements NLMISC::IStreamable.

Definition at line 62 of file track_sampled_vector.cpp.

References _Keys, NLMISC::IStream::serial, and NLMISC::IStream::serialVersion.


Member Data Documentation

NLMISC::CObjectVector<CVector, false> NL3D::CTrackSampledVector::_Keys [protected]
 

Definition at line 84 of file track_sampled_vector.h.

Referenced by build, eval, and serial.

CAnimatedValueVector NL3D::CTrackSampledVector::_Value [protected]
 

Definition at line 81 of file track_sampled_vector.h.

Referenced by eval, and getValue.


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