Panda3D
Classes | Functions | Variables
direct.interval.IntervalTest Namespace Reference

Classes

class  DummyAcceptor
 

Functions

def caughtIt ()
 
def handleWaterDone ()
 
def printArguments (a, b, c)
 
def printDone ()
 
def printPreviousEnd ()
 
def printPreviousStart ()
 
def printStart ()
 
def printTrackStart ()
 
def test (n)
 

Variables

 base = ShowBase()
 
 boat = loader.loadModel('models/misc/smiley')
 
 BOAT_END = boatTrack.getIntervalEndTime('boatpath')
 
 BOAT_START = boatTrack.getIntervalStartTime('boatpath')
 
 boatMopath = MopathInterval(mp, boat, 'boatpath')
 
 boatTrack = Track([boatMopath], 'boattrack')
 
 da
 
 dock = loader.loadModel('models/misc/smiley')
 
 dockLerp
 
 dockLerp2 = LerpHprInterval(dock, 3.0, hpr2, name='hpr-lerp')
 
 dockPos = PosHprInterval(dock, dock.getPos(), dock.getHpr(), 1.0, 'dockpos')
 
 dockTrack = Track([dockLerp2, dockPos, dockLerp], 'docktrack')
 
 dockUpTime = BOAT_END - dockLerp.getDuration()
 
 donald = Actor()
 
 donaldLoopInterval = ActorInterval(donald, 'steer', loop=1, duration = 10.0)
 
 donaldSteerInterval = ActorInterval(donald, 'steer')
 
 donaldSteerTrack
 
 eventTime = soundTrack.getIntervalEndTime('watersound')
 
 foghorn = loader.loadSfx('phase_6/audio/sfx/SZ_DD_foghorn.mp3')
 
 foghornSound = SoundInterval(foghorn, name='foghorn')
 
float foghornStartTime = BOAT_START + 4.0
 
 hpr2 = Vec3(90.0, 90.0, 90.0)
 
 i1 = FunctionInterval(lambda: base.transitions.fadeOut())
 Using lambdas and functions ### Using a lambda. More...
 
 i2 = FunctionInterval(lambda: base.transitions.fadeIn())
 
 i3 = AcceptInterval(da, 'here-is-an-event', caughtIt)
 
 i4 = EventInterval('here-is-an-event')
 
 i5 = IgnoreInterval(da, 'here-is-an-event')
 
 i6 = FunctionInterval(printDone)
 
 i7 = FunctionInterval(printArguments, extraArgs = [1, 10, 100])
 
 mp = Mopath.Mopath()
 
 mtrack
 
 sound = loader.loadSfx('phase_6/audio/sfx/SZ_DD_waterlap.mp3')
 
 soundTrack = Track([waterSound], 'soundtrack')
 
 soundTrack2 = Track([(foghornStartTime, foghornSound)], 'soundtrack2')
 
float startTime = 0.0
 Specifying interval start times during track construction ### Interval start time can be specified relative to three different points: PREVIOUS_END PREVIOUS_START TRACK_START. More...
 
 t1
 
 t2
 
 waterDone = EventInterval('water-is-done')
 
 waterEventTrack = Track([waterDone])
 
 waterSound = SoundInterval(sound, name='watersound')
 
float waterStartTime = BOAT_START + 5.0
 

Detailed Description

Undocumented Module

Function Documentation

◆ caughtIt()

def direct.interval.IntervalTest.caughtIt ( )

◆ handleWaterDone()

def direct.interval.IntervalTest.handleWaterDone ( )

◆ printArguments()

def direct.interval.IntervalTest.printArguments (   a,
  b,
  c 
)

◆ printDone()

def direct.interval.IntervalTest.printDone ( )

◆ printPreviousEnd()

def direct.interval.IntervalTest.printPreviousEnd ( )

◆ printPreviousStart()

def direct.interval.IntervalTest.printPreviousStart ( )

◆ printStart()

def direct.interval.IntervalTest.printStart ( )

◆ printTrackStart()

def direct.interval.IntervalTest.printTrackStart ( )

◆ test()

def direct.interval.IntervalTest.test (   n)

Variable Documentation

◆ base

base = ShowBase()

◆ boat

boat = loader.loadModel('models/misc/smiley')

◆ BOAT_END

BOAT_END = boatTrack.getIntervalEndTime('boatpath')

◆ BOAT_START

BOAT_START = boatTrack.getIntervalStartTime('boatpath')

◆ boatMopath

boatMopath = MopathInterval(mp, boat, 'boatpath')

◆ boatTrack

boatTrack = Track([boatMopath], 'boattrack')

◆ da

da

◆ dock

dock = loader.loadModel('models/misc/smiley')

◆ dockLerp

dockLerp
Initial value:
1 = LerpPosHprInterval(dock, 5.0,
2  pos=Point3(0, 0, -5),
3  hpr=Vec3(0, 0, 0),
4  name='dock-lerp')

◆ dockLerp2

dockLerp2 = LerpHprInterval(dock, 3.0, hpr2, name='hpr-lerp')

◆ dockPos

dockPos = PosHprInterval(dock, dock.getPos(), dock.getHpr(), 1.0, 'dockpos')

◆ dockTrack

dockTrack = Track([dockLerp2, dockPos, dockLerp], 'docktrack')

◆ dockUpTime

dockUpTime = BOAT_END - dockLerp.getDuration()

◆ donald

donald = Actor()

◆ donaldLoopInterval

donaldLoopInterval = ActorInterval(donald, 'steer', loop=1, duration = 10.0)

◆ donaldSteerInterval

donaldSteerInterval = ActorInterval(donald, 'steer')

◆ donaldSteerTrack

donaldSteerTrack
Initial value:
1 = Track([donaldSteerInterval, donaldLoopInterval],
2  name = 'steerTrack')

◆ eventTime

eventTime = soundTrack.getIntervalEndTime('watersound')

◆ foghorn

foghorn = loader.loadSfx('phase_6/audio/sfx/SZ_DD_foghorn.mp3')

◆ foghornSound

foghornSound = SoundInterval(foghorn, name='foghorn')

◆ foghornStartTime

float foghornStartTime = BOAT_START + 4.0

◆ hpr2

hpr2 = Vec3(90.0, 90.0, 90.0)

◆ i1

i1 = FunctionInterval(lambda: base.transitions.fadeOut())

Using lambdas and functions ### Using a lambda.

◆ i2

i2 = FunctionInterval(lambda: base.transitions.fadeIn())

◆ i3

i3 = AcceptInterval(da, 'here-is-an-event', caughtIt)

◆ i4

i4 = EventInterval('here-is-an-event')

◆ i5

i5 = IgnoreInterval(da, 'here-is-an-event')

◆ i6

◆ i7

i7 = FunctionInterval(printArguments, extraArgs = [1, 10, 100])

◆ mp

mp = Mopath.Mopath()

◆ mtrack

mtrack
Initial value:
1 = MultiTrack([boatTrack, dockTrack, soundTrack, soundTrack2, waterEventTrack,
2  donaldSteerTrack])

◆ sound

sound = loader.loadSfx('phase_6/audio/sfx/SZ_DD_waterlap.mp3')

◆ soundTrack

soundTrack = Track([waterSound], 'soundtrack')

◆ soundTrack2

soundTrack2 = Track([(foghornStartTime, foghornSound)], 'soundtrack2')

◆ startTime

float startTime = 0.0

Specifying interval start times during track construction ### Interval start time can be specified relative to three different points: PREVIOUS_END PREVIOUS_START TRACK_START.

◆ t1

t1
Initial value:
1 = Track([
2  # Fade out
3  (0.0, i1),
4  # Fade in
5  (2.0, i2),
6  # Accept event
7  (4.0, i3),
8  # Throw it,
9  (5.0, i4),
10  # Ignore event
11  (6.0, i5),
12  # Throw event again and see if ignore worked
13  (7.0, i4),
14  # Print done
15  (8.0, i6)], name = 'demo')

◆ t2

t2
Initial value:
1 = Track([(0.0, i1), # i1 start at t = 0, duration = 0.0
2  (1.0, i2, TRACK_START), # i2 start at t = 1, duration = 2.0
3  (2.0, i3, PREVIOUS_END), # i3 start at t = 5, duration = 0.0
4  (1.0, i4, PREVIOUS_END), # i4 start at t = 6, duration = 2.0
5  (3.0, i5, PREVIOUS_START), # i5 start at t = 9, duration = 0.0
6  (10.0, i6, TRACK_START), # i6 start at t = 10, duration = 0.0
7  (12.0, i7)], # i7 start at t = 12, duration = 0.0
8  name = 'startTimeDemo')

◆ waterDone

waterDone = EventInterval('water-is-done')

◆ waterEventTrack

waterEventTrack = Track([waterDone])

◆ waterSound

waterSound = SoundInterval(sound, name='watersound')

◆ waterStartTime

float waterStartTime = BOAT_START + 5.0