// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: Oct 21, 2002 // // Description: // Get fluid properties at point // returns 0 if point is outside // // // Input Arguments: // fluid, world space position, attribute to get // fluidValueAtPoint fluid1 -2.4 -2.4 0 density; // // Return Value: // float // global proc float fluidValueAtPoint( string $fluid, float $xp, float $yp, float $zp, string $fluidAttr ) { // use this for density, temperature, fuel int $vox[] = `fluidVoxelInfo -objectSpace false -cb -voxel $xp $yp $zp $fluid`; if( size($vox) == 0) return 0; float $values[] = `getFluidAttr -at $fluidAttr -xi $vox[0] -yi $vox[1] -zi $vox[2] $fluid`; return $values[0]; }