C_STRUCT aiVector3D* mVertices;
//or
unsigned int* mSomeValues;
//or
C_STRUCT aiBone** mBones
//or even
C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
mVertices[i], mSomeValue[i], mBones[i]
//or
mTextureCoords[0][i];
//c++ side:
C_STRUCT aiVector3D* mVertices;
//haxe side:
@:native("mVertices") public var vertices:Array<Pointer<AiVector3D>>;//or Vector
//generated c++:
aiMesh->ptr->mVertices->__get(i)->ptr->x; //And this won't compile, because it should be aiMesh->ptr->mVertices[i].x; and mVertices does not have __get() function;
//c++ side:
C_STRUCT aiVector3D* mVertices;
//haxe side:
@:native("mVertices") public var vertices:AiMeshVertices;
abstract AiMeshVertices(Pointer<AiVector3D>){ @:arrayAccess public function get(index:Int):AiVector3D { return untyped __cpp__("this1[index]"); }}
@:native('aiVector3D')@:structAccessextern class AiVector3D{ public var x:Float; public var y:Float; public var z:Float;}
Hey,
you should use cpp.RawPointer instead, it represents a real cpp pointer, while Pointer is a hxcpp class that wrap one.
With it you can do array access that'll be correctly generated.
`@:native("mVertices") public var vertices:RawPointer<AiVector3D>;`
`vertices[0]` => `mVertices[0]`.
--
Valentin
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.