Module MyGameUtils
[hide private]
[frames] | no frames]

Module MyGameUtils

source code

Functions [hide private]
Boolean
GetBoxCollision(obj1, obj2)
calculates the collsion of game objects, like patforms and stairs
source code
 
SetReverseRootConnection(root_ground)
sets the right id as the root connected id
source code
String
GetGlobalOrientationToMe(source_object, target_object)
gets the global direction of an object to me (at top, bottom, left, right, front or back) question is: where is an object from my point of view (globally)?
source code
 
SetPassivePartsConnection(connected_side, source, target)
sets the connected list of source and target object, so both know they are connected
source code
Matrix
GetNormRotation(direction, plane, up=1)
gets a normal rotation for an object dependent on the three planes and four direction; in the same plane as the connected object (mostly for stair objects)
source code
Vector
GetPlatfNormTransDelta(cur_pos, direction, plane, o_width, direct=0)
gets the position of a platform by a normal translation with an offset (because of creepy center points)
source code
Vector
GetPlatfVertTransDelta(cur_pos, direction, plane, o_width, o_height, up)
gets the new position of a platform, when it's rotated
source code
Matrix
GetVertRotation(direction, plane)
gets the rotation for an object if it is rotated (and changed to a new plane)
source code
Variables [hide private]
  __package__ = None
Function Details [hide private]

GetBoxCollision(obj1, obj2)

source code 

calculates the collsion of game objects, like patforms and stairs

Returns: Boolean
'False' if there is a coillision, else 'True'

SetReverseRootConnection(root_ground)

source code 

sets the right id as the root connected id

Parameters:
  • root_ground (MY_GameObject) - the object that represents the current ground object of the player

GetGlobalOrientationToMe(source_object, target_object)

source code 

gets the global direction of an object to me (at top, bottom, left, right, front or back) question is: where is an object from my point of view (globally)?

Parameters:
  • source_object (MY_GameObject) - the source object to whom you want the orientation to (dont know how to explain!)
  • target_object (MY_GameObject) - the object you want the orientation to (dont know how to explain!)
Returns: String
returns a string that represents the direction where to find the target object (top, bottom, left, right, front, back or none)

SetPassivePartsConnection(connected_side, source, target)

source code 

sets the connected list of source and target object, so both know they are connected

Parameters:
  • connected_side (Integer (0,1,2,3)) - the connected side of source (passive) object where the target (passive) object is connected to
  • source (MY_GameObject) - the object where the target is connected to
  • target (MY_GameObject) - the object which is connected to source

GetNormRotation(direction, plane, up=1)

source code 

gets a normal rotation for an object dependent on the three planes and four direction; in the same plane as the connected object (mostly for stair objects)

Parameters:
  • direction (Integer (0,1,2,3)) - the direction where an object is connected to
  • plane (Integer (0,1,2)) - the plane of the object that makes a normal rotation
  • up (Boolean) - True if object is turned upwards
Returns: Matrix
returns the rotation matrix of a 'normal' rotation

GetPlatfNormTransDelta(cur_pos, direction, plane, o_width, direct=0)

source code 

gets the position of a platform by a normal translation with an offset (because of creepy center points)

Parameters:
  • cur_pos (Vector) - the object's current position
  • direction (Integer (0,1,2,3)) - the direction of the object where it is connected to
  • plane (Integer (0,1,2)) - the plane of the object that makes the TransDelta
  • o_width (Integer) - the width of an object in the xy-plane; only for platforms!!!
  • direct (Boolean) - True if the object dont have to make a translation (for example: only one platform will be spawned in the game)
Returns: Vector
the new position after a normal translation with a delta

GetPlatfVertTransDelta(cur_pos, direction, plane, o_width, o_height, up)

source code 

gets the new position of a platform, when it's rotated

Parameters:
  • cur_pos (Vector) - the object's current position
  • direction (Integer (0,1,2,3)) - the direction of the object where it is connected to
  • plane (Integer (0,1,2)) - the plane of the object that makes the TransDelta
  • o_width (Integer) - the width of an object in the xy-plane; only for platforms!!!
  • o_height (Integer) - the height of an object in the xy-plane; only for platforms!!!
  • up (Boolean) - True if object is turned upward, False when downward (this 'def' is for platforms that are already defined as rotated)
Returns: Vector
returns the new position after a translation with delta of an already rotated object

GetVertRotation(direction, plane)

source code 

gets the rotation for an object if it is rotated (and changed to a new plane)

Parameters:
  • direction (Integer (0,1,2,3)) - the direction of the object where it is connected to
  • plane (Integer (0,1,2)) - the plane of the object that makes this rotation
Returns: Matrix
returns the rotation matrix of a rotation when an object was already defined as rotated