In the following exerpt from your hieght field demo and I have a few questions about it:
Code: Select all
void Init_Floatyness (HfFluidDemo* fluidDemo)
{
btHfFluid* fluid = NULL;
fluid = new btHfFluid (btScalar(0.25), 100, 100);
btTransform xform;
xform.setIdentity ();
xform.getOrigin() = btVector3(btScalar(-10.0), btScalar(-5.0), btScalar(-10.0));
fluid->setWorldTransform (xform);
fluid->setHorizontalVelocityScale (btScalar(0.0f));
fluid->setVolumeDisplacementScale (btScalar(0.0f));
fluidDemo->getHfFluidDynamicsWorld()->addHfFluid (fluid);
for (int i = 0; i < fluid->getNumNodesLength()*fluid->getNumNodesWidth(); i++)
{
fluid->setFluidHeight(i, btScalar(5.0f));
}
Are numNodesWidth and numNodesLength the dimensions of water plane? If so, what is the value of their units in comparison to meters?
Also, in the demo gridCellWidth was only 0.25. What is the purpose of this variable and how does it compare to the dimensions of the water block?
Torque primarily uses a height and width system based upon scale and a grid element size variable as in the following
Code: Select all
mWidth = (U32)mFloor( mObjScale.x / mGridElementSize ) + 1;
mHeight = (U32)mFloor( mObjScale.y / mGridElementSize ) + 1;
When you set the transform there were hard coded numbers in the example, how would that compare to a world transform in a game if you were trying to create this were an exisitng object is?
Finally, what do these do? They are set to zero in the demo.
Code: Select all
fluid->setHorizontalVelocityScale (btScalar(0.0f));
fluid->setVolumeDisplacementScale (btScalar(0.0f));