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

Class MY_GameObjectActive

source code

Known Subclasses:

base class of all the objects that are dynamic and NOT temporary

Instance Methods [hide private]
 
__init__(self, scene, element) source code
 
setLocalOrientation(self, orientation)
sets the local orientation
source code
Matrix
getWorldOrientation(self)
gets the world orientation
source code
Vector
getPosition(self)
gets the world position
source code
 
setPosition(self, position)
sets the world position
source code
List [vx, vy, vz]
getLinearVelocity(self, local)
if 'local = True' it gets the local linear velocity otherwise it gets the global linear velocity
source code
 
setLinearVelocity(self, speed, local=0)
if 'local = True' it sets the local linear velocity otherwise it sets the global linear velocity
source code
 
deleteObject(self)
deletes object and removes it from the scene
source code
Instance Variables [hide private]
KX_GameObject gObject
a blender game object
String name
the name that represents the object in MY_SingleScene
String type
a name which identifies the object as a specific class in MY_SingleScene
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 light object which shall included into the MY_SingleScene class

setLocalOrientation(self, orientation)

source code 

sets the local orientation

Parameters:
  • orientation (Matrix) - the new local orientation matrix

getWorldOrientation(self)

source code 

gets the world orientation

Returns: Matrix
a 3x3 matrix of the current orientation

getPosition(self)

source code 

gets the world position

Returns: Vector
a vector of the current world position

setPosition(self, position)

source code 

sets the world position

Parameters:
  • position (Vector) - the new world position of the object

getLinearVelocity(self, local)

source code 

if 'local = True' it gets the local linear velocity otherwise it gets the global linear velocity

Parameters:
  • local (Boolean) - True if you want the local linear velocity, otherwise it is global
Returns: List [vx, vy, vz]
the current linear velocity in all three directions

setLinearVelocity(self, speed, local=0)

source code 

if 'local = True' it sets the local linear velocity otherwise it sets the global linear velocity

Parameters:
  • speed (Vector) - the max speed for all three directions
  • local (Boolean) - True if the local velocity shall be set, otherwise global