Click or drag to resize
DigitalRuneCollisionFilter Class
A basic collision filter supporting pairwise filtering and collision groups.
Inheritance Hierarchy
SystemObject
  DigitalRune.Geometry.CollisionsCollisionFilter

Namespace: DigitalRune.Geometry.Collisions
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public class CollisionFilter : ICollisionFilter, 
	IPairFilter<CollisionObject>

The CollisionFilter type exposes the following members.

Constructors
  NameDescription
Public methodCollisionFilter
Initializes a new instance of the CollisionFilter class for max. 32 different collision groups.
Public methodCollisionFilter(Int32)
Initializes a new instance of the CollisionFilter class for the given max. number of collision groups.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFilter
Determines whether the given CollisionObjects can collide.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGet(Int32)
Returns if collisions with the given collision group are enabled.
Public methodGet(Int32, Int32)
Returns if collisions between two collision groups are enabled.
Public methodGet(CollisionObject, CollisionObject)
Returns if collisions between two CollisionObjects are enabled (without testing collision groups).
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnChanged
Raises the Changed event.
Public methodReset
Resets this filter. All collisions will be enabled.
Public methodSet(Int32, Boolean)
Enables or disables collisions with the given collision group.
Public methodSet(Int32, Int32, Boolean)
Enables or disables collisions between a pair of collision groups.
Public methodSet(CollisionObject, CollisionObject, Boolean)
Enables or disables collisions between the given CollisionObjects.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyMaxNumberOfGroups
The maximum number of supported collision groups.
Top
Events
  NameDescription
Public eventChanged
Occurs when the filter rules were changed.
Top
Remarks

Per default, all collisions are enabled. Collisions can be disabled for pairs of CollisionObjects, for a pair of collision groups, or for a whole collision group. Collision groups are identified by an Int32 ID, stored in the CollisionObject (see CollisionGroup). Per default, the collision filter supports only collision group IDs in the range 0-31. This limit can be changed in the constructor (see CollisionFilter(Int32)).

Two collision objects A and B will NOT collide if one of the following conditions is met:

See Also