|
def | __init__ (self, node, startPos=None, endPos=None, duration=None, startVel=None, endZ=None, wayPoint=None, timeToWayPoint=None, gravityMult=None, name=None, collNode=None) |
|
def | privInitialize (self, t) |
|
def | privInstant (self) |
|
def | privStep (self, t) |
|
def | testTrajectory (self) |
|
def | __init__ (self, name, duration, openEnded=1) |
|
def | __repr__ (self, indent=0) |
|
def | clearToInitial (self) |
|
def | finish (self) |
|
def | getDoneEvent (self) |
|
def | getDuration (self) |
|
def | getLoop (self) |
|
def | getName (self) |
|
def | getOpenEnded (self) |
|
def | getPlayRate (self) |
|
def | getState (self) |
|
def | getT (self) |
|
def | intervalDone (self) |
|
def | isPaused (self) |
|
def | isPlaying (self) |
|
def | isStopped (self) |
|
def | loop (self, startT=0.0, endT=-1.0, playRate=1.0) |
|
def | pause (self) |
|
def | popupControls (self, tl=None) |
|
def | privDoEvent (self, t, event) |
|
def | privFinalize (self) |
|
def | privInterrupt (self) |
|
def | privPostEvent (self) |
|
def | privReverseFinalize (self) |
|
def | privReverseInitialize (self, t) |
|
def | privReverseInstant (self) |
|
def | resume (self, startT=None) |
|
def | resumeUntil (self, endT) |
|
def | setDoneEvent (self, event) |
|
def | setLoop (self, loop=1) |
|
def | setPlayRate (self, playRate) |
|
def | setT (self, t) |
|
def | setupPlay (self, startT, endT, playRate, doLoop) |
|
def | setupResume (self) |
|
def | start (self, startT=0.0, endT=-1.0, playRate=1.0) |
|
def | stepPlay (self) |
|
def | __init__ (self) |
|
def | accept (self, event, method, extraArgs=[]) |
|
def | acceptOnce (self, event, method, extraArgs=[]) |
|
def | addTask (self, *args, **kwargs) |
|
def | detectLeaks (self) |
|
def | doMethodLater (self, *args, **kwargs) |
|
def | getAllAccepting (self) |
|
def | ignore (self, event) |
|
def | ignoreAll (self) |
|
def | isAccepting (self, event) |
|
def | isIgnoring (self, event) |
|
def | removeAllTasks (self) |
|
def | removeTask (self, taskOrName) |
|
ProjectileInterval class: moves a nodepath through the trajectory
of a projectile under the influence of gravity
def __init__ |
( |
|
self, |
|
|
|
node, |
|
|
|
startPos = None , |
|
|
|
endPos = None , |
|
|
|
duration = None , |
|
|
|
startVel = None , |
|
|
|
endZ = None , |
|
|
|
wayPoint = None , |
|
|
|
timeToWayPoint = None , |
|
|
|
gravityMult = None , |
|
|
|
name = None , |
|
|
|
collNode = None |
|
) |
| |
You may specify several different sets of input parameters.
(If startPos is not provided, it will be obtained from the node's
position at the time that the interval is first started. Note that
in this case you must provide a duration of some kind.)
# go from startPos to endPos in duration seconds
startPos, endPos, duration
# given a starting velocity, go for a specific time period
startPos, startVel, duration
# given a starting velocity, go until you hit a given Z plane
startPos, startVel, endZ
# pass through wayPoint at time 'timeToWayPoint'. Go until
# you hit a given Z plane
startPos, wayPoint, timeToWayPoint, endZ
You may alter gravity by providing a multiplier in 'gravityMult'.
'2.' will make gravity twice as strong, '.5' half as strong.
'-1.' will reverse gravity
If collNode is not None, it should be an empty CollisionNode
which will be filled with an appropriate CollisionParabola
when the interval starts. This CollisionParabola will be set
to match the interval's parabola, and its t1, t2 values will
be updated automatically as the interval plays. It will *not*
be automatically removed from the node when the interval
finishes.