public static void exports ( Xml root , CollisionFunction function ) { Check . notNull ( root ) ; Check . notNull ( function ) ; final Xml node = root . createChild ( FUNCTION ) ; if ( function instanceof CollisionFunctionLinear ) { final CollisionFunctionLinear linear = ( CollisionFunctionLinear ) function ; node . writeString ( TYPE , CollisionFunctionType . LINEAR . name ( ) ) ; node . writeDouble ( A , linear . getA ( ) ) ; node . writeDouble ( B , linear . getB ( ) ) ; } else { node . writeString ( TYPE , String . valueOf ( function . getType ( ) ) ) ; } }
Export the collision function data as a node .