~codeforger/pypal/docs

« back to all changes in this revision

Viewing changes to pypal/__init__.py

  • Committer: Michael Rochester
  • Date: 2014-07-20 14:25:45 UTC
  • Revision ID: m.rochester93@googlemail.com-20140720142545-z14oaetu1ls4hy4s
updated some documentation and switched the implimentation of the character class to be a generic body.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        matricies.append(mesh.geometries[i].collada.scene.nodes[i].matrix[2][:3])
148
148
    return objects, matricies
149
149
 
150
 
 
151
 
 
152
 
 
153
150
def notify_collision(body,enabled):
154
151
    """informs the body that it can at any time have its current collision points requested"""
155
 
    _pal.lib.collision_notify(body._body_base,enabled)
 
152
    _pal.lib.collision_notify(body._body,enabled)
156
153
    if enabled:
157
 
        notified_objects.append(weakref.proxy(body))
 
154
        _pal.notified_objects.append(body)
158
155
    elif body.obj in notified_objects:
159
 
        notified_objects.remove(body)
 
156
        _pal.notified_objects.remove(body)
160
157
 
161
158
def get_contacts(body):
162
159
    """returns the bodies that this body is currently in contact with."""
163
 
    contacts = _pal.lib.get_contacts(body._body_base)
 
160
    contacts = _pal.lib.get_contacts(body._body)
164
161
    ret = []
165
162
    _pal.lib.contacts_get_distance.restype = c.c_float
166
163
    try:
169
166
                      weakref.proxy(_pal.all_objects[str(_pal.lib.contacts_get_body_two(contacts,x))])])
170
167
        _pal.lib.remove_contact(contacts)
171
168
    except KeyError:
172
 
        pass
 
169
        print "ERROR PAL HAS FAILED TO SUCCESFULLY CONSTRUCT A COLLISION!!!!"
173
170
    return ret
174
171
    
175
172
def get_unique_contacts(body):