Skip to content

Commit

Permalink
Expose AttributeOptions (#10407)
Browse files Browse the repository at this point in the history
Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
  • Loading branch information
ivanpopelyshev and Zyie committed Apr 9, 2024
1 parent 7492dbc commit 87fbc00
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rendering/renderers/shared/geometry/Geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ export interface Attribute
* extends {@link rendering.Attribute} but allows for the buffer to be a typed or number array
* @memberof rendering
*/
type AttributesOption = Omit<Attribute, 'buffer'> & { buffer: Buffer | TypedArray | number[]}
type AttributeOption = Omit<Attribute, 'buffer'> & { buffer: Buffer | TypedArray | number[]}
| Buffer | TypedArray | number[];

export type AttributeOptions = Record<string, AttributeOption>;

/**
* the interface that describes the structure of the geometry
* @memberof rendering
Expand All @@ -56,15 +58,15 @@ export interface GeometryDescriptor
/** an optional label to easily identify the geometry */
label?: string;
/** the attributes that make up the geometry */
attributes: Record<string, AttributesOption>;
attributes: AttributeOptions;
/** optional index buffer for this geometry */
indexBuffer?: Buffer | TypedArray | number[];
/** the topology of the geometry, defaults to 'triangle-list' */
topology?: Topology;

instanceCount?: number;
}
function ensureIsAttribute(attribute: AttributesOption): Attribute
function ensureIsAttribute(attribute: AttributeOption): Attribute
{
if (attribute instanceof Buffer || Array.isArray(attribute) || (attribute as TypedArray).BYTES_PER_ELEMENT)
{
Expand Down

0 comments on commit 87fbc00

Please sign in to comment.