File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,36 @@ function processStrandsFunctions() {
119119 }
120120 }
121121
122- return [ ...strandsMethods , ...uniformMethods ] ;
122+ // Add type casting functions (DataType constructor functions)
123+ const typeCastingMethods = [ ] ;
124+ for ( const type in DataType ) {
125+ if ( type === 'defer' || ! DataType [ type ] . fnName ) {
126+ continue ;
127+ }
128+
129+ const typeInfo = DataType [ type ] ;
130+ const castingMethod = {
131+ name : typeInfo . fnName ,
132+ overloads : [ {
133+ params : [
134+ {
135+ name : 'value' ,
136+ type : { type : 'NameExpression' , name : 'any' } ,
137+ optional : false
138+ }
139+ ] ,
140+ return : {
141+ type : { type : 'NameExpression' , name : 'any' }
142+ }
143+ } ] ,
144+ description : `GLSL type constructor for ${ typeInfo . fnName } ` ,
145+ static : false
146+ } ;
147+
148+ typeCastingMethods . push ( castingMethod ) ;
149+ }
150+
151+ return [ ...strandsMethods , ...uniformMethods , ...typeCastingMethods ] ;
123152}
124153
125154// TypeScript-specific type conversion from raw type objects
You can’t perform that action at this time.
0 commit comments