PlayRho  2.0.0
An interactive physics engine & library.
playrho::Filter Struct Reference

A holder for contact filtering data. More...

#include <playrho/Filter.hpp>

Public Types

using bits_type = std::uint16_t
 Bits type definition.
 
using index_type = std::int16_t
 Index type definition.
 

Public Attributes

bits_type categoryBits = DefaultCategoryBits
 The collision category bits. More...
 
index_type groupIndex = DefaultGroupIndex
 Group index. More...
 
bits_type maskBits = DefaultMaskBits
 The collision mask bits. More...
 

Static Public Attributes

static constexpr auto DefaultCategoryBits = bits_type(0x0001)
 Default category bits.
 
static constexpr auto DefaultGroupIndex = index_type{0}
 Default group index.
 
static constexpr auto DefaultMaskBits = bits_type(0xFFFF)
 Default mask bits.
 

Related Functions

(Note that these are not member functions.)

constexpr bool operator!= (const Filter lhs, const Filter rhs) noexcept
 Inequality operator.
 
constexpr bool operator== (const Filter lhs, const Filter rhs) noexcept
 Equality operator.
 
bool ShouldCollide (const Filter filterA, const Filter filterB) noexcept
 Determines whether collision processing should be performed.
 

Detailed Description

A holder for contact filtering data.

Member Data Documentation

◆ categoryBits

bits_type playrho::Filter::categoryBits = DefaultCategoryBits

The collision category bits.

Note
Normally you would just set one bit.
Examples
Shape.cpp, and WorldShape.cpp.

◆ groupIndex

index_type playrho::Filter::groupIndex = DefaultGroupIndex

Group index.

Collision groups allow a certain group of objects to never collide (negative) or always collide (positive). Zero means no collision group. Non-zero group filtering always wins against the mask bits.

Examples
Shape.cpp, and WorldShape.cpp.

◆ maskBits

bits_type playrho::Filter::maskBits = DefaultMaskBits

The collision mask bits.

This states the categories that this shape would accept for collision.

Examples
Shape.cpp, and WorldShape.cpp.

The documentation for this struct was generated from the following file: