The SoftBody trait has implementations of creating a SoftBody for both js and hl targets. However, the hl one currently does not compile.
D:\Armory\ArmorySDK\armory\Sources/armory/trait/physics/bullet/SoftBody.hx:219:
characters 47-60 : Array<Float> should be webidl.NativePtr<Single>
D:\Armory\ArmorySDK\armory\Sources/armory/trait/physics/bullet/SoftBody.hx:219:
characters 47-60 : For function argument 'vertices'
I believe this is due to the incorrect passing of arguments.
In my case, The Haxe code looks like so:
#if js
body = helpers.CreateFromTriMesh(worldInfo, cast positions, cast vecind, numtri, true);
#else
var positionArray : Array<Float>;
positionArray = cast positions; //positions: Float32Array
body = helpers.CreateFromTriMesh(worldInfo, positionArray, cast vecind, numtri, true);
#end
The bullet.idl looks like so:
btSoftBody CreateFromTriMesh([Ref] btSoftBodyWorldInfo worldInfo, float[] vertices, long[] triangles, long ntriangles, boolean randomizeConstraints);
And my bullet.cpp looks like so:
HL_PRIM _ref(btSoftBody)* HL_NAME(btSoftBodyHelpers_CreateFromTriMesh5)(_ref(btSoftBodyHelpers)* _this, _ref(btSoftBodyWorldInfo)* worldInfo, float* vertices, int* triangles, int ntriangles, bool randomizeConstraints) {
return alloc_ref((_unref(_this)->CreateFromTriMesh(*_unref(worldInfo), vertices, triangles, ntriangles, randomizeConstraints)),btSoftBody);
}
DEFINE_PRIM(_IDL, btSoftBodyHelpers_CreateFromTriMesh5, _IDL _IDL _BYTES _BYTES _I32 _BOOL);
Now, I would like to know what changes must I make to my Haxe code to resolve this issue. Any help regarding this would be great.
Best Regards,
QC