BulletHeightFieldShape

ive been looking at the manual examples for BulletHeightFieldShape and im getting no errors but nothing is showing when i run it. code:

height = 100.0
        img = PNMImage(Filename('map.png'))
        shape = BulletHeightfieldShape(img, height, ZUp)

        offset = img.getXSize() / 2.0 - 0.5
        terrain = GeoMipTerrain('terrain')
        terrain.setHeightfield(img)
        terrainNP = terrain.getRoot()
        terrainNP.setSz(height)
        terrainNP.setPos(-offset, -offset, -height / 2.0)
        terrain.generate()

im assuming its something stupid like not attaching shape to bullet world but i only know of world.attachRigidBody() and a google search gave no results. im also unaware as to why the GeoMipTerrain is not being shown either.

edit: i have bulletdebug on seeing as collision solids cant be seen w/o it lol

edit: terrainNP.reparentTo(render) xD still unsure about the bulletHeightFieldShape tho

lol i need to stop asking stupid questions -.-

node = BulletRigidBodyNode('Box')
        node.setMass(0)

        height = 20.0
        img = PNMImage(Filename('map.png'))
        shape = BulletHeightfieldShape(img, height, ZUp)
        node.addShape(shape)
        self.world.attachRigidBody(node)

        offset = img.getXSize() / 2.0 - 0.5
        terrain = GeoMipTerrain('terrain')
        terrain.setHeightfield(img)
        terrainNP = terrain.getRoot()
        terrainNP.setSz(height)
        terrainNP.setPos(-offset, -offset, -height / 2.0)
        terrainNP.reparentTo(render)
        terrain.generate()
  • maybe that will help someone in the future xD