| 1 | /* |
| 2 | * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. |
| 3 | * |
| 4 | * NVIDIA CORPORATION and its licensors retain all intellectual property |
| 5 | * and proprietary rights in and to this software, related documentation |
| 6 | * and any modifications thereto. Any use, reproduction, disclosure or |
| 7 | * distribution of this software and related documentation without an express |
| 8 | * license agreement from NVIDIA CORPORATION is strictly prohibited. |
| 9 | */ |
| 10 | // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. |
| 11 | // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. |
| 12 | |
| 13 | |
| 14 | #ifndef PX_PARTICLESYSTEM_NXPARTICLEFLUIDREADDATA |
| 15 | #define PX_PARTICLESYSTEM_NXPARTICLEFLUIDREADDATA |
| 16 | /** \addtogroup particles |
| 17 | @{ |
| 18 | */ |
| 19 | |
| 20 | #include "particles/PxParticleReadData.h" |
| 21 | |
| 22 | #ifndef PX_DOXYGEN |
| 23 | namespace physx |
| 24 | { |
| 25 | #endif |
| 26 | |
| 27 | /** |
| 28 | \brief Data layout descriptor for reading fluid particle data from the SDK. |
| 29 | |
| 30 | Additionally to PxParticleReadData, the density can be read from the SDK. |
| 31 | @see PxParticleReadData PxParticleFluid.lockParticleFluidReadData() |
| 32 | */ |
| 33 | class PxParticleFluidReadData : public PxParticleReadData |
| 34 | { |
| 35 | public: |
| 36 | |
| 37 | /** |
| 38 | \brief Particle density data. |
| 39 | |
| 40 | The density depends on how close particles are to each other. The density values are normalized such that: |
| 41 | <ol> |
| 42 | <li> |
| 43 | Particles which have no neighbors (no particles closer than restParticleDistance * 2) |
| 44 | will have a density of zero. |
| 45 | <li> |
| 46 | Particles which are at rest density (distances corresponding to restParticleDistance in the mean) |
| 47 | will have a density of one. |
| 48 | </ol> |
| 49 | |
| 50 | The density buffer is only guaranteed to be valid after the particle |
| 51 | fluid has been simulated. Otherwise densityBuffer.ptr() is NULL. This also |
| 52 | applies to particle fluids that are not assigned to a scene. |
| 53 | */ |
| 54 | PxStrideIterator<const PxF32> densityBuffer; |
| 55 | |
| 56 | /** |
| 57 | \brief virtual destructor |
| 58 | */ |
| 59 | virtual ~PxParticleFluidReadData() {} |
| 60 | |
| 61 | }; |
| 62 | |
| 63 | #ifndef PX_DOXYGEN |
| 64 | } // namespace physx |
| 65 | #endif |
| 66 | |
| 67 | /** @} */ |
| 68 | #endif |
| 69 | |