Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bge.types.KX_PolyProxy.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f43cf62eec1405baada026261a3199c8c6b79b88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
KX_PolyProxy(SCA_IObject)
=========================

.. module:: bge.types

base class --- :class:`SCA_IObject`

.. class:: KX_PolyProxy(SCA_IObject)

   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.

   .. attribute:: material_name

      The name of polygon material, empty if no material.

      :type: string

   .. attribute:: material

      The material of the polygon.

      :type: :class:`KX_BlenderMaterial`

   .. attribute:: texture_name

      The texture name of the polygon.

      :type: string

   .. attribute:: material_id

      The material index of the polygon, use this to retrieve vertex proxy from mesh proxy.

      :type: integer

   .. attribute:: v1

      vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.

      :type: integer

   .. attribute:: v2

      vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.

      :type: integer

   .. attribute:: v3

      vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.

      :type: integer

   .. attribute:: 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.

      :type: integer

   .. attribute:: visible

      visible state of the polygon: 1=visible, 0=invisible.

      :type: integer

   .. attribute:: collide

      collide state of the polygon: 1=receives collision, 0=collision free.

      :type: integer

   .. method:: getMaterialName()

      Returns the polygon material name with MA prefix

      :return: material name
      :rtype: string

   .. method:: getMaterial()

      :return: The polygon material
      :rtype: :class:`KX_BlenderMaterial`

   .. method:: getTextureName()

      :return: The texture name
      :rtype: string

   .. method:: 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 :class:`MeshProxy`.

      :return: the material index in the mesh
      :rtype: integer

   .. method:: getNumVertex()

      Returns the number of vertex of the polygon.

      :return: number of vertex, 3 or 4.
      :rtype: integer

   .. method:: isVisible()

      Returns whether the polygon is visible or not

      :return: 0=invisible, 1=visible
      :rtype: boolean

   .. method:: isCollider()

      Returns whether the polygon is receives collision or not

      :return: 0=collision free, 1=receives collision
      :rtype: integer

   .. method:: 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 :class:`MeshProxy`.

      :arg vertex: index of the vertex in the polygon: 0->3
      :arg vertex: integer
      :return: mesh vertex index
      :rtype: integer

   .. method:: getMesh()

      Returns a mesh proxy

      :return: mesh proxy
      :rtype: :class:`MeshProxy`