Hi,
There is no function to do that.
The best is to write a MySQL query and load the data yourself from the tables hikashop_product_category and hikashop_product.
Otherwise, you can use that code:
$productClass = hikashop_get('class.product');
$productClass->getProducts();
$categoryClass = hikashop_get('class.category');
$products_in_the_category = $category->getProductsIn($category_id, $productClass->products);
But I don't recommend that as it first loads all the data of all the products in the getProducts() function (which is used for products exports) before loading the products based on the category id and these products list.