Here I call the NewtonBodyAddBuoyancyForce function in the add body force & torque callback:
- Code: Select all
NewtonBodyAddBuoyancyForce( newtonBody,0.1,0.1,0.1,[TWorld.current.gravity.x,TWorld.current.gravity.y,TWorld.current.gravity.z],NewtonGetBuoyancyPlane,Null)
And here is my NewtonGetBuoyancyPlane callback:
- Code: Select all
Function NewtonGetBuoyancyPlane:Int(collisionID:Byte Ptr,context:Byte Ptr,globalSpaceMatrix:Float Ptr,globalSpacePlane:Float Ptr) "c"
globalSpacePlane[0]=0.0
globalSpacePlane[1]=1.0
globalSpacePlane[2]=0.0
globalSpacePlane[3]=-15.6
Return 1
EndFunction
This only slows down bodies when they roll down a beach into the ocean. They are harder to roll, but they won't float. How can I increase the force so they float?