|
__init__(self,
iterations=10)
Create a new instace of the Space |
|
|
|
|
|
add(self,
*objs)
Add one or many shapes, bodies or joints to the space |
|
|
|
add_static(self,
*objs)
Add one or many static shapes to the space |
|
|
|
remove(self,
*objs)
Remove one or many shapes, bodies or constraints from the space |
|
|
|
remove_static(self,
*objs)
Remove one or many static shapes from the space |
|
|
|
reindex_static(self)
Update the collision detection info for the static shapes in the
space. You only need to call this if you move one of the static shapes. |
|
|
|
reindex_shape(self,
shape)
Update the collision detection data for a specific shape in the
space. |
|
|
|
step(self,
dt)
Update the space for the given time step. Using a fixed time step is
highly recommended. Doing so will increase the efficiency of the
contact persistence, requiring an order of magnitude fewer iterations
to resolve the collisions in the usual case. |
|
|
|
add_collision_handler(self,
a,
b,
begin=None,
pre_solve=None,
post_solve=None,
separate=None,
*args,
**kwargs)
Add a collision handler for given collision type pair. |
|
|
|
set_default_collision_handler(self,
begin=None,
pre_solve=None,
post_solve=None,
separate=None,
*args,
**kwargs)
Register a default collision handler to be used when no specific
collision handler is found. If you do nothing, the space will be given
a default handler that accepts all collisions in begin() and
pre_solve() and does nothing for the post_solve() and separate()
callbacks. |
|
|
|
|
|
add_post_step_callback(self,
callback_function,
obj,
*args,
**kwargs)
Add a function to be called last in the next simulation step. |
|
|
|
point_query(self,
point,
layers=-1,
group=0)
Query space at point filtering out matches with the given layers
and group. Return a list of found shapes. |
|
|
|
point_query_first(self,
point,
layers=-1,
group=0)
Query space at point and return the first shape found matching the
given layers and group. Returns None if no shape was found. |
|
|
|
segment_query(self,
start,
end,
layers=-1,
group=0)
Query space along the line segment from start to end filtering out
matches with the given layers and group. |
|
|
|
segment_query_first(self,
start,
end,
layers=-1,
group=0)
Query space along the line segment from start to end filtering out
matches with the given layers and group. Only the first shape
encountered is returned and the search is short circuited.
Returns None if no shape was found. |
|
|
|
bb_query(self,
bb,
layers=-1,
group=0)
Perform a fast rectangle query on the space. |
|
|
|
shape_query(self,
shape)
Query a space for any shapes overlapping the given shape |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
|
shapes
A list of the shapes added to this space
|
|
static_shapes
A list of the static shapes added to this space
|
|
bodies
A list of the bodies added to this space
|
|
constraints
A list of the constraints added to this space
|
|
static_body
A convenience static body already added to the space
|
|
iterations
Number of iterations to use in the impulse solver to solve
contacts.
|
|
gravity
Default gravity to supply when integrating rigid body motions.
|
|
damping
Damping rate expressed as the fraction of velocity bodies
retain each second.
|
|
idle_speed_threshold
Speed threshold for a body to be considered idle.
The default value of 0 means to let the space guess a good threshold
based on gravity.
|
|
sleep_time_threshold
Time a group of bodies must remain idle in order to fall
asleep.
|
|
collision_slop
Amount of allowed penetration.
|
|
collision_bias
Determines how fast overlapping shapes are pushed apart.
|
|
collision_persistence
Number of frames that contact information should persist.
|
|
enable_contact_graph
Rebuild the contact graph during each step.
|
Inherited from object :
__class__
|