Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions types/three/src/core/BufferAttribute.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class BufferAttribute {
/**
* This can be used to only update some components of stored vectors (for example, just the component related to color).
* @defaultValue `{ offset: number = 0; count: number = -1 }`
* @deprecated Will be removed in r169. Use "addUpdateRange()" instead.
*/
updateRange: {
/**
Expand All @@ -99,6 +100,21 @@ export class BufferAttribute {
count: number;
};

/**
* This can be used to only update some components of stored vectors (for example, just the component related to
* color). Use the {@link .addUpdateRange} function to add ranges to this array.
*/
updateRanges: Array<{
/**
* Position at which to start update.
*/
start: number;
/**
* The number of components to update.
*/
count: number;
}>;

/**
* A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true.
* @remarks Expects a `Integer`
Expand Down Expand Up @@ -159,6 +175,17 @@ export class BufferAttribute {
*/
setUsage(usage: Usage): this;

/**
* Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the
* {@link .updateRanges} array.
*/
addUpdateRange(start: number, count: number): void;

/**
* Clears the {@link .updateRanges} array.
*/
clearUpdateRanges(): void;

/**
* @returns a copy of this {@link BufferAttribute}.
*/
Expand Down
27 changes: 27 additions & 0 deletions types/three/src/core/InterleavedBuffer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class InterleavedBuffer {
/**
* Object containing offset and count.
* @defaultValue `{ offset: number = 0; count: number = -1 }`
* @deprecated Will be removed in r169. Use "addUpdateRange()" instead.
*/
updateRange: {
/** @defaultValue `0` */
Expand All @@ -51,6 +52,21 @@ export class InterleavedBuffer {
count: number;
};

/**
* This can be used to only update some components of stored data. Use the {@link .addUpdateRange} function to add
* ranges to this array.
*/
updateRanges: Array<{
/**
* Position at which to start update.
*/
start: number;
/**
* The number of components to update.
*/
count: number;
}>;

/**
* A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true.
* @remarks Expects a `Integer`
Expand Down Expand Up @@ -99,6 +115,17 @@ export class InterleavedBuffer {
*/
setUsage(value: Usage): this;

/**
* Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the
* {@link .updateRanges} array.
*/
addUpdateRange(start: number, count: number): void;

/**
* Clears the {@link .updateRanges} array.
*/
clearUpdateRanges(): void;

/**
* Copies another {@link InterleavedBuffer} to this {@link InterleavedBuffer} instance.
* @param source
Expand Down