Panda3D
|
An interval that lerps one or more properties (like pos, hpr, etc.) on a NodePath over time. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ (const CLerpNodePathInterval) | |
__init__ (str name, double duration, CLerpInterval::BlendType blend_type, bool bake_in_start, bool fluid, const NodePath node, const NodePath other) | |
Constructs a lerp interval that will lerp some properties on the indicated node, possibly relative to the indicated other node (if other is nonempty). More... | |
const NodePath | getNode () |
Returns the node being lerped. More... | |
const NodePath | getOther () |
Returns the "other" node, which the lerped node is being moved relative to. More... | |
int | getOverride () |
Returns the override value that will be associated with any state changes applied by the lerp. More... | |
setEndColor (const LVecBase4 color) | |
Indicates that the color of the node should be lerped, and specifies the final color of the node. More... | |
setEndColorScale (const LVecBase4 color_scale) | |
Indicates that the color scale of the node should be lerped, and specifies the final color scale of the node. More... | |
setEndHpr (const LQuaternion quat) | |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node. More... | |
setEndHpr (const LVecBase3 hpr) | |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node. More... | |
setEndPos (const LVecBase3 pos) | |
Indicates that the position of the node should be lerped, and specifies the final position of the node. More... | |
setEndQuat (const LQuaternion quat) | |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node. More... | |
setEndQuat (const LVecBase3 hpr) | |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node. More... | |
setEndScale (const LVecBase3 scale) | |
Indicates that the scale of the node should be lerped, and specifies the final scale of the node. More... | |
setEndScale (float scale) | |
Indicates that the scale of the node should be lerped, and specifies the final scale of the node. More... | |
setEndShear (const LVecBase3 shear) | |
Indicates that the shear of the node should be lerped, and specifies the final shear of the node. More... | |
setEndTexOffset (const LVecBase2 tex_offset) | |
Indicates that the UV offset of the node should be lerped, and specifies the final UV offset of the node. More... | |
setEndTexRotate (float tex_rotate) | |
Indicates that the UV rotate of the node should be lerped, and specifies the final UV rotate of the node. More... | |
setEndTexScale (const LVecBase2 tex_scale) | |
Indicates that the UV scale of the node should be lerped, and specifies the final UV scale of the node. More... | |
setOverride (int override) | |
Changes the override value that will be associated with any state changes applied by the lerp. More... | |
setStartColor (const LVecBase4 color) | |
Indicates the initial color of the lerped node. More... | |
setStartColorScale (const LVecBase4 color_scale) | |
Indicates the initial color scale of the lerped node. More... | |
setStartHpr (const LVecBase3 hpr) | |
Indicates the initial rotation of the lerped node. More... | |
setStartPos (const LVecBase3 pos) | |
Indicates the initial position of the lerped node. More... | |
setStartQuat (const LQuaternion quat) | |
Indicates the initial rotation of the lerped node. More... | |
setStartScale (const LVecBase3 scale) | |
Indicates the initial scale of the lerped node. More... | |
setStartScale (float scale) | |
Indicates the initial scale of the lerped node. More... | |
setStartShear (const LVecBase3 shear) | |
Indicates the initial shear of the lerped node. More... | |
setStartTexOffset (const LVecBase2 tex_offset) | |
Indicates the initial UV offset of the lerped node. More... | |
setStartTexRotate (float tex_rotate) | |
Indicates the initial UV rotate of the lerped node. More... | |
setStartTexScale (const LVecBase2 tex_scale) | |
Indicates the initial UV scale of the lerped node. More... | |
setTextureStage (TextureStage stage) | |
Indicates the texture stage that is adjusted by tex_offset, tex_rotate, and/or tex_scale. More... | |
![]() | |
__init__ (const CLerpInterval) | |
CLerpInterval::BlendType | getBlendType () |
Returns the blend type specified for the interval. More... | |
![]() | |
object | __await__ () |
__init__ (const CInterval) | |
clearToInitial () | |
Pauses the interval, if it is playing, and resets its state to its initial state, abandoning any state changes already in progress in the middle of the interval. More... | |
finish () | |
Stops the interval from playing and sets it to its final state. More... | |
bool | getAutoFinish () |
Returns the state of the 'auto_finish' flag. More... | |
bool | getAutoPause () |
Returns the state of the 'auto_pause' flag. More... | |
str | getDoneEvent () |
Returns the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own. More... | |
double | getDuration () |
Returns the duration of the interval in seconds. More... | |
CIntervalManager | getManager () |
Returns the CIntervalManager object which will be responsible for playing this interval. More... | |
str | getName () |
Returns the interval's name. More... | |
bool | getOpenEnded () |
Returns the state of the "open_ended" flag. More... | |
double | getPlayRate () |
Returns the play rate as set by the last call to start(), loop(), or set_play_rate(). More... | |
CInterval::State | getState () |
Indicates the state the interval believes it is in: whether it has been started, is currently in the middle, or has been finalized. More... | |
double | getT () |
Returns the current time of the interval: the last value of t passed to priv_initialize(), priv_step(), or priv_finalize(). More... | |
bool | getWantsTCallback () |
Returns the state of the 'wants_t_callback' flag. More... | |
bool | isPlaying () |
Returns true if the interval is currently playing, false otherwise. More... | |
bool | isStopped () |
Returns true if the interval is in either its initial or final states (but not in a running or paused state). More... | |
loop (double start_t, double end_t, double play_rate) | |
Starts the interval playing by registering it with the current CIntervalManager. More... | |
output (Ostream out) | |
double | pause () |
Stops the interval from playing but leaves it in its current state. More... | |
privDoEvent (double t, CInterval::EventType event) | |
privFinalize () | |
This is called to stop an interval, forcing it to whatever state it would be after it played all the way through. More... | |
privInitialize (double t) | |
This replaces the first call to priv_step(), and indicates that the interval has just begun. More... | |
privInstant () | |
This is called in lieu of priv_initialize() . More... | |
privInterrupt () | |
This is called while the interval is playing to indicate that it is about to be interrupted; that is, priv_step() will not be called for a length of time. More... | |
privReverseFinalize () | |
Called generally following a priv_reverse_initialize(), this indicates the interval should set itself to the initial state. More... | |
privReverseInitialize (double t) | |
Similar to priv_initialize(), but this is called when the interval is being played backwards; it indicates that the interval should start at the finishing state and undo any intervening intervals. More... | |
privReverseInstant () | |
This is called in lieu of priv_reverse_initialize() . More... | |
privStep (double t) | |
Advances the time on the interval. More... | |
resume () | |
Restarts the interval from its current point after a previous call to pause(). More... | |
resume (double start_t) | |
Restarts the interval from the indicated point after a previous call to pause(). More... | |
resumeUntil (double end_t) | |
Restarts the interval from the current point after a previous call to pause() (or a previous play-to-point-and-stop), to play until the indicated point and then stop. More... | |
setAutoFinish (bool auto_finish) | |
Changes the state of the 'auto_finish' flag. More... | |
setAutoPause (bool auto_pause) | |
Changes the state of the 'auto_pause' flag. More... | |
setDoneEvent (str event) | |
Sets the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own. More... | |
setManager (CIntervalManager manager) | |
Indicates the CIntervalManager object which will be responsible for playing this interval. More... | |
setPlayRate (double play_rate) | |
Changes the play rate of the interval. More... | |
setT (double t) | |
Explicitly sets the time within the interval. More... | |
setupPlay (double start_time, double end_time, double play_rate, bool do_loop) | |
Called to prepare the interval for automatic timed playback, e.g. More... | |
setupResume () | |
Called to prepare the interval for restarting at the current point within the interval after an interruption. More... | |
setupResumeUntil (double end_t) | |
Called to prepare the interval for restarting from the current point after a previous call to pause() (or a previous play-to-point-and-stop), to play until the indicated point and then stop. More... | |
setWantsTCallback (bool wants_t_callback) | |
Changes the state of the 'wants_t_callback' flag. More... | |
start (double start_t, double end_t, double play_rate) | |
Starts the interval playing by registering it with the current CIntervalManager. More... | |
bool | stepPlay () |
Should be called once per frame to execute the automatic timed playback begun with setup_play(). More... | |
write (Ostream out, int indent_level) | |
![]() | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. More... | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. More... | |
![]() | |
int | getRefCount () |
Returns the current reference count. More... | |
ref () | |
Explicitly increments the reference count. More... | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
bool | unref () |
Explicitly decrements the reference count. More... | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
static CLerpInterval::BlendType | stringBlendType (str blend_type) |
Returns the BlendType enumerated value corresponding to the indicated string, or BT_invalid if the string doesn't match anything. More... | |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
Additional Inherited Members | |
![]() | |
enum | BlendType { BT_no_blend = 0 , BT_ease_in = 1 , BT_ease_out = 2 , BT_ease_in_out = 3 , BT_invalid = 4 } |
![]() | |
enum | EventType { ET_initialize = 0 , ET_instant = 1 , ET_step = 2 , ET_finalize = 3 , ET_reverse_initialize = 4 , ET_reverse_instant = 5 , ET_reverse_finalize = 6 , ET_interrupt = 7 } |
enum | State { S_initial = 0 , S_started = 1 , S_paused = 2 , S_final = 3 } |
![]() | |
bool | auto_finish |
Returns the state of the 'auto_finish' flag. More... | |
bool | auto_pause |
Returns the state of the 'auto_pause' flag. More... | |
const String | done_event |
Returns the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own. More... | |
double | duration |
Returns the duration of the interval in seconds. More... | |
CIntervalManager | manager |
Returns the CIntervalManager object which will be responsible for playing this interval. More... | |
const String | name |
Returns the interval's name. More... | |
bool | open_ended |
Returns the state of the "open_ended" flag. More... | |
double | play_rate |
Returns the play rate as set by the last call to start(), loop(), or set_play_rate(). More... | |
bool | playing |
Returns true if the interval is currently playing, false otherwise. More... | |
CInterval::State | state |
Indicates the state the interval believes it is in: whether it has been started, is currently in the middle, or has been finalized. More... | |
bool | stopped |
Returns true if the interval is in either its initial or final states (but not in a running or paused state). More... | |
double | t |
Returns the current time of the interval: the last value of t passed to priv_initialize(), priv_step(), or priv_finalize(). More... | |
![]() | |
TypeHandle | type |
Returns the TypeHandle representing this object's type. More... | |
![]() | |
int | ref_count |
The current reference count. More... | |
An interval that lerps one or more properties (like pos, hpr, etc.) on a NodePath over time.
__init__ | ( | const | CLerpNodePathInterval | ) |
__init__ | ( | str | name, |
double | duration, | ||
CLerpInterval::BlendType | blend_type, | ||
bool | bake_in_start, | ||
bool | fluid, | ||
const NodePath | node, | ||
const NodePath | other | ||
) |
Constructs a lerp interval that will lerp some properties on the indicated node, possibly relative to the indicated other node (if other is nonempty).
You must call set_end_pos(), etc. for the various properties you wish to lerp before the first call to priv_initialize(). If you want to set a starting value for any of the properties, you may call set_start_pos(), etc.; otherwise, the starting value is taken from the actual node's value at the time the lerp is performed.
The starting values may be explicitly specified or omitted. The value of bake_in_start determines the behavior if the starting values are omitted. If bake_in_start is true, the values are obtained the first time the lerp runs, and thenceforth are stored within the interval. If bake_in_start is false, the starting value is computed each frame, based on assuming the current value represents the value set from the last time the interval was run. This "smart" behavior allows code to manipulate the object event while it is being lerped, and the lerp continues to apply in a sensible way.
If fluid is true, the prev_transform is not adjusted by the lerp; otherwise, it is reset.
|
static |
const NodePath getNode | ( | ) |
Returns the node being lerped.
const NodePath getOther | ( | ) |
Returns the "other" node, which the lerped node is being moved relative to.
If this is an empty node path, the lerped node is being moved in its own coordinate system.
int getOverride | ( | ) |
Returns the override value that will be associated with any state changes applied by the lerp.
See set_override().
setEndColor | ( | const LVecBase4 | color | ) |
Indicates that the color of the node should be lerped, and specifies the final color of the node.
This should be called before priv_initialize(). If this is not called, the node's color will not be affected by the lerp.
setEndColorScale | ( | const LVecBase4 | color_scale | ) |
Indicates that the color scale of the node should be lerped, and specifies the final color scale of the node.
This should be called before priv_initialize(). If this is not called, the node's color scale will not be affected by the lerp.
setEndHpr | ( | const LQuaternion | quat | ) |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node.
This should be called before priv_initialize().
This special function is overloaded to accept a quaternion, even though the function name is set_end_hpr(). The quaternion will be implicitly converted to a HPR trio, and the lerp will be performed in HPR space, componentwise.
setEndHpr | ( | const LVecBase3 | hpr | ) |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node.
This should be called before priv_initialize().
This replaces a previous call to set_end_quat(). If neither set_end_hpr() nor set_end_quat() is called, the node's rotation will not be affected by the lerp.
setEndPos | ( | const LVecBase3 | pos | ) |
Indicates that the position of the node should be lerped, and specifies the final position of the node.
This should be called before priv_initialize(). If this is not called, the node's position will not be affected by the lerp.
setEndQuat | ( | const LQuaternion | quat | ) |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node.
This should be called before priv_initialize().
This replaces a previous call to set_end_hpr(). If neither set_end_quat() nor set_end_hpr() is called, the node's rotation will not be affected by the lerp.
The given quaternion needs to be normalized.
setEndQuat | ( | const LVecBase3 | hpr | ) |
Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node.
This should be called before priv_initialize().
This replaces a previous call to set_end_hpr(). If neither set_end_quat() nor set_end_hpr() is called, the node's rotation will not be affected by the lerp.
This special function is overloaded to accept a HPR trio, even though the function name is set_end_quat(). The HPR will be implicitly converted to a quaternion, and the lerp will be performed in quaternion space, as a spherical lerp.
setEndScale | ( | const LVecBase3 | scale | ) |
Indicates that the scale of the node should be lerped, and specifies the final scale of the node.
This should be called before priv_initialize(). If this is not called, the node's scale will not be affected by the lerp.
setEndScale | ( | float | scale | ) |
Indicates that the scale of the node should be lerped, and specifies the final scale of the node.
This should be called before priv_initialize(). If this is not called, the node's scale will not be affected by the lerp.
setEndShear | ( | const LVecBase3 | shear | ) |
Indicates that the shear of the node should be lerped, and specifies the final shear of the node.
This should be called before priv_initialize(). If this is not called, the node's shear will not be affected by the lerp.
setEndTexOffset | ( | const LVecBase2 | tex_offset | ) |
Indicates that the UV offset of the node should be lerped, and specifies the final UV offset of the node.
This should be called before priv_initialize(). If this is not called, the node's UV offset will not be affected by the lerp.
setEndTexRotate | ( | float | tex_rotate | ) |
Indicates that the UV rotate of the node should be lerped, and specifies the final UV rotate of the node.
This should be called before priv_initialize(). If this is not called, the node's UV rotate will not be affected by the lerp.
setEndTexScale | ( | const LVecBase2 | tex_scale | ) |
Indicates that the UV scale of the node should be lerped, and specifies the final UV scale of the node.
This should be called before priv_initialize(). If this is not called, the node's UV scale will not be affected by the lerp.
setOverride | ( | int | override | ) |
Changes the override value that will be associated with any state changes applied by the lerp.
If this lerp is changing state (for instance, a color lerp or a tex matrix lerp), then the new attributes created by this lerp will be assigned the indicated override value when they are applied to the node.
setStartColor | ( | const LVecBase4 | color | ) |
Indicates the initial color of the lerped node.
This is meaningful only if set_end_color() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual color at the time the lerp is performed.
setStartColorScale | ( | const LVecBase4 | color_scale | ) |
Indicates the initial color scale of the lerped node.
This is meaningful only if set_end_color_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual color scale at the time the lerp is performed.
setStartHpr | ( | const LVecBase3 | hpr | ) |
Indicates the initial rotation of the lerped node.
This is meaningful only if either set_end_hpr() or set_end_quat() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual rotation at the time the lerp is performed.
setStartPos | ( | const LVecBase3 | pos | ) |
Indicates the initial position of the lerped node.
This is meaningful only if set_end_pos() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual position at the time the lerp is performed.
setStartQuat | ( | const LQuaternion | quat | ) |
Indicates the initial rotation of the lerped node.
This is meaningful only if either set_end_quat() or set_end_hpr() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual rotation at the time the lerp is performed.
The given quaternion needs to be normalized.
setStartScale | ( | const LVecBase3 | scale | ) |
Indicates the initial scale of the lerped node.
This is meaningful only if set_end_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual scale at the time the lerp is performed.
setStartScale | ( | float | scale | ) |
Indicates the initial scale of the lerped node.
This is meaningful only if set_end_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual scale at the time the lerp is performed.
setStartShear | ( | const LVecBase3 | shear | ) |
Indicates the initial shear of the lerped node.
This is meaningful only if set_end_shear() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual shear at the time the lerp is performed.
setStartTexOffset | ( | const LVecBase2 | tex_offset | ) |
Indicates the initial UV offset of the lerped node.
This is meaningful only if set_end_tex_offset() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual UV offset at the time the lerp is performed.
setStartTexRotate | ( | float | tex_rotate | ) |
Indicates the initial UV rotate of the lerped node.
This is meaningful only if set_end_tex_rotate() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual UV rotate at the time the lerp is performed.
setStartTexScale | ( | const LVecBase2 | tex_scale | ) |
Indicates the initial UV scale of the lerped node.
This is meaningful only if set_end_tex_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual UV scale at the time the lerp is performed.
setTextureStage | ( | TextureStage | stage | ) |
Indicates the texture stage that is adjusted by tex_offset, tex_rotate, and/or tex_scale.
If this is not set, the default is the default texture stage.