Panda3D
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
Public Member Functions | List of all members
AnfaPhasedObject Class Reference
Inheritance diagram for AnfaPhasedObject:
PhasedObject

Public Member Functions

def __init__
 
def loadPhaseAt
 
def loadPhaseAway
 
def loadPhaseFar
 
def loadPhaseNear
 
def unloadPhaseAt
 
def unloadPhaseAway
 
def unloadPhaseFar
 
def unloadPhaseNear
 
- Public Member Functions inherited from PhasedObject
def __init__
 
def __repr__
 
def __str__
 
def cleanup
 
def getAliasPhase
 
def getPhase
 
def getPhaseAlias
 
def setAlias
 
def setPhase
 

Additional Inherited Members

- Public Attributes inherited from PhasedObject
 aliasPhaseMap
 
 phase
 
 phaseAliasMap
 
- Static Public Attributes inherited from PhasedObject
tuple notify = directNotify.newCategory("PhasedObject")
 

Detailed Description

This is an example class to demonstrate the concept of
alias mapping for PhasedObjects.

As the distance between an observer and this object closes,
we would set the phase level succesively higher, with an initial
phase of 'Away' being set in __init__:

setPhase('Far') -> invokes loadPhaseFar()
setPhase('Near') -> invokes loadPhaseNear()

Now let's say the objects start moving away from each other:

setPhase('Far') -> invokes unloadPhaseNear()
setPhase('Away') -> invokes unloadPhaseFar()

Now one object teleports to the other:

setPhase('At') -> invokes loadPhase('Far'),
                  then    loadPhase('Near'),
                  then    loadPhase('At')

Now the phased object is destroyed, we must clean it up
before removal:

cleanup() -> invokes unloadPhase('At')
             then    unloadPhase('Near')
             then    unloadPhase('Far')
             then    unloadPhase('Away')

Constructor & Destructor Documentation

def __init__ (   self)

Member Function Documentation

def loadPhaseAt (   self)
def loadPhaseAway (   self)
def loadPhaseFar (   self)
def loadPhaseNear (   self)
def unloadPhaseAt (   self)
def unloadPhaseAway (   self)
def unloadPhaseFar (   self)
def unloadPhaseNear (   self)