Has anyone used the JPCT collision listeners? I have been playing but I keep generating initialisation errors. Code goes some thing like this...
Sub Process_Globals
Dim ball1 As JpctObject3D
Dim prim As JpctPrimitives
Dim ball1cl As JpctCollisionListener
End Sub
Sub Activity_Create(FirstTime As Boolean)
/* lots missing here */
ball1.Initialize3(prim.getSphere(10))
ball1cl.Initialize("ball1", False) /* have also tried ... ball1cl.initialise("ball1_collision_listener", false)
ball1.CollisionMode = ball1.COLLISION_CHECK_SELF
ball1.addCollisionListener(ball1cl)
/* more missing here */
end sub
Sub ball1_collision_listener(coleven As Int)
Log("ball1 collision")
End Sub
Errors tell me I need to initialise ball1cl when I try and bind it with ball1.addCollisionListener.
Anyone got any pointer as to what I have missed? fouled up?
Cheers in advance, John
P.S. I think this may be in the wrong place! If it is can a mod move to the correct location please. Sorry in advance.
Sub Process_Globals
Dim ball1 As JpctObject3D
Dim prim As JpctPrimitives
Dim ball1cl As JpctCollisionListener
End Sub
Sub Activity_Create(FirstTime As Boolean)
/* lots missing here */
ball1.Initialize3(prim.getSphere(10))
ball1cl.Initialize("ball1", False) /* have also tried ... ball1cl.initialise("ball1_collision_listener", false)
ball1.CollisionMode = ball1.COLLISION_CHECK_SELF
ball1.addCollisionListener(ball1cl)
/* more missing here */
end sub
Sub ball1_collision_listener(coleven As Int)
Log("ball1 collision")
End Sub
Errors tell me I need to initialise ball1cl when I try and bind it with ball1.addCollisionListener.
Anyone got any pointer as to what I have missed? fouled up?
Cheers in advance, John
P.S. I think this may be in the wrong place! If it is can a mod move to the correct location please. Sorry in advance.
Last edited: