I’m using Nvidia Flex to make rigid objects, but I have a problem when positioning an object far from the (0, 0) location. If I start a simulation with a rigid ( I make it using CreateParticleShape function ) positioned at 2 meter above the floor, the object must to fall down with a velocity of ( 0.0, gravity, 0.0). But if the initial position of the rigid object is far from (0,0), the rigid object has a different fall down velocity (?, gravity, ?).
I have done different tests using the flexDemo. The following code is an example.
void Initialize()
{
float maxShapeRadius = 0.25f;
float minShapeRadius = 0.1f;
int dimx = 5;
int dimy = 5;
int dimz = 5;
float radius = 0.05f;
int phase = flexMakePhase(0, eFlexPhaseSelfCollide);
g_numSubsteps = 2;
g_params.mRadius = radius;
g_params.mDynamicFriction = 0.25f;
g_params.mDissipation = 0.0f;
g_params.mRestitution = 0.0;
g_params.mNumIterations = 2;
g_params.mParticleCollisionMargin = g_params.mRadius*0.5f;
g_params.mShapeCollisionMargin = g_params.mRadius*0.5f;
g_params.mMaxSpeed = 0.5f*radius*float(g_numSubsteps)/g_dt;
g_params.mCollisionDistance = radius*0.5f;
g_params.mShapeCollisionMargin = 0.00001f;
Vec3 shape_lower = Vec3( 0, 2.0, -100.0 );
CreateParticleShape( "../../data/sphere.ply", shape_lower, 0.75f, 0.0f, g_params.mRadius, Vec3(), 10.f, true, 1.0f, flexMakePhase( 0, 0 ), false);
}
Could someone give me some hints on how to resolve that ?
Thanks in advance.
Angel.