CommitTriangles i found in only one plugin source i think standard usage isMrAdults wrote:Not sure what you mean by "send" the vertex buffer. You bind the buffer before using CommitTriangles, that's the standard usage. If you mean you want to automatically draw triangles in implied order from a vertex buffer, calling CommitTriangles with a NULL buffer is valid and will do that.
Code: Select all
....
rapi->rpgBegin(RPGEO_TRIANGLE);
....
if (sm.bVertexWeights)
{
rapi->rpgVertBoneIndexUI(&sm.VertexData[sm.IndexData[vi]].BoneIndex[0], sm.VertexData[sm.IndexData[vi]].BoneIndex.Num());
rapi->rpgVertBoneWeightF(&sm.VertexData[sm.IndexData[vi]].BoneWeight[0], sm.VertexData[sm.IndexData[vi]].BoneWeight.Num());
}
if (sm.bVertexNormals) rapi->rpgVertNormal3f((float*) &sm.VertexData[sm.IndexData[vi]].NX);
if (sm.bVertexTangents) rapi->rpgVertTan4f((float*) &sm.VertexData[sm.IndexData[vi]].TX);
if (sm.bVertexUV) rapi->rpgVertUV2f((float*) &sm.VertexData[sm.IndexData[vi]].U, 0);
if (sm.bVertexPositions) rapi->rpgVertex3f((float*) &sm.VertexData[sm.IndexData[vi]].PX);
Yes, you right, crash gone, thx ...MrAdults wrote: I'm not sure why your bone data would be crashing there, the printout looks valid and so do the addresses. Can you upload a sample file for me to crash it with?
Edit: I just realized what your problem is. You're using the default struct packing (4 bytes) but internally Noesis uses 1-byte alignment for the shared structures like modelBone_t. I'll add a pragma pack push/pop around pluginshare.h to enforce it, but you can also fix it by putting a push to 1 byte alignment before you include it.
P.S. Version of Ogre3d noesys plugin with weights and bones support http://rghost.net/29614351
P.P.S.
Code: Select all
typedef struct modelBone_s
{
int index;
char name[32];
modelMatrix_t mat;
char parentName[32];
modelBoneExData_t eData;
} modelBone_t;
dump
Code: Select all
11:17:19: N: lvl1_gimmick_spiketrap_bone_spikes01
11:17:19: N: lvl1_gimmick_spiketrap_bone_spi
11:17:19: N: lvl1_gimmick_spiketrap_bone_spikes02
11:17:19: N: lvl1_gimmick_spiketrap_bone_spi