Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vector trait properties on HTML5 #142

Merged
merged 1 commit into from Oct 23, 2021

Conversation

MoritzBrueckner
Copy link
Contributor

Fixes armory3d/armory#2364.

I'm not entirely sure where the issue comes from, but it seems that there are some problems with abstracts and dynamic types. Somehow the array access doesn't work on what is stored in pval ([object DataView]), maybe it even is a Haxe bug. Also I don't know why it worked with Krom before, but now it works on both krom and html5.

Prior to this change, the generated js code looked like this:

Reflect.setProperty(traitInst,pname,new iron_math_Vec4(pval[0],pval[1],pval[2],pval[3]));

and now it looks like this:

var pVec1 = pval;
Reflect.setProperty(traitInst,pname,new iron_math_Vec4(pVec1.getFloat32(0,kha_arrays_ByteArray.LITTLE_ENDIAN),pVec1.getFloat32(4,kha_arrays_ByteArray.LITTLE_ENDIAN),pVec1.getFloat32(8,kha_arrays_ByteArray.LITTLE_ENDIAN),pVec1.getFloat32(12,kha_arrays_ByteArray.LITTLE_ENDIAN)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HTML5] Trait Vec4 props values not applied
2 participants