mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Support floating-point animation frame numbers
This commit is contained in:
parent
323fc0a798
commit
06907aa99b
22 changed files with 111 additions and 105 deletions
|
@ -19,11 +19,8 @@ irr::scene::SMeshBuffer etc. */
|
|||
class IAnimatedMesh : public IMesh
|
||||
{
|
||||
public:
|
||||
//! Gets the frame count of the animated mesh.
|
||||
/** Note that the play-time is usually getFrameCount()-1 as it stops as soon as the last frame-key is reached.
|
||||
\return The amount of frames. If the amount is 1,
|
||||
it is a static, non animated mesh. */
|
||||
virtual u32 getFrameCount() const = 0;
|
||||
//! Gets the maximum frame number, 0 if the mesh is static.
|
||||
virtual f32 getMaxFrameNumber() const = 0;
|
||||
|
||||
//! Gets the animation speed of the animated mesh.
|
||||
/** \return The number of frames per second to play the
|
||||
|
@ -39,19 +36,10 @@ public:
|
|||
virtual void setAnimationSpeed(f32 fps) = 0;
|
||||
|
||||
//! Returns the IMesh interface for a frame.
|
||||
/** \param frame: Frame number as zero based index. The maximum
|
||||
frame number is getFrameCount() - 1;
|
||||
\param detailLevel: Level of detail. 0 is the lowest, 255 the
|
||||
highest level of detail. Most meshes will ignore the detail level.
|
||||
\param startFrameLoop: Because some animated meshes (.MD2) are
|
||||
blended between 2 static frames, and maybe animated in a loop,
|
||||
the startFrameLoop and the endFrameLoop have to be defined, to
|
||||
prevent the animation to be blended between frames which are
|
||||
outside of this loop.
|
||||
If startFrameLoop and endFrameLoop are both -1, they are ignored.
|
||||
\param endFrameLoop: see startFrameLoop.
|
||||
\return Returns the animated mesh based on a detail level. */
|
||||
virtual IMesh *getMesh(s32 frame, s32 detailLevel = 255, s32 startFrameLoop = -1, s32 endFrameLoop = -1) = 0;
|
||||
/** \param frame: Frame number, >= 0, <= getMaxFrameNumber()
|
||||
Linear interpolation is used if this is between two frames.
|
||||
\return Returns the animated mesh for the given frame */
|
||||
virtual IMesh *getMesh(f32 frame) = 0;
|
||||
|
||||
//! Returns the type of the animated mesh.
|
||||
/** In most cases it is not necessary to use this method.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue