Collision solids on instances

Hi rdb;

Performing your suggestion regarding the collision issue and passing ralph as the second argument yields this error:

Assertion failed: target.node()->is_of_type(ActorNode::get_class_type()) at line
 212 of c:\buildslave\release_sdk_win32\build\panda3d\panda\src\physics\physicsC
ollisionHandler.cxx
Assertion failed: validate_target(target) at line 117 of c:\buildslave\release_s
dk_win32\build\panda3d\panda\src\collide\collisionHandlerPhysical.cxx
Traceback (most recent call last):
  File "game_simulator.py", line 684, in <module>
    pusher.addCollider(cnodePath, ralph)
AssertionError: target.node()->is_of_type(ActorNode::get_class_type()) at line 2
12 of c:\buildslave\release_sdk_win32\build\panda3d\panda\src\physics\physicsCol
lisionHandler.cxx

Next; even though the node is attached to ralph shouldn’t a collision occur on it? But none occurs. Changing to “CollisionHandlerPusher” still gives the same result; no collision occurs:

ralph = Actor("samples/Roaming-Ralph/models/ralph",
                {"run":"samples/Roaming-Ralph/models/ralph-run",
                "walk":"samples/Roaming-Ralph/models/ralph-walk"})
ralph.reparentTo(render)
cs = CollisionSphere(ralph.getBounds().getCenter(), ralph.getBounds().getRadius())
cnodePath = ralph.attachNewNode(CollisionNode('cnode'))
cnodePath.node().addSolid(cs)
pusher=CollisionHandlerPusher()
pusher.addCollider(cnodePath, ralph)
travz=CollisionTraverser()
travz.addCollider(cnodePath, pusher)
cnodePath.show()


As you can see from the above image the collision solids parented to ralph and the instance of the boulder model intersect. Could the error be connected to instancing? To instance the boulder model this is what I do:

#load the model:
rock_boulder_l=loader.loadModel("world_resources/rock_boulder_l.egg")
rock_boulder_l.reparentTo(render)
rock_col=rock_boulder_l.find("**/rock_boulder_l_collide")
rock_col.show()

#... instance it later on when necessary:
new_np=render.attachNewNode('dum_res')
resource_refs[resource_biomes[indx_res+1][rand_sel]].show()
resource_refs[resource_biomes[indx_res+1][rand_sel]].copyTo(new_np)
resource_refs[resource_biomes[indx_res+1][rand_sel]].hide()
new_np.show()

#note->the boulder was added to a list that will be referenced whenever the player enters a biome that it [the boulder] belongs to; so the above obtains the model
#from the list using its index therein.

As for the terrain no it does not have collision geometry; I am using the GeoMipMap method to generate procedural terrains so I just use the “getElevation()” method to position the various models/actors at their respective heights within the terrain given their x and y coordinates.