dchip.cpSpatialIndex

Undocumented in source.

Members

Aliases

cpBBTreeVelocityFunc
alias cpBBTreeVelocityFunc = cpVect function(void* obj)

Bounding box tree velocity callback function. This function should return an estimate for the object's velocity.

cpSpatialIndexBBFunc
alias cpSpatialIndexBBFunc = cpBB function(void* obj)

Spatial indexes are data structures that are used to accelerate collision detection and spatial queries. Chipmunk provides a number of spatial index algorithms to pick from and they are programmed in a generic way so that you can use them for holding more than just cpShape structs.

cpSpatialIndexContainsImpl
alias cpSpatialIndexContainsImpl = cpBool function(cpSpatialIndex* index, void* obj, cpHashValue hashid)
Undocumented in source.
cpSpatialIndexCountImpl
alias cpSpatialIndexCountImpl = int function(cpSpatialIndex* index)
Undocumented in source.
cpSpatialIndexDestroyImpl
alias cpSpatialIndexDestroyImpl = void function(cpSpatialIndex* index)
Undocumented in source.
cpSpatialIndexEachImpl
alias cpSpatialIndexEachImpl = void function(cpSpatialIndex* index, cpSpatialIndexIteratorFunc func, void* data)
Undocumented in source.
cpSpatialIndexInsertImpl
alias cpSpatialIndexInsertImpl = void function(cpSpatialIndex* index, void* obj, cpHashValue hashid)
Undocumented in source.
cpSpatialIndexIteratorFunc
alias cpSpatialIndexIteratorFunc = void function(void* obj, void* data)

Spatial index/object iterator callback function type.

cpSpatialIndexQueryFunc
alias cpSpatialIndexQueryFunc = cpCollisionID function(void* obj1, void* obj2, cpCollisionID id, void* data)

Spatial query callback function type.

cpSpatialIndexQueryImpl
alias cpSpatialIndexQueryImpl = void function(cpSpatialIndex* index, void* obj, cpBB bb, cpSpatialIndexQueryFunc func, void* data)
Undocumented in source.
cpSpatialIndexReindexImpl
alias cpSpatialIndexReindexImpl = void function(cpSpatialIndex* index)
Undocumented in source.
cpSpatialIndexReindexObjectImpl
alias cpSpatialIndexReindexObjectImpl = void function(cpSpatialIndex* index, void* obj, cpHashValue hashid)
Undocumented in source.
cpSpatialIndexReindexQueryImpl
alias cpSpatialIndexReindexQueryImpl = void function(cpSpatialIndex* index, cpSpatialIndexQueryFunc func, void* data)
Undocumented in source.
cpSpatialIndexRemoveImpl
alias cpSpatialIndexRemoveImpl = void function(cpSpatialIndex* index, void* obj, cpHashValue hashid)
Undocumented in source.
cpSpatialIndexSegmentQueryFunc
alias cpSpatialIndexSegmentQueryFunc = cpFloat function(void* obj1, void* obj2, void* data)

Spatial segment query callback function type.

cpSpatialIndexSegmentQueryImpl
alias cpSpatialIndexSegmentQueryImpl = void function(cpSpatialIndex* index, void* obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void* data)
Undocumented in source.

Functions

cpSpatialIndexCollideStatic
void cpSpatialIndexCollideStatic(cpSpatialIndex* dynamicIndex, cpSpatialIndex* staticIndex, cpSpatialIndexQueryFunc func, void* data)
Undocumented in source. Be warned that the author may not have intended to support it.
cpSpatialIndexContains
cpBool cpSpatialIndexContains(cpSpatialIndex* index, void* obj, cpHashValue hashid)

Returns true if the spatial index contains the given object. Most spatial indexes use hashed storage, so you must provide a hash value too.

cpSpatialIndexCount
int cpSpatialIndexCount(cpSpatialIndex* index)

Get the number of objects in the spatial index.

cpSpatialIndexDestroy
void cpSpatialIndexDestroy(cpSpatialIndex* index)

Destroy a spatial index.

cpSpatialIndexEach
void cpSpatialIndexEach(cpSpatialIndex* index, cpSpatialIndexIteratorFunc func, void* data)

Iterate the objects in the spatial index. @c func will be called once for each object.

cpSpatialIndexFree
void cpSpatialIndexFree(cpSpatialIndex* index)

Destroy and free a spatial index.

cpSpatialIndexInit
cpSpatialIndex* cpSpatialIndexInit(cpSpatialIndex* index, cpSpatialIndexClass* klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex* staticIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
cpSpatialIndexInsert
void cpSpatialIndexInsert(cpSpatialIndex* index, void* obj, cpHashValue hashid)

Add an object to a spatial index. Most spatial indexes use hashed storage, so you must provide a hash value too.

cpSpatialIndexQuery
void cpSpatialIndexQuery(cpSpatialIndex* index, void* obj, cpBB bb, cpSpatialIndexQueryFunc func, void* data)

Perform a rectangle query against the spatial index, calling @c func for each potential match.

cpSpatialIndexReindex
void cpSpatialIndexReindex(cpSpatialIndex* index)

Perform a full reindex of a spatial index.

cpSpatialIndexReindexObject
void cpSpatialIndexReindexObject(cpSpatialIndex* index, void* obj, cpHashValue hashid)

Reindex a single object in the spatial index.

cpSpatialIndexReindexQuery
void cpSpatialIndexReindexQuery(cpSpatialIndex* index, cpSpatialIndexQueryFunc func, void* data)

Simultaneously reindex and find all colliding objects. @c func will be called once for each potentially overlapping pair of objects found. If the spatial index was initialized with a static index, it will collide it's objects against that as well.

cpSpatialIndexRemove
void cpSpatialIndexRemove(cpSpatialIndex* index, void* obj, cpHashValue hashid)

Remove an object from a spatial index. Most spatial indexes use hashed storage, so you must provide a hash value too.

cpSpatialIndexSegmentQuery
void cpSpatialIndexSegmentQuery(cpSpatialIndex* index, void* obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void* data)

Perform a segment query against the spatial index, calling @c func for each potential match.

dynamicToStaticIter
void dynamicToStaticIter(void* obj, dynamicToStaticContext* context)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

cpSpatialIndex
struct cpSpatialIndex
cpSpatialIndexClass
struct cpSpatialIndexClass
Undocumented in source.
dynamicToStaticContext
struct dynamicToStaticContext
Undocumented in source.

Meta