Module MyGameObjects :: Class MY_GameObjectPassive
[hide private]
[frames] | no frames]

Class MY_GameObjectPassive

source code

Known Subclasses:

base class of all the objects in the game that are part of the environment, like platforms and stairs

Instance Methods [hide private]
 
__init__(self, scene, element) source code
Integer (0,1,2)
getPlane(self)
gets the world plane the object is in
source code
 
setNewPlaneOnRotation(self, prev_plane, connected_dir)
sets new plane after orthogonal rotation dependent on the plane of connected object and its connected direction
source code
Vector
getPosition(self)
gets the world position
source code
 
setConnectedSide(self, connected_side, connected_object)
sets list for connected sides with the right id at the right position in the array
source code
 
delConnectedSide(self, connected_object)
deletes entry out of the connected side list
source code
 
initPop(self, pop_steps, pop_start, duration)
initialize popping when object is spawned
source code
 
pop(self, do_pop, natal=True)
pops the object with its initialized parameters
source code
List
getChildren(self)
gets the direct children which are connected to the object
source code
 
setAlive(self, alive)
sets the object and its children to dead if necessary or the object to alive
source code
Boolean
deleteObject(self, now=False, recursive_delete=True)
deletes the object.
source code
Instance Variables [hide private]
Boolean alive
True if object is destined for deletion (in the future)
List boundingBox
contains all points of the bounding box which delimitates the object
Dict connectedSides
a dictionary (in form of a quadrupel) which contains the connected objects (otherwise: None) in specific way {north=+y, east=+x, south=-y, west=-x}
Integer curPopStep
the current pop step
Vector curScale
the current scale factor
Integer deleteDelay
the amount of the delay for deleting the object; set to '<0' for no deletion
Integer elementId
a unique identifier
KX_GameObject gObject
a blender game object
Boolean hasItem
True if the object has an item to administrate while deletion, otherwise False
MY_GameObject hurdleObject
the hurdle object that is on THIS object (for oneighty turns), if no hurdle is near this variable is 'None'
Integer (0,1,2) isRotated
three states: 0 = up; 1 = down; 2 = normal (in the xy-plane)
MY_GameObject item
the item object that is on top/bottom of tis object
String name
the name of the object
Vector origScale
the original scale factor
Integer popDuration
the duration of popping
Float popStart
the start time of popping
Integer popSteps
the number of steps for popping
MY_GameObject rootConnectObject
the connected object that leads to the players ground object
String type
a name which identifies the object as a specific class in MY_SingleScene
Integer (0,1,2,3) worldDirection
the global adjustment of the object (plane 0: 0=+y; 1=+x; 2=-y; 3=+x / plane 1: 0=+z; 1=+x; 2=-z; 3=+x / plane 2: 0=+z; 1=+y; 2=-z; 3=+y)
Integer (0,1,2) worldPlane
the objects plane information (0=xy; 1=xz; 2=yz)
Method Details [hide private]

__init__(self, scene, element)
(Constructor)

source code 
Parameters:
  • scene (KX_Scene) - the blender scene object which holds all objects
  • element (String) - the name of the object

getPlane(self)

source code 

gets the world plane the object is in

Returns: Integer (0,1,2)
  • returns '0' for xy plane
  • returns '1' for xz plane
  • returns '2' for yz plane

setNewPlaneOnRotation(self, prev_plane, connected_dir)

source code 

sets new plane after orthogonal rotation dependent on the plane of connected object and its connected direction

Parameters:
  • prev_plane (Integer (0,1,2)) - the plane of the connected object after ninety degree turn (dont know how to explain)
  • connected_dir (Integer (0,1,2,3)) - on which side is the connection (0:+y, 1:+x, 2:-y, 3:-x)

getPosition(self)

source code 

gets the world position

Returns: Vector
the vector of the current world position

setConnectedSide(self, connected_side, connected_object)

source code 

sets list for connected sides with the right id at the right position in the array

Parameters:
  • connected_side (Integer (0,1,2,3)) - on which side is the connection (0:+y, 1:+x, 2:-y, 3:-x)
  • connected_object (MY_GameObject) - the object which is connected to THIS object

delConnectedSide(self, connected_object)

source code 

deletes entry out of the connected side list

Parameters:
  • connected_object (MY_GameObject) - the connected object that was deleted

initPop(self, pop_steps, pop_start, duration)

source code 

initialize popping when object is spawned

Parameters:
  • pop_steps (Integer (> 0)) - how many steps are needed to pop up/down the object
  • pop_start (Float) - start time of popping
  • duration (Float) - for how long shall the object pop

pop(self, do_pop, natal=True)

source code 

pops the object with its initialized parameters

Parameters:
  • do_pop (Boolean) - do the pop (True) or not (False)
  • natal (Boolean) - whether it is the objects birth (True) or dead (False)

getChildren(self)

source code 

gets the direct children which are connected to the object

Returns: List
the list of the objects children

setAlive(self, alive)

source code 

sets the object and its children to dead if necessary or the object to alive

Parameters:
  • alive (Boolean) - True if the object will live further more

deleteObject(self, now=False, recursive_delete=True)

source code 

deletes the object. if a delay is given, the object will be deleted after the delay. with 'now' deletion can be forced all children can be deleted by setting the recursive_delete variable

Parameters:
  • now (Boolean) - False if the deletion will be delayed, otherwise delete it NOW
  • recursive_delete (Boolean) - True if children will also been deleted
Returns: Boolean
returns 'True' if object was deleted, otherwise 'False'