forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
BIN
wasm_trait_c/Bundled/main.wasm
Normal file
BIN
wasm_trait_c/Bundled/main.wasm
Normal file
Binary file not shown.
1
wasm_trait_c/README.md
Normal file
1
wasm_trait_c/README.md
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/leenkx3d/leenkx/wiki/wasm
|
||||
17
wasm_trait_c/main.c
Normal file
17
wasm_trait_c/main.c
Normal file
@ -0,0 +1,17 @@
|
||||
#define WASM_EXPORT __attribute__((visibility("default")))
|
||||
|
||||
void notify_on_update(void* f);
|
||||
int get_object(const char* name);
|
||||
void set_transform(int object, float x, float y, float z, float rx, float ry, float rz, float sx, float sy, float sz);
|
||||
|
||||
WASM_EXPORT void update() {
|
||||
static float rot = 0.0f;
|
||||
rot += 0.01f;
|
||||
set_transform(get_object("Cube"), 0, 0, 0, 0, 0, rot, 1, 1, 1);
|
||||
}
|
||||
|
||||
// Include main function, Armory calls it when trait is instantiated
|
||||
WASM_EXPORT int main() {
|
||||
notify_on_update(update);
|
||||
return 0;
|
||||
}
|
||||
BIN
wasm_trait_c/wasm.png
Normal file
BIN
wasm_trait_c/wasm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
BIN
wasm_trait_c/wasm_trait_c.blend
Normal file
BIN
wasm_trait_c/wasm_trait_c.blend
Normal file
Binary file not shown.
Reference in New Issue
Block a user