Module MyGamePassiveParts :: Class MY_GamePlatform
[hide private]
[frames] | no frames]

Class MY_GamePlatform

source code

MyGameObjects.MY_GameObjectPassive --+
                                     |
                                    MY_GamePlatform

class of the platform objects in the game for right rotation and translation etc.

Instance Methods [hide private]
 
__init__(self, scene) source code
 
setElement(self, side_location, prev_plane, rotated, direct=0)
initiates the calculation of position, orientation, midpoint, boundingbox and worldplane
source code
 
setLocation(self, connected_dir, location, prev_plane, direct=0)
sets the location by use of the MyGameUtils interface
source code
 
setOrientation(self, connected_dir, location, prev_plane)
sets the orientation by use of the MyGameUtils interface
source code
List[Integer (0,1,2,3), Vector]
getFreeSidesPositions(self)
gets the positions of the not already connected sides of the object
source code
List
getBoundingBox(self)
gets the object's bounding box (the cubic hull of the object)
source code
    Inherited from MyGameObjects.MY_GameObjectPassive
 
delConnectedSide(self, connected_object)
deletes entry out of the connected side list
source code
Boolean
deleteObject(self, now=False, recursive_delete=True)
deletes the object.
source code
List
getChildren(self)
gets the direct children which are connected to the object
source code
Integer (0,1,2)
getPlane(self)
gets the world plane the object is in
source code
Vector
getPosition(self)
gets the world position
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
 
setAlive(self, alive)
sets the object and its children to dead if necessary or the object to alive
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
 
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
Instance Variables [hide private]
List [Integer (0,1,2,3), Vector]; not very attractive :( freeSidesPosition
a list element that consists of the connected side and the position where the new object can be connected to
Vector midPoint
the center of the object (at least the right pivot, because at creation point of some elements the pivot is wrong.
Vector origScale
the original scale factor
    Inherited from MyGameObjects.MY_GameObjectPassive
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
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)
(Constructor)

source code 
Parameters:
  • scene (KX_Scene) - the blender scene object where all other objects are connected to
Overrides: MyGameObjects.MY_GameObjectPassive.__init__

setElement(self, side_location, prev_plane, rotated, direct=0)

source code 

initiates the calculation of position, orientation, midpoint, boundingbox and worldplane

Parameters:
  • side_location (List[Integer (0,1,2,3), Vector]) - to know exactly where the connection point is; that means what direction and at what position
  • prev_plane (Integer (0,1,2)) - you have to know the previous plane (the plane of the object that this object is connected to) because of ninety degree turns
  • rotated (Integer (0,1,2)) - whether th object is rotated (0=up, 1=down) or it is just connected in the same plane (2=normal)
  • direct (Boolean) - True if the object shall be spawned even ther is no other object to connect to (for example at the beginning)

setLocation(self, connected_dir, location, prev_plane, direct=0)

source code 

sets the location by use of the MyGameUtils interface

Parameters:
  • connected_dir (Integer (0,1,2,3)) - one of the four directions an object can be connected to
  • prev_plane (Integer (0,1,2)) - you have to know the previous plane (the plane of the object that this object is connected to) because of ninety degree turns
  • location (Vector) - the position where the object shall be spawned
  • direct (Boolean) - True if the object shall be spawned even ther is no other object to connect to (for example at the beginning)

setOrientation(self, connected_dir, location, prev_plane)

source code 

sets the orientation by use of the MyGameUtils interface

Parameters:
  • connected_dir (Integer (0,1,2,3)) - one of the four directions an object can be connected to
  • prev_plane (Integer (0,1,2)) - you have to know the previous plane (the plane of the object that this object is connected to) because of ninety degree turns
  • location (Vector) - the position where the object shall be spawned

getFreeSidesPositions(self)

source code 

gets the positions of the not already connected sides of the object

Returns: List[Integer (0,1,2,3), Vector]
returns a list of all the free sides (direction and position)

getBoundingBox(self)

source code 

gets the object's bounding box (the cubic hull of the object)

Returns: List
returns a list of vector points that represents the bounding box

Instance Variable Details [hide private]

midPoint

the center of the object (at least the right pivot, because at creation point of some elements the pivot is wrong. so you have to use this one to get the right rotations)
Type:
Vector