MCPcopy Index your code
hub / github.com/sparkjsdev/spark / reinitialize

Method reinitialize

src/ExtSplats.ts:115–139  ·  view source on GitHub ↗
(options: ExtSplatsOptions)

Source from the content-addressed store, hash-verified

113 }
114
115 reinitialize(options: ExtSplatsOptions) {
116 this.isInitialized = false;
117
118 this.extra = {};
119 this.maxSplats = options.maxSplats ?? 0;
120 this.lod = options.lod;
121 this.nonLod = options.nonLod;
122
123 if (
124 options.url ||
125 options.fileBytes ||
126 options.stream ||
127 options.construct
128 ) {
129 // We need to initialize asynchronously given the options
130 this.initialized = this.asyncInitialize(options).then(() => {
131 this.isInitialized = true;
132 return this;
133 });
134 } else {
135 this.initialize(options);
136 this.isInitialized = true;
137 this.initialized = Promise.resolve(this);
138 }
139 }
140
141 initialize(options: ExtSplatsOptions) {
142 this.extra = options.extra ?? {};

Callers 2

constructorMethod · 0.95
asyncInitializeMethod · 0.45

Calls 2

asyncInitializeMethod · 0.95
initializeMethod · 0.95

Tested by

no test coverage detected