Home | Trees | Indices | Help |
|
---|
|
PyObjectPlus --+ | CValue --+ | SCA_IObject --+ | KX_GameObject
All game objects are derived from this class.
Properties assigned to game objects are accessible as attributes of this class.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
3d vector. |
|
||
|
|||
|
|||
|
|||
|
|||
list [vx, vy, vz] |
|
||
|
|||
list [vx, vy, vz] |
|
||
|
|||
list [vx, vy, vz] |
|
||
list [fx, fy, fz] |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
float |
|
||
3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z)) |
|
||
KX_GameObject |
|
||
3-tuple (KX_GameObject, 3-tuple (x,y,z), 3-tuple (nx,ny,nz)) or 4-tuple (KX_GameObject, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), KX_PolyProxy) |
|
||
|
|||
|
|||
boolean |
|
||
bool |
|
||
Deprecated | |||
---|---|---|---|
boolean |
|
||
int |
|
||
|
|||
|
|||
|
|||
list [x, y, z] |
|
||
|
|||
3x3 rotation matrix |
|
||
float |
|
||
KX_GameObject |
|
||
CListValue of KX_GameObject |
|
||
CListValue of KX_GameObject |
|
||
KX_MeshProxy |
|
||
string |
|
||
Property Access | |||
list |
|
||
|
|||
boolean |
|
Instance Variables | |
list |
actuators a list of SCA_IActuator with string/index lookups and iterator support. |
CListValue of KX_GameObject's |
children direct children of this object, (read-only). |
CListValue of KX_GameObject's |
childrenRecursive all children of this object including childrens children, (read-only). |
list of SCA_ISensor. |
controllers a sequence of SCA_IController objects with string/index lookups and iterator support. |
bool |
invalid Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus) |
float |
linVelocityMax Clamp the maximum linear velocity to prevent objects moving beyond a set speed. |
float |
linVelocityMin Enforces the object keeps moving at a minimum velocity. |
list [ix, iy, iz] |
localInertia the object's inertia vector in local coordinates. |
3x3 Matrix [[float]] |
localOrientation The object's local orientation. |
list [x, y, z] |
localPosition The object's local position. |
list [sx, sy, sz] |
localScale The object's local scaling factor. |
float |
mass The object's mass |
list of KX_MeshProxy |
meshes a list meshes for this object. |
string |
name The name of this CValue derived object (read-only). |
boolean |
occlusion occlusion capability flag. |
3x3 Matrix [[float]] On write: local orientation, on read: world orientation |
orientation The object's orientation. |
KX_GameObject or None |
parent The object's parent object. |
list [x, y, z] On write: local position, on read: world position |
position The object's position. |
list [sx, sy, sz] On write: local scaling, on read: world scaling |
scaling The object's scaling factor. |
list |
sensors a sequence of SCA_ISensor objects with string/index lookups and iterator support. |
int |
state the game object's state bitmask, using the first 30 bits, one bit must always be set. |
float |
timeOffset adjust the slowparent delay at runtime. |
boolean |
visible visibility flag. |
3x3 Matrix [[float]] |
worldOrientation The object's world orientation. |
list [x, y, z] |
worldPosition The object's world position. |
list [sx, sy, sz] |
worldScale The object's world scaling factor. |
Property Access | |
---|---|
dict |
attrDict get the objects internal python attribute dictionary for direct (faster) access. |
Method Details |
Delete this object, can be used inpace of the EndObject Actuator. The actual removal of the object from the scene is delayed. |
Replace the mesh of this object with a new mesh. This works the same was as the actuator.
|
Gets the game object's visible flag.
Deprecated: use visible |
Sets the game object's visible flag.
|
Sets the game object's occlusion capability.
|
Gets the game object's state bitmask.
Deprecated: use state |
Sets the game object's state flag. The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29)
Deprecated: use state |
Sets the game object's position. Global coordinates for root object, local for child objects.
Deprecated: use localPosition |
Sets the game object's position in world coordinates regardless if the object is root or child.
Deprecated: use worldPosition |
Gets the game object's position.
Deprecated: use worldPosition |
Sets the game object's orientation.
Deprecated: use localOrientation Note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. |
Aligns any of the game object's axis along the given vector.
|
Returns the axis vector rotates by the objects worldspace orientation. This is the equivalent if multiplying the vector by the orientation matrix.
|
Gets the game object's orientation.
Deprecated: use worldOrientation Note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. |
Sets the game object's movement.
|
Sets the game object's rotation.
|
Sets the game object's force. This requires a dynamic object.
|
Sets the game object's torque. This requires a dynamic object.
|
Gets the game object's linear velocity. This method returns the game object's velocity through it's centre of mass, ie no angular velocity component.
|
Sets the game object's linear velocity. This method sets game object's velocity through it's centre of mass, ie no angular velocity component. This requires a dynamic object.
|
Gets the game object's angular velocity.
|
Sets the game object's angular velocity. This requires a dynamic object.
|
Gets the game object's velocity at the specified point. Gets the game object's velocity at the specified point, including angular components.
|
Gets the game object's mass.
Deprecated: use mass |
Gets the game object's reaction force. The reaction force is the force applied to this object over the last simulation timestep. This also includes impulses, eg from collisions. (This is not implimented for bullet physics at the moment)
|
Applies an impulse to the game object. This will apply the specified impulse to the game object at the specified point. If point != getPosition(), applyImpulse will also change the object's angular momentum. Otherwise, only linear momentum will change.
|
Resumes physics for this object. Note: The objects linear velocity will be applied from when the dynamics were suspended. |
Enables rigid body physics for this object. Rigid body physics allows the object to roll on collisions. Note: This is not working with bullet physics yet. |
Disables rigid body physics for this object. Note: This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later. |
Gets this object's parent.
Deprecated: use parent |
Sets this object's parent. Control the shape status with the optional compound and ghost parameters: compound=1: the object shape should be added to the parent compound shape (default) compound=0: the object should keep its individual shape. In that case you can control if it should be ghost or not: ghost=1 if the object should be made ghost while parented (default) ghost=0 if the object should be solid while parented Note: if the object type is sensor, it stays ghost regardless of ghost parameter
|
Return a list of immediate children of this object.
|
Return a list of children of this object, including all their childrens children.
|
Gets the mesh object for this object.
|
Gets a list of all property names.
|
Returns the distance to another object or point.
|
Returns the vector and the distance to another object or point. The vector is normalized unless the distance is 0, in which a NULL vector is returned.
|
Look towards another point/object and find first object hit within dist that matches prop. The ray is always casted from the center of the object, ignoring the object itself. The ray is casted towards the center of another object or an explicit [x,y,z] point. Use rayCast() if you need to retrieve the hit point
|
Look from a point/object to another point/object and find first object hit within dist that matches prop. if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit. if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element. Ex: # shoot along the axis gun-gunAim (gunAim should be collision-free) ob,point,normal = gun.rayCast(gunAim,None,50) if ob: # hit something Notes: The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x,y,z] points. The face paremeter determines the orientation of the normal: 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside) 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect) The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray. The prop and xray parameters interact as follow: prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray. prop off, xray on : idem. prop on, xray off: return closest hit if it matches prop, no hit otherwise. prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray. The KX_PolyProxy 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray. If there is no hit or the hit object is not a static mesh, None is returned as 4th element. The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
|
Set the objects collision margin. note: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
|
Sends a message.
|
Updates the physics system with the changed mesh. If no arguments are given the physics mesh will be re-created from the first mesh assigned to the game object.
Notes:
|
Return the value matching key, or the default value if its not found.
|
Return True if the key is found.
|
Instance Variable Details |
actuatorsa list of SCA_IActuator with string/index lookups and iterator support.
|
controllersa sequence of SCA_IController objects with string/index lookups and iterator support.
|
linVelocityMaxClamp the maximum linear velocity to prevent objects moving beyond a set speed.
|
linVelocityMinEnforces the object keeps moving at a minimum velocity.
|
localInertiathe object's inertia vector in local coordinates. Read only.
|
localOrientationThe object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
|
massThe object's mass
|
meshesa list meshes for this object.
|
nameThe name of this CValue derived object (read-only).
|
orientationThe object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.deprecated: use localOrientation and worldOrientation
|
parentThe object's parent object. (read-only)
|
positionThe object's position.deprecated: use localPosition and worldPosition
|
scalingThe object's scaling factor. list [sx, sy, sz]deprecated: use localScale and worldScale
|
sensorsa sequence of SCA_ISensor objects with string/index lookups and iterator support.
|
visiblevisibility flag.
|
worldScaleThe object's world scaling factor. Read-only
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Mon Aug 31 23:12:31 2009 | http://epydoc.sourceforge.net |