createTechniqueParameters and typescript

15 views
Skip to first unread message

Ooki

unread,
Mar 28, 2015, 11:08:38 AM3/28/15
to turbulenz-e...@googlegroups.com
Hello all

Im kinda new to typescript (and turbulenz) and to try out typescript I tried to convert
the helloworld example into typescript. 

I added all the ref files on the top and the tsc compiler works fine.
However, when compiling I get the following error:

myfirstapp.ts(105,31): error TS2339: Property 'worldViewProjection' does not exist on type 'TechniqueParameters'.

The error is on the line where the code tries to assign something to techniqueParameters.worldViewProjection.
 techniqueParameters is created as:

var techniqueParameters = gd.createTechniqueParameters({
      worldViewProjection: md.m44BuildIdentity()
  });

Im guessing this has something with that typescript does not know what createTechniqueParameters()
returns (or what properties it creates).


I would be helpful for a nod in the correct direction.
cheers


Luca Deltodesco

unread,
Apr 1, 2015, 4:17:25 PM4/1/15
to turbulenz-e...@googlegroups.com
either cast techniqueParams to the 'any' type before setting properties, or what we tend to do in the internal engine is to use square-bracket syntax for object fields like

techniqueParameters["worldViewProjection"] = ...;
Reply all
Reply to author
Forward
0 new messages