1

hi i reading the book ian millington's coding a physics engine i want to cover the cpp code to java to this BVHNode class on the file collide_coarse.h link https://github.com/idmillington/cyclone-physics/blob/master/include/cyclone/collide_coarse.h on the function recalculateBoundingVolume

template<class BoundingVolumeClass>
    void BVHNode<BoundingVolumeClass>::recalculateBoundingVolume(
    bool recurse
    )
{
    if (isLeaf()) return;

    // Use the bounding volume combining constructor.
    volume = BoundingVolumeClass(
        children[0]->volume,
        children[1]->volume
        );

    // Recurse up the tree
    if (parent) parent->recalculateBoundingVolume(true);
}

now what is this constructor on the template and how can i convert it to java?

matan5
  • 29
  • 2
  • 1
    Problem is that in Java you cannot instantiate generics with use of `new`. Here is a SO question regarding that: https://stackoverflow.com/questions/2434041/instantiating-generics-type-in-java – michelson Jun 14 '20 at 12:19

0 Answers0