Physics Collision Handler

Hello, this example is not clear to me and some explanation would be so helpful. Supposing I have loaded my forces and physics correctly, I can not tell how to connect these objects to the physicscollisionhandler.

To be more clear where do I attach my model and / or actor node to the physics collision handler in this example?

anp = render.attachNewNode(ActorNode('actor'))
fromObject = anp.attachNewNode(CollisionNode('colNode'))
fromObject.node().addSolid(CollisionSphere(0, 0, 0, 1))
pusher = PhysicsCollisionHandler()
pusher.addCollider(fromObject, anp)

My own code is below if my question is ill informed;

self.m = loader.loadModel('sf1_v3.egg')
      self.m.setPos(x, y, z)
      mss = 1
      self.m.setScale(mss, mss, mss)

      # Physics Set-up
      self.p = NodePath(PandaNode("pnode"))
      self.p.reparentTo(render) = ActorNode('mphysics')
      self.pnn = self.p.attachNewNode(

      # Physics mod

      # FORCES
      # Gravity
      self.g = ForceNode('world-forces') = render.attachNewNode(self.g) = LinearVectorForce(0, 0, -0.05)

      self.arr = [-1.5, 1.5]
      self.d1 = self.rn.random() + self.arr[self.rn.randint(0, 1)]
      self.d2 = self.rn.random() + self.arr[self.rn.randint(0, 1)]
      self.d3 = self.rn.random() + self.arr[self.rn.randint(0, 1)]

      # Collision Physics
      self.floor = loader.loadModel('floors')
      self.floor.setScale(100, 100, 1)

      modelpch = render.attachNewNode(ActorNode('mphysics'))
      floorpch = modelpch.attachNewNode(CollisionNode('mphysics'))
      floorpch.node().addSolid(CollisionSphere(0, 0, 0, 10))
      pusher = PhysicsCollisionHandler()
      pusher.addCollider(floorpch, modelpch)

I made a pseudo-tutorial here if you wanna take a look.
What you’re asking I guess is explained it intermediate/step3 and some also in advanced/step3. Hope could help you out.

I used step 8; the beginner’s physics and for some reason not matter what I do my objects move sideways instead of down as one would expect from gravity, please take a look at the code, this is driving me nuts;

from pandac.PandaModules import *
from direct.showbase import DirectObject
import direct.directbase.DirectStart
from random import Random
import math
from direct.task import Task
import direct.directbase.DirectStart
import sys, os
import time
from direct.showbase.DirectObject import DirectObject
from direct.interval.SoundInterval import SoundInterval
from pandac.PandaModules import AmbientLight,DirectionalLight,PointLight,PolylightNode
from pandac.PandaModules import Point3,Vec3,Vec4
from pandac.PandaModules import VBase3,VBase4
from pandac.PandaModules import Filename
from pandac.PandaModules import PandaNode,NodePath,Camera,TextNode
from pandac.PandaModules import AngularEulerIntegrator

class World (DirectObject):

  def __init__(self):
    # Basic Setup Stuff
    self.accept('escape', sys.exit)  
    base.setBackgroundColor(0, 0, 0)

    # Light
    alight = AmbientLight('alight')
    alight.setColor(VBase4(1, 1, 1, 1))
    alnp = render.attachNewNode(alight)
    # Collision Physics of 1st Plane
    self.collisionHandler = PhysicsCollisionHandler()
    cp = CollisionPlane(Plane(Vec3(0, 0, 0), Point3(0, 0, 0)))
    planeNP = base.render.attachNewNode(CollisionNode('planecnode'))

    self.g = ForceNode('world-forces') = base.render.attachNewNode(self.g) = LinearVectorForce(0, 0, -0.05)

    # Create many objects
    self.irange = 5
    self.jrange = 5
    cent = 20
    sp = 40
    rn = Random()

    for i in range(0, self.irange):
      for j in range(0, self.jrange):
	thet = t(self, rn.randint(0, sp) - cent, rn.randint(0, sp) - cent, \
	  rn.randint(1, 40 * sp) - cent)

# Create model and apply physics to it
class t(DirectObject):
  def __init__(self, thew, x, y, z):
      # Basic Set-up
      self.rn = Random()
      self.w = thew
      self.m = loader.loadModel('sf1_v3.egg')
      self.m.setPos(x, y, z)
      mss = 1
      self.m.setScale(mss, mss, mss)

      # Collision Physics

      ballCollider = ballANP.attachNewNode(CollisionNode('ballcnode'))
      self.w.collisionHandler.addCollider(ballCollider, ballANP)
      base.cTrav.addCollider(ballCollider, self.w.collisionHandler)

w = World()


man, that code is quite a mess, you gotta wipe the dirt first (espec. the imports) then check carefully out two things:
that CollisionPlane got no dimension - should be like this

cp = CollisionPlane(Plane(Vec3(0, 0, 1), Point3(0, 0, 0)))

then check twice the t object setup it is not as in my step 8.
I suggest you to grab the entire phyball_dispenser function and carefully adapt it to be a class. I said carefully because this is stuff quite complex so if you miss a step nothing work as it should.
Let me know your progress