Module ode :: Class HashSpace
[show private | hide private]
[frames | no frames]

Type HashSpace

object --+        
         |        
GeomObject --+    
             |    
     SpaceBase --+
                 |
                HashSpace


Multi-resolution hash table space.

This uses an internal data structure that records how each geom overlaps cells in one of several three dimensional grids. Each grid has cubical cells of side lengths 2**i, where i is an integer that ranges from a minimum to a maximum value. The time required to do intersection testing for n objects is O(n) (as long as those objects are not clustered together too closely), as each object can be quickly paired with the objects around it.
Method Summary
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
(minlevel, maxlevel) getLevels()
Gets the size of the smallest and largest cell used in the hash table.
  setLevels(minlevel, maxlevel)
Sets the size of the smallest and largest cell used in the hash table.
    Inherited from SpaceBase
  __iter__(x)
x.__iter__() <==> iter(x)
  __len__(x)
x.__len__() <==> len(x)
  add(geom)
Add a geom to a space.
  collide(arg, callback)
Call a callback function one or more times, for all potentially intersecting objects in the space.
GeomObject getGeom(idx)
Return the geom with the given index contained within the space.
int getNumGeoms()
Return the number of geoms contained within the space.
bool query(geom)
Return True if the given geom is in the space.
  remove(geom)
Remove a geom from a space.
  _id(...)
    Inherited from GeomObject
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  disable()
Disable the geom.
  enable()
Enable the geom.
6-tuple getAABB()
Return an axis aligned bounding box that surrounds the geom.
Body getBody()
Get the body associated with this geom.
long getCategoryBits()
Return the "category" bitfields for this geom.
long getCollideBits()
Return the "collide" bitfields for this geom.
3-tuple getPosition()
Get the current position of the geom.
(w,x,y,z) getQuaternion()
Get the current orientation of the geom.
9-tuple getRotation()
Get the current orientation of the geom.
Space getSpace()
Return the space that the given geometry is contained in, or return None if it is not contained in any space.
bool isEnabled()
Return True if the geom is enabled.
bool isSpace()
Return 1 if the given geom is a space, or 0 if not.
bool placeable()
Returns True if the geom object is a placeable geom.
  setBody(body)
Set the body associated with a placeable geom.
  setCategoryBits(bits)
Set the "category" bitfields for this geom.
  setCollideBits(bits)
Set the "collide" bitfields for this geom.
  setPosition(pos)
Set the position of the geom.
  setQuaternion(q)
Set the orientation of the geom.
  setRotation(R)
Set the orientation of the geom.
    Inherited from object
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(...)
(Constructor)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
ode.SpaceBase.__init__

__new__(T, S, ...)

T.__new__(S, ...) -> a new object with type S, a subtype of T
Returns:
a new object with type S, a subtype of T
Overrides:
ode.SpaceBase.__new__

getLevels()

Gets the size of the smallest and largest cell used in the hash table. The actual size is 2^minlevel and 2^maxlevel respectively.
Returns:
(minlevel, maxlevel)

setLevels(minlevel, maxlevel)

Sets the size of the smallest and largest cell used in the hash table. The actual size will be 2^minlevel and 2^maxlevel respectively.

Generated by Epydoc 2.1 on Sun Feb 4 17:54:12 2007 http://epydoc.sf.net