Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Int8BufferAttribute

Int8 buffer attribute

Hierarchy

Index

Constructors

constructor

  • new Int8BufferAttribute(array: number | ArrayLike<number> | Iterable<number>, itemSize: number, normalized?: boolean): I3JS.Int8BufferAttribute
  • new Int8BufferAttribute(array: number | ArrayLike<number> | Iterable<number>, itemSize: number, normalized?: boolean): I3JS.Int8BufferAttribute
  • Parameters

    • array: number | ArrayLike<number> | Iterable<number>

      Must be a TypedArray. Used to instantiate the buffer. This array should have itemSize * numVertices

    • itemSize: number

      The number of values of the array that should be associated with a particular vertex. For instance, if this attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.

    • Optional normalized: boolean

      Applies to integer data only. Indicates how the underlying data in the buffer maps to the values in the GLSL code. For instance, if array is an instance of UInt16Array, and normalized is true, the values 0 - +65535 in the array data will be mapped to 0.0f - +1.0f in the GLSL attribute. An Int16Array (signed) would map from -32767 - +32767 to -1.0f - +1.0f. If normalized is false, the values will be converted to floats unmodified, i.e. 32767 becomes 32767.0f.

    Returns I3JS.Int8BufferAttribute

  • Parameters

    • array: number | ArrayLike<number> | Iterable<number>

      Must be a TypedArray. Used to instantiate the buffer. This array should have itemSize * numVertices

    • itemSize: number

      The number of values of the array that should be associated with a particular vertex. For instance, if this attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.

    • Optional normalized: boolean

      Applies to integer data only. Indicates how the underlying data in the buffer maps to the values in the GLSL code. For instance, if array is an instance of UInt16Array, and normalized is true, the values 0 - +65535 in the array data will be mapped to 0.0f - +1.0f in the GLSL attribute. An Int16Array (signed) would map from -32767 - +32767 to -1.0f - +1.0f. If normalized is false, the values will be converted to floats unmodified, i.e. 32767 becomes 32767.0f.

    Returns I3JS.Int8BufferAttribute

Properties

array

array: ArrayLike<number>

The array holding data stored in the buffer.

count

count: number

Stores the array's length divided by the itemSize. If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.

default

0

Readonly isBufferAttribute

isBufferAttribute: true

itemSize

itemSize: number

The length of vectors that are being stored in the array.

name

name: string

Optional name for this attribute instance. Default is an empty string.

default

''

normalized

normalized: boolean

Indicates how the underlying data in the buffer maps to the values in the GLSL shader code. See the constructor above for details.

default

false

updateRange

updateRange: { count: number; offset: number }

Object containing:

param offset

Default is 0. Position at which to start update.

param count

Default is -1, which means don't use update ranges. This can be used to only update some components of stored vectors (for example, just the component related to color).

default

{ offset: number; count: number }

Type declaration

  • count: number
  • offset: number

usage

usage: Usage

Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of WebGLRenderingContext.bufferData(). Default is StaticDrawUsage. See usage constants for all possible values.

default

THREE.StaticDrawUsage

version

version: number

A version number, incremented every time the needsUpdate property is set to true.

default

0

Accessors

needsUpdate

  • set needsUpdate(value: boolean): void
  • Flag to indicate that this attribute has changed and should be re-sent to the GPU. Set this to true when you modify the value of the array. Setting this to true also increments the version.

    Parameters

    • value: boolean

    Returns void

Methods

applyMatrix3

applyMatrix4

applyNormalMatrix

clone

copy

copyArray

copyAt

copyColorsArray

copyVector2sArray

copyVector3sArray

copyVector4sArray

getW

  • getW(index: number): number

getX

  • getX(index: number): number

getY

  • getY(index: number): number

getZ

  • getZ(index: number): number

onUpload

onUploadCallback

  • onUploadCallback(): void

set

setUsage

setW

setX

setXY

setXYZ

setXYZW

setY

setZ

toJSON

  • toJSON(): { array: number[]; itemSize: number; normalized: boolean; type: string }

transformDirection

Generated using TypeDoc