Home | Trees | Indices | Help |
|
---|
|
PyObjectPlus --+ | CValue --+ | SCA_IObject --+ | KX_VertexProxy
A vertex holds position, UV, colour and normal information.
Note: The physics simulation is NOT currently updated - physics will not respond to changes in the vertex position.
Instance Methods | |||
list [x, y, z] |
|
||
|
|||
list [u, v] |
|
||
|
|||
list [u, v] |
|
||
|
|||
integer |
|
||
|
|||
list [nx, ny, nz] |
|
||
|
|||
bool |
|
||
Deprecated | |||
---|---|---|---|
string |
|
Instance Variables | |
list [u, v] |
UV The texture coordinates of the vertex. |
list [x, y, z] |
XYZ The position of the vertex. |
color Synonym for colour. |
|
list [r, g, b, a] |
colour The colour of the vertex. |
bool |
invalid Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus) |
string |
name The name of this CValue derived object (read-only). (Inherited from GameTypes.CValue) |
list [nx, ny, nz] |
normal The normal of the vertex |
float |
u2 The second u texture coordinate of the vertex. |
float |
v2 The second v texture coordinate of the vertex. |
Position | |
---|---|
float |
x The x coordinate of the vertex. |
float |
y The y coordinate of the vertex. |
float |
z The z coordinate of the vertex. |
Texture Coordinates | |
float |
u The u texture coordinate of the vertex. |
float |
v The v texture coordinate of the vertex. |
Colour | |
float |
a The alpha component of the vertex colour. |
float |
b The blue component of the vertex colour. |
float |
g The green component of the vertex colour. |
float |
r The red component of the vertex colour. |
Method Details |
Gets the position of this vertex.
|
Sets the position of this vertex.
|
Gets the UV (texture) coordinates of this vertex.
|
Sets the UV (texture) coordinates of this vertex.
|
Gets the 2nd UV (texture) coordinates of this vertex.
|
Sets the 2nd UV (texture) coordinates of this vertex.
|
Gets the colour of this vertex. The colour is represented as four bytes packed into an integer value. The colour is packed as RGBA. Since Python offers no way to get each byte without shifting, you must use the struct module to access colour in an machine independent way. Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead. Example: import struct; col = struct.unpack('4B', struct.pack('I', v.getRGBA())) # col = (r, g, b, a) # black = ( 0, 0, 0, 255) # white = (255, 255, 255, 255)
|
Sets the colour of this vertex. See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes or the colour attribute instead. setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a] with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0] Example: v.setRGBA(0xff0000ff) # Red v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
|
Gets the normal vector of this vertex.
|
Sets the normal vector of this vertex.
|
Instance Variable Details |
aThe alpha component of the vertex colour. 0.0 <= a <= 1.0
|
bThe blue component of the vertex colour. 0.0 <= b <= 1.0
|
colourThe colour of the vertex. Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
|
gThe green component of the vertex colour. 0.0 <= g <= 1.0
|
rThe red component of the vertex colour. 0.0 <= r <= 1.0
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Mon Aug 31 23:12:31 2009 | http://epydoc.sourceforge.net |