3D ocean water with buoyancy physics

Share with us how are you using the powerrrr of the force

Moderator: Alain

3D ocean water with buoyancy physics

Postby Leadwerks » Sat Nov 08, 2008 2:44 am

User avatar
Leadwerks
 
Posts: 569
Joined: Fri Oct 27, 2006 2:54 pm

Re: 3D ocean water with buoyancy physics

Postby Jallen » Tue Nov 11, 2008 1:28 pm

Very nice. One thing i would say is that if the physical body of the water was the same shape as the waves, it would actually get washed up on shore and things :D
Jallen
 
Posts: 2
Joined: Sat Dec 22, 2007 10:52 am

Re: 3D ocean water with buoyancy physics

Postby carli2 » Sun Feb 24, 2013 6:04 pm

Why is that feature deactivated in Newton 3.0?
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: 3D ocean water with buoyancy physics

Postby Julio Jerez » Mon Feb 25, 2013 9:54 am

it is not, it may have to be refactored.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: 3D ocean water with buoyancy physics

Postby carli2 » Mon Feb 25, 2013 5:12 pm

Julio Jerez wrote:it is not, it may have to be refactored.


Okay, then it's a bug.

NewtonBodyAddBuoyancyForce does not work. Can you please test it? All objects in the water are falling down. It worked before.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: 3D ocean water with buoyancy physics

Postby carli2 » Sun Apr 21, 2013 11:01 am

I found the reason why buoyancy does not work.

Code: Select all
void dgBody::AddBuoyancyForce (dgFloat32 fluidDensity, dgFloat32 fluidLinearViscousity, dgFloat32 fluidAngularViscousity, const dgVector& gravityVector, GetBuoyancyPlane buoyancuPlane, void* const context)
{
        _ASSERTE (0);
/*
        if (m_mass.m_w > dgFloat32 (1.0e-2f)) {
                dgVector volumeIntegral (m_collision->CalculateVolumeIntegral (m_collision->GetGlobalMatrix(), buoyancuPlane, context));
                if (volumeIntegral.m_w > dgFloat32 (1.0e-4f)) {

//                      dgVector buoyanceCenter (volumeIntegral - m_matrix.m_posit);
                        dgVector buoyanceCenter (volumeIntegral - m_globalCentreOfMass);

                        dgVector force (gravityVector.Scale (-fluidDensity * volumeIntegral.m_w));
                        dgVector torque (buoyanceCenter * force);

                        dgFloat32 damp = GetMax (GetMin ((m_veloc % m_veloc) * dgFloat32 (100.0f) * fluidLinearViscousity, dgFloat32 (1.0f)), dgFloat32(dgFloat32 (10.0f)));
                        force -= m_veloc.Scale (damp);

                        //damp = (m_omega % m_omega) * dgFloat32 (10.0f) * fluidAngularViscousity;
                        damp = GetMax (GetMin ((m_omega % m_omega) * dgFloat32 (1000.0f) * fluidAngularViscousity, dgFloat32(0.25f)), dgFloat32(2.0f));
                        torque -= m_omega.Scale (damp);

//                      _ASSERTE (dgSqrt (force % force) < (dgSqrt (gravityVector % gravityVector) * m_mass.m_w * dgFloat32 (100.0f)));
//                      _ASSERTE (dgSqrt (torque % torque) < (dgSqrt (gravityVector % gravityVector) * m_mass.m_w * dgFloat32 (100.0f) * dgFloat32 (10.0f)));
                       
                        dgThreadHiveScopeLock lock (m_world, &m_criticalSectionLock);
                        m_accel += force;
                        m_alpha += torque;
                }
        }
*/
}


There is something wrong. You have comments there and assert 0.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm


Return to User Gallery

Who is online

Users browsing this forum: No registered users and 13 guests