Name | Type | Description |
---|---|---|
buffers |
array |
optional
an array of buffers. optional. |
attributes |
object |
optional
of the geometry, optional structure of the attributes layout |
Methods
-
PIXI.Geometry.merge (geometries)PIXI.Geometry static
-
merges an array of geometries into a new single one geometry attribute styles must match for this operation to work
Name Type Description geometries
array | PIXI.Geometry array of geometries to merge
Returns:
Type Description PIXI.Geometry shiney new geometry -
addAttribute (id, buffer, size, normalised, type, stride, start)PIXI.Geometry
-
Adds an attribute to the geometry
Name Type Default Description id
String the name of the attribute (matching up to a shader)
buffer
PIXI.Buffer optional the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
size
Number 0 optional the size of the attribute. If you hava 2 floats per vertex (eg position x and y) this would be 2
normalised
Boolean false optional should the data be normalised.
type
Number PIXI.TYPES.FLOAT optional what type of numbe is the attribute. Check {PIXI.TYPES} to see the ones available
stride
Number 0 optional How far apart (in floats) the start of each value is. (used for interleaving data)
start
Number 0 optional How far into the array to start reading values (used for interleaving data)
Returns:
Type Description PIXI.Geometry returns self, useful for chaining. -
addIndex (buffer)PIXI.Geometry
-
Adds an index buffer to the geometry The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
Name Type Description buffer
PIXI.Buffer optional the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
Returns:
Type Description PIXI.Geometry returns self, useful for chaining. -
clone ()PIXI.Geometry
-
returns a clone of the geometry
Returns:
Type Description PIXI.Geometry a new clone of this geometry -
Destroys the geometry.
-
getAttribute (id)PIXI.Attribute
-
returns the requested attribute
Name Type Description id
String the name of the attribute required
Returns:
Type Description PIXI.Attribute the attribute requested. -
getIndex ()PIXI.Buffer
-
returns the index buffer
Returns:
Type Description PIXI.Buffer the index buffer. -
interleave ()PIXI.Geometry
-
this function modifies the structure so that all current attributes become interleaved into a single buffer This can be useful if your model remains static as it offers a little performance boost
Returns:
Type Description PIXI.Geometry returns self, useful for chaining.