I'm using DirectX Mesh object, from which I'm taking Vertices and Indexes. Than I'm putting them inside SoftBody using this line:
Code: Select all
psb = SoftBodyHelpers.CreateFromTriMesh(softBodyWorldInfo, intVerBuf, intIndexBuffer,true);
There is a function in GraphicObjectFactory which is quite similar to what I want to do, but my psb.UserObject is not an Array:
Code: Select all
public void RenderSoftBodyTextured(SoftBody softBody)
{
if (!(softBody.UserObject is Array))
return;
object[] userObjArr = softBody.UserObject as object[];
float[] vertexBuffer = userObjArr[0] as float[];
int [] indexBuffer = userObjArr[1] as int[];
......
Thank you for all responses!