Module GameTypes :: Class KX_PolyProxy
[frames] | no frames]

Class KX_PolyProxy

PyObjectPlus --+        
               |        
          CValue --+    
                   |    
         SCA_IObject --+
                       |
                      KX_PolyProxy

A polygon holds the index of the vertex forming the poylgon.

Note: The polygon attributes are read-only, you need to retrieve the vertex proxy if you want to change the vertex settings.

Instance Methods
string
getMaterialName()
Returns the polygon material name with MA prefix
KX_PolygonMaterial or KX_BlenderMaterial
getMaterial()
Returns the polygon material
string
getTextureName()
Returns the polygon texture name
integer
getMaterialIndex()
Returns the material bucket index of the polygon.
integer
getNumVertex()
Returns the number of vertex of the polygon.
integer
isVisible()
Returns whether the polygon is visible or not
integer
isCollider()
Returns whether the polygon is receives collision or not
integer
getVertexIndex(vertex)
Returns the mesh vertex index of a polygon vertex This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from KX_MeshProxy.
KX_MeshProxy
getMesh()
Returns a mesh proxy
bool
isA(game_type)
Check if this is a type or a subtype game_type. (Inherited from GameTypes.PyObjectPlus)
    Deprecated
string
getName()
Returns the name of the CValue. (Inherited from GameTypes.CValue)
Instance Variables
integer collide
collide state of the polygon: 1=receives collision, 0=collision free.
bool invalid
Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus)
KX_PolygonMaterial or KX_BlenderMaterial material
The material of the polygon
integer matid
The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
string matname
The name of polygon material, empty if no material.
string name
The name of this CValue derived object (read-only). (Inherited from GameTypes.CValue)
string texture
The texture name of the polygon.
integer v1
vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
integer v2
vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
integer v3
vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
integer v4
vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex use this to retrieve vertex proxy from mesh proxy
integer visible
visible state of the polygon: 1=visible, 0=invisible
Method Details

getMaterialName()

 

Returns the polygon material name with MA prefix

Returns: string
material name

getTextureName()

 

Returns the polygon texture name

Returns: string
texture name

getMaterialIndex()

 

Returns the material bucket index of the polygon. This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from KX_MeshProxy.

Returns: integer
the material index in the mesh

getNumVertex()

 

Returns the number of vertex of the polygon.

Returns: integer
number of vertex, 3 or 4.

isVisible()

 

Returns whether the polygon is visible or not

Returns: integer
0=invisible, 1=visible

isCollider()

 

Returns whether the polygon is receives collision or not

Returns: integer
0=collision free, 1=receives collision

getVertexIndex(vertex)

 

Returns the mesh vertex index of a polygon vertex This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from KX_MeshProxy.

Parameters:
  • vertex (integer) - index of the vertex in the polygon: 0->3
Returns: integer
mesh vertex index

getMesh()

 

Returns a mesh proxy

Returns: KX_MeshProxy
mesh proxy