|
Re: [cgkit-user] re: ode collisions
From: Matthias Baas <baas@ir...> - 2006-05-08 19:06
|
Ricardo Kirkner wrote:
> How do I write an interactive controller for my bodies (basically, how
> can I controll my joints throught the mouse/keyboard)?
You can register callback functions with the event manager as follows:
def onLeftDown(evt):
"""Callback function."""
print "Left down event:",evt
eventmanager.connect(LEFT_DOWN, onLeftDown)
See http://cgkit.sourceforge.net/doc2/module-cgkit.events.html for a
full list of events you can connect to and for a list of event objects
you might receive as input (the arguments depend on the type of event).
See http://cgkit.sourceforge.net/doc2/module-cgkit.eventmanager.html for
a description of the event manager.
As you mentioned the ODEDynamics component, this one can also emit
events in the case of collisions (you have to set collision_events=True
in the constructor). You can register with the ODE_COLLISION event which
will send ODECollisionEvent objects
(http://cgkit.sourceforge.net/doc2/odecollisionevent.html).
- Matthias -
|
| Thread | Author | Date | |
|---|---|---|---|
| [cgkit-user] re: ode collisions | Ricardo Kirkner <ricardokirkner@gm...> |
|
|