载入中...
搜索中...
未找到
eve::animation::AnimTrail类 参考

Motion trail / afterimage recorder + 2D trajectory drawer. 更多...

#include <AnimTrail.h>

Public 成员函数

 AnimTrail (int capacity=64)
 Anim trail.
 
 ~AnimTrail ()=default
 Anim trail.
 
 AnimTrail (const AnimTrail &)=delete
 
AnimTrail & operator= (const AnimTrail &)=delete
 
void setCapacity (int capacity)
 Max retained samples (ring). Clamped to >= 2.
 
int getCapacity () const
 Returns the capacity.
 
void setDuration (float seconds)
 How long each sample lives (seconds). <= 0 keeps until capacity eviction.
 
float getDuration () const
 Returns the duration.
 
void setMinDistance (float distance)
 Skip new samples closer than this distance to the newest point (0 = always add).
 
float getMinDistance () const
 Returns the min distance.
 
void setWidth (float pixels)
 Sets the width.
 
float getWidth () const
 Returns the width.
 
void setColor (float r, float g, float b, float a=1.f)
 Head (newest) color; alpha fades toward 0 along the trail when fade is on.
 
float getColorR () const
 Returns the color r.
 
float getColorG () const
 Returns the color g.
 
float getColorB () const
 Returns the color b.
 
float getColorA () const
 Returns the color a.
 
void setFade (bool enable)
 Sets the fade.
 
bool getFade () const
 Returns the fade.
 
void setStyle (const std::string &style)
 "line" | "points". Invalid → exception.
 
std::string getStyle () const
 Returns the style.
 
void setDrawScale (float sx, float sy)
 Applied at draw time: screen = (x,y) * scale + offset. Useful when sampling bone world units into pixel space.
 
float getDrawScaleX () const
 Returns the draw scale x.
 
float getDrawScaleY () const
 Returns the draw scale y.
 
void setDrawOffset (float ox, float oy)
 Sets the draw offset.
 
float getDrawOffsetX () const
 Returns the draw offset x.
 
float getDrawOffsetY () const
 Returns the draw offset y.
 
void addPoint (float x, float y)
 Append a 2D sample (z stored as 0).
 
void addPoint3 (float x, float y, float z)
 Append a 3D sample (draw uses set plane / first two mapped axes via sampleBone).
 
void sampleBone (const AnimPose *pose, int boneIndex, const std::string &plane="xy")
 Sample bone world position after pose->computeWorld. plane maps axes to draw (x,y): "xy" | "xz" | "yz". Optional local offset is applied in bone world space (translation only).
 
void sampleBoneOffset (const AnimPose *pose, int boneIndex, float ox, float oy, float oz, const std::string &plane="xy")
 Sample bone offset.
 
void clear ()
 Clears .
 
eve::Result< void > advance (const eve::SimulationStep &step)
 Age samples by one scheduler-owned deterministic step.
 
void update (float dt)
 Legacy seconds facade; explicitly forwards to advance().
 
int getPointCount () const
 Returns the point count.
 
float getPointX (int index) const
 Index 0 = oldest retained sample; count-1 = newest.
 
float getPointY (int index) const
 Returns the point y.
 
float getPointZ (int index) const
 Returns the point z.
 
float getPointAge (int index) const
 Returns the point age.
 
float getPointAlpha (int index) const
 Effective draw alpha in [0, colorA] after fade.
 
void draw (graphics::Graphics *gfx)
 Draw trajectory in 2D pixel/world space via Graphics.
 

详细描述

Motion trail / afterimage recorder + 2D trajectory drawer.

Records timed samples (manual points or bone world positions) and draws a fading path with Graphics::drawSolidRect (same dotted-segment style as Cloth). Script type: AnimTrail.

Typical frame: pose.computeWorld(sk); trail.sampleBone(pose, tipBone); // or addPoint(x, y) trail.advance(step); // eve_render: trail.draw(gfx);

Plane strings for 3D→2D projection: "xy" | "xz" | "yz". Draw styles: "line" (connected segments) | "points" (sample dots only).

在文件 AnimTrail.h 第 34 行定义.

构造及析构函数说明

◆ AnimTrail() [1/2]

eve::animation::AnimTrail::AnimTrail ( int  capacity = 64)
explicit

Anim trail.

在文件 AnimTrail.cpp 第 17 行定义.

引用了 capacity , 以及 setCapacity().

◆ ~AnimTrail()

eve::animation::AnimTrail::~AnimTrail ( )
default

Anim trail.

◆ AnimTrail() [2/2]

eve::animation::AnimTrail::AnimTrail ( const AnimTrail &  )
delete

成员函数说明

◆ addPoint()

void eve::animation::AnimTrail::addPoint ( float  x,
float  y 
)

Append a 2D sample (z stored as 0).

在文件 AnimTrail.cpp 第 78 行定义.

引用了 x , 以及 y.

◆ addPoint3()

void eve::animation::AnimTrail::addPoint3 ( float  x,
float  y,
float  z 
)

Append a 3D sample (draw uses set plane / first two mapped axes via sampleBone).

在文件 AnimTrail.cpp 第 80 行定义.

引用了 x, y , 以及 z.

◆ advance()

eve::Result< void > eve::animation::AnimTrail::advance ( const eve::SimulationStep &  step)

Age samples by one scheduler-owned deterministic step.

在文件 AnimTrail.cpp 第 158 行定义.

引用了 eve::Applied, eve::Result< T >::failure(), eve::animation::detail::secondsForStep(), step, eve::Status::success() , 以及 eve::Result< T >::success().

被这些函数引用 update().

◆ clear()

void eve::animation::AnimTrail::clear ( )

Clears .

在文件 AnimTrail.cpp 第 141 行定义.

◆ draw()

void eve::animation::AnimTrail::draw ( graphics::Graphics *  gfx)

Draw trajectory in 2D pixel/world space via Graphics.

在文件 AnimTrail.cpp 第 255 行定义.

引用了 a, b , 以及 p.

◆ getCapacity()

int eve::animation::AnimTrail::getCapacity ( ) const
inline

Returns the capacity.

在文件 AnimTrail.h 第 47 行定义.

◆ getColorA()

float eve::animation::AnimTrail::getColorA ( ) const
inline

Returns the color a.

在文件 AnimTrail.h 第 73 行定义.

◆ getColorB()

float eve::animation::AnimTrail::getColorB ( ) const
inline

Returns the color b.

在文件 AnimTrail.h 第 71 行定义.

◆ getColorG()

float eve::animation::AnimTrail::getColorG ( ) const
inline

Returns the color g.

在文件 AnimTrail.h 第 69 行定义.

◆ getColorR()

float eve::animation::AnimTrail::getColorR ( ) const
inline

Returns the color r.

在文件 AnimTrail.h 第 67 行定义.

◆ getDrawOffsetX()

float eve::animation::AnimTrail::getDrawOffsetX ( ) const
inline

Returns the draw offset x.

在文件 AnimTrail.h 第 97 行定义.

◆ getDrawOffsetY()

float eve::animation::AnimTrail::getDrawOffsetY ( ) const
inline

Returns the draw offset y.

在文件 AnimTrail.h 第 99 行定义.

◆ getDrawScaleX()

float eve::animation::AnimTrail::getDrawScaleX ( ) const
inline

Returns the draw scale x.

在文件 AnimTrail.h 第 91 行定义.

◆ getDrawScaleY()

float eve::animation::AnimTrail::getDrawScaleY ( ) const
inline

Returns the draw scale y.

在文件 AnimTrail.h 第 93 行定义.

◆ getDuration()

float eve::animation::AnimTrail::getDuration ( ) const
inline

Returns the duration.

在文件 AnimTrail.h 第 52 行定义.

◆ getFade()

bool eve::animation::AnimTrail::getFade ( ) const
inline

Returns the fade.

在文件 AnimTrail.h 第 78 行定义.

◆ getMinDistance()

float eve::animation::AnimTrail::getMinDistance ( ) const
inline

Returns the min distance.

在文件 AnimTrail.h 第 57 行定义.

◆ getPointAge()

float eve::animation::AnimTrail::getPointAge ( int  index) const

Returns the point age.

在文件 AnimTrail.cpp 第 197 行定义.

引用了 index.

◆ getPointAlpha()

float eve::animation::AnimTrail::getPointAlpha ( int  index) const

Effective draw alpha in [0, colorA] after fade.

在文件 AnimTrail.cpp 第 208 行定义.

引用了 index.

◆ getPointCount()

int eve::animation::AnimTrail::getPointCount ( ) const
inline

Returns the point count.

在文件 AnimTrail.h 第 125 行定义.

◆ getPointX()

float eve::animation::AnimTrail::getPointX ( int  index) const

Index 0 = oldest retained sample; count-1 = newest.

在文件 AnimTrail.cpp 第 182 行定义.

引用了 index , 以及 x.

◆ getPointY()

float eve::animation::AnimTrail::getPointY ( int  index) const

Returns the point y.

在文件 AnimTrail.cpp 第 187 行定义.

引用了 index , 以及 y.

◆ getPointZ()

float eve::animation::AnimTrail::getPointZ ( int  index) const

Returns the point z.

在文件 AnimTrail.cpp 第 192 行定义.

引用了 index , 以及 z.

◆ getStyle()

std::string eve::animation::AnimTrail::getStyle ( ) const

Returns the style.

在文件 AnimTrail.cpp 第 64 行定义.

◆ getWidth()

float eve::animation::AnimTrail::getWidth ( ) const
inline

Returns the width.

在文件 AnimTrail.h 第 62 行定义.

◆ operator=()

AnimTrail & eve::animation::AnimTrail::operator= ( const AnimTrail &  )
delete

◆ sampleBone()

void eve::animation::AnimTrail::sampleBone ( const AnimPose *  pose,
int  boneIndex,
const std::string &  plane = "xy" 
)

Sample bone world position after pose->computeWorld. plane maps axes to draw (x,y): "xy" | "xz" | "yz". Optional local offset is applied in bone world space (translation only).

在文件 AnimTrail.cpp 第 103 行定义.

引用了 pose , 以及 sampleBoneOffset().

◆ sampleBoneOffset()

void eve::animation::AnimTrail::sampleBoneOffset ( const AnimPose *  pose,
int  boneIndex,
float  ox,
float  oy,
float  oz,
const std::string &  plane = "xy" 
)

Sample bone offset.

在文件 AnimTrail.cpp 第 107 行定义.

引用了 ox, oy, pose, px, py, wx, wy , 以及 wz.

被这些函数引用 sampleBone().

◆ setCapacity()

void eve::animation::AnimTrail::setCapacity ( int  capacity)

Max retained samples (ring). Clamped to >= 2.

在文件 AnimTrail.cpp 第 21 行定义.

引用了 capacity.

被这些函数引用 AnimTrail().

◆ setColor()

void eve::animation::AnimTrail::setColor ( float  r,
float  g,
float  b,
float  a = 1.f 
)

Head (newest) color; alpha fades toward 0 along the trail when fade is on.

在文件 AnimTrail.cpp 第 43 行定义.

引用了 a, b, g , 以及 r.

◆ setDrawOffset()

void eve::animation::AnimTrail::setDrawOffset ( float  ox,
float  oy 
)

Sets the draw offset.

在文件 AnimTrail.cpp 第 73 行定义.

引用了 ox , 以及 oy.

◆ setDrawScale()

void eve::animation::AnimTrail::setDrawScale ( float  sx,
float  sy 
)

Applied at draw time: screen = (x,y) * scale + offset. Useful when sampling bone world units into pixel space.

在文件 AnimTrail.cpp 第 68 行定义.

引用了 sx , 以及 sy.

◆ setDuration()

void eve::animation::AnimTrail::setDuration ( float  seconds)

How long each sample lives (seconds). <= 0 keeps until capacity eviction.

在文件 AnimTrail.cpp 第 29 行定义.

◆ setFade()

void eve::animation::AnimTrail::setFade ( bool  enable)

Sets the fade.

在文件 AnimTrail.cpp 第 50 行定义.

◆ setMinDistance()

void eve::animation::AnimTrail::setMinDistance ( float  distance)

Skip new samples closer than this distance to the newest point (0 = always add).

在文件 AnimTrail.cpp 第 33 行定义.

引用了 distance.

◆ setStyle()

void eve::animation::AnimTrail::setStyle ( const std::string &  style)

"line" | "points". Invalid → exception.

在文件 AnimTrail.cpp 第 52 行定义.

◆ setWidth()

void eve::animation::AnimTrail::setWidth ( float  pixels)

Sets the width.

在文件 AnimTrail.cpp 第 38 行定义.

引用了 pixels.

◆ update()

void eve::animation::AnimTrail::update ( float  dt)

Legacy seconds facade; explicitly forwards to advance().

在文件 AnimTrail.cpp 第 167 行定义.

引用了 advance(), eve::Result< void >::ignore(), eve::animation::detail::legacyStep() , 以及 step.


该类的文档由以下文件生成: