quad-indices

WebJar for quad-indices

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

quad-indices
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

quad-indices
WebJar for quad-indices
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Jam3/quad-indices

Download quad-indices

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/quad-indices/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>quad-indices</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/quad-indices/
implementation 'org.webjars.npm:quad-indices:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/quad-indices/
implementation ("org.webjars.npm:quad-indices:2.0.1")
'org.webjars.npm:quad-indices:jar:2.0.1'
<dependency org="org.webjars.npm" name="quad-indices" rev="2.0.1">
  <artifact name="quad-indices" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='quad-indices', version='2.0.1')
)
libraryDependencies += "org.webjars.npm" % "quad-indices" % "2.0.1"
[org.webjars.npm/quad-indices "2.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : an-array jar [1.0.0,2)
org.webjars.npm : dtype jar [2.0.0,3)
org.webjars.npm : is-buffer jar [1.0.2,2)

Project Modules

There are no modules declared in this project.

quad-indices

stable

Creates the indices for a quad mesh (two triangles), ideal for sprites, 2D lines, font glyphs, billboards, and other features.

var createIndices = require('quad-indices')

//basic usage:
var quad = createIndices()
// --> new Uint16Array([0, 1, 2, 0, 2, 3])

//N quads, array type:
var quad = createIndices({ count: 2, type: 'array' })
// --> [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7]

//counter-clockwise
var quad = createIndices({ clockwise: false })
// --> new Uint16Array([0, 1, 2, 2, 1, 3])

//store in existing array
var array = new Uint16Array(12)
createIndices(array, { start: 6 })
// --> new Uint16Array([0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 3])

Usage

NPM

quad = createIndices([array], [opt])

Creates the indices for a quad mesh. Both parameters are optional.

If array is provided and is a Buffer or array-like object, it will be used as output instead of creating a new object.

Possible options:

  • count the number of quads to index, default 1
  • type (string) the dtype of the returned array, default '"uint16"'
  • clockwise (boolean) the orientation of the indices, default true
  • start the starting index to place the data into the array, default 0

License

MIT, see LICENSE.md for details.

org.webjars.npm

Jam3

We create modern experiences for tomorrow’s brands

Versions

Version
2.0.1