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

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

#include <AnimTrail.h>

Public 成员函数

 AnimTrail (int capacity=64)
 
 ~AnimTrail ()=default
 
 AnimTrail (const AnimTrail &)=delete
 
AnimTrailoperator= (const AnimTrail &)=delete
 
void setCapacity (int capacity)
 Max retained samples (ring). Clamped to >= 2.
 
int getCapacity () const
 
void setDuration (float seconds)
 How long each sample lives (seconds). <= 0 keeps until capacity eviction.
 
float getDuration () const
 
void setMinDistance (float distance)
 Skip new samples closer than this distance to the newest point (0 = always add).
 
float getMinDistance () const
 
void setWidth (float pixels)
 
float getWidth () const
 
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
 
float getColorG () const
 
float getColorB () const
 
float getColorA () const
 
void setFade (bool enable)
 
bool getFade () const
 
void setStyle (const std::string &style)
 "line" | "points". Invalid → exception.
 
std::string getStyle () const
 
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
 
float getDrawScaleY () const
 
void setDrawOffset (float ox, float oy)
 
float getDrawOffsetX () const
 
float getDrawOffsetY () const
 
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")
 
void clear ()
 
void update (float dt)
 Age samples by dt; drop expired (when duration > 0).
 
int getPointCount () const
 
float getPointX (int index) const
 Index 0 = oldest retained sample; count-1 = newest.
 
float getPointY (int index) const
 
float getPointZ (int index) const
 
float getPointAge (int index) const
 
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.update(dt); // eve_render: trail.draw(gfx);

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

在文件 AnimTrail.h31 行定义.

构造及析构函数说明

◆ AnimTrail() [1/2]

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

在文件 AnimTrail.cpp15 行定义.

引用了 setCapacity().

◆ ~AnimTrail()

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

◆ 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.cpp76 行定义.

引用了 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.cpp78 行定义.

引用了 x, y , 以及 z.

◆ clear()

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

在文件 AnimTrail.cpp139 行定义.

◆ draw()

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

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

在文件 AnimTrail.cpp235 行定义.

引用了 a, b , 以及 p.

◆ getCapacity()

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

在文件 AnimTrail.h41 行定义.

◆ getColorA()

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

在文件 AnimTrail.h59 行定义.

◆ getColorB()

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

在文件 AnimTrail.h58 行定义.

◆ getColorG()

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

在文件 AnimTrail.h57 行定义.

◆ getColorR()

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

在文件 AnimTrail.h56 行定义.

◆ getDrawOffsetX()

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

在文件 AnimTrail.h76 行定义.

◆ getDrawOffsetY()

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

在文件 AnimTrail.h77 行定义.

◆ getDrawScaleX()

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

在文件 AnimTrail.h73 行定义.

◆ getDrawScaleY()

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

在文件 AnimTrail.h74 行定义.

◆ getDuration()

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

在文件 AnimTrail.h45 行定义.

◆ getFade()

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

在文件 AnimTrail.h62 行定义.

◆ getMinDistance()

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

在文件 AnimTrail.h49 行定义.

◆ getPointAge()

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

在文件 AnimTrail.cpp177 行定义.

◆ getPointAlpha()

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

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

在文件 AnimTrail.cpp188 行定义.

◆ getPointCount()

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

在文件 AnimTrail.h98 行定义.

◆ getPointX()

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

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

在文件 AnimTrail.cpp162 行定义.

引用了 x.

◆ getPointY()

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

在文件 AnimTrail.cpp167 行定义.

引用了 y.

◆ getPointZ()

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

在文件 AnimTrail.cpp172 行定义.

引用了 z.

◆ getStyle()

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

在文件 AnimTrail.cpp62 行定义.

◆ getWidth()

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

在文件 AnimTrail.h52 行定义.

◆ 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.cpp101 行定义.

引用了 sampleBoneOffset().

◆ sampleBoneOffset()

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

◆ setCapacity()

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

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

在文件 AnimTrail.cpp19 行定义.

被这些函数引用 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.cpp41 行定义.

引用了 a , 以及 b.

◆ setDrawOffset()

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

在文件 AnimTrail.cpp71 行定义.

◆ 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.cpp66 行定义.

◆ setDuration()

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

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

在文件 AnimTrail.cpp27 行定义.

◆ setFade()

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

在文件 AnimTrail.cpp48 行定义.

◆ setMinDistance()

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

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

在文件 AnimTrail.cpp31 行定义.

◆ setStyle()

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

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

在文件 AnimTrail.cpp50 行定义.

◆ setWidth()

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

在文件 AnimTrail.cpp36 行定义.

◆ update()

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

Age samples by dt; drop expired (when duration > 0).

在文件 AnimTrail.cpp141 行定义.

引用了 p.


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