2D fixture: a shape attached to a Body with material + filter settings. Also carries a string tag used by contact events. 更多...
#include <Fixture.h>
Public 成员函数 | |
| Fixture (World *world, Body *body, b2Fixture *fixture) | |
| Internal: wraps a Box2D fixture (use Body::new*Fixture). | |
| ~Fixture () | |
| Fixture (const Fixture &)=delete | |
| Fixture & | operator= (const Fixture &)=delete |
| void | setSensor (bool sensor) |
| Sensor fixtures report contacts but never collide. | |
| bool | isSensor () const |
| void | setFriction (float friction) |
| Material properties. | |
| float | getFriction () const |
| void | setRestitution (float restitution) |
| float | getRestitution () const |
| void | setDensity (float density) |
| float | getDensity () const |
| void | setTag (const std::string &tag) |
| Arbitrary string tag surfaced in begin/end contact events. | |
| const std::string & | getTag () const |
| void | setCategoryBits (int bits) |
| Collision filtering (Box2D category/mask bits, group index). | |
| int | getCategoryBits () const |
| void | setMaskBits (int bits) |
| int | getMaskBits () const |
| void | setGroupIndex (int index) |
| int | getGroupIndex () const |
| int | getBodyId () const |
| Id of the owning body. | |
| Body * | getBody () |
| Owning body. | |
| bool | testPoint (float x, float y) const |
| Pixel-space point-in-fixture test (uses World meter). | |
| void | destroy () |
| Destroys the fixture inside its world. | |
| b2Fixture * | raw () |
| Raw Box2D fixture. | |
| const b2Fixture * | raw () const |
| void | invalidate () |
| Internal: marks the wrapper invalid after destruction. | |
友元 | |
| class | World |
| class | Body |
详细描述
2D fixture: a shape attached to a Body with material + filter settings. Also carries a string tag used by contact events.
构造及析构函数说明
◆ Fixture() [1/2]
Internal: wraps a Box2D fixture (use Body::new*Fixture).
在文件 Fixture.cpp 第 9 行定义.
◆ ~Fixture()
| eve::physics::Fixture::~Fixture | ( | ) |
在文件 Fixture.cpp 第 12 行定义.
引用了 eve::physics::World::forgetFixture() , 以及 eve::physics::Body::raw().
◆ Fixture() [2/2]
|
delete |
成员函数说明
◆ destroy()
| void eve::physics::Fixture::destroy | ( | ) |
Destroys the fixture inside its world.
在文件 Fixture.cpp 第 30 行定义.
引用了 eve::physics::World::forgetFixture(), invalidate() , 以及 eve::physics::Body::raw().
◆ getBody()
◆ getBodyId()
| int eve::physics::Fixture::getBodyId | ( | ) | const |
Id of the owning body.
在文件 Fixture.cpp 第 103 行定义.
引用了 eve::physics::Body::getId().
被这些函数引用 eve::physics::World::forgetFixture().
◆ getCategoryBits()
| int eve::physics::Fixture::getCategoryBits | ( | ) | const |
在文件 Fixture.cpp 第 79 行定义.
◆ getDensity()
| float eve::physics::Fixture::getDensity | ( | ) | const |
在文件 Fixture.cpp 第 70 行定义.
◆ getFriction()
| float eve::physics::Fixture::getFriction | ( | ) | const |
在文件 Fixture.cpp 第 55 行定义.
◆ getGroupIndex()
| int eve::physics::Fixture::getGroupIndex | ( | ) | const |
在文件 Fixture.cpp 第 99 行定义.
◆ getMaskBits()
| int eve::physics::Fixture::getMaskBits | ( | ) | const |
在文件 Fixture.cpp 第 90 行定义.
◆ getRestitution()
| float eve::physics::Fixture::getRestitution | ( | ) | const |
在文件 Fixture.cpp 第 62 行定义.
◆ getTag()
|
inline |
被这些函数引用 eve::physics::World::forgetFixture().
◆ invalidate()
| void eve::physics::Fixture::invalidate | ( | ) |
◆ isSensor()
| bool eve::physics::Fixture::isSensor | ( | ) | const |
在文件 Fixture.cpp 第 48 行定义.
◆ operator=()
◆ raw() [1/2]
|
inline |
◆ raw() [2/2]
◆ setCategoryBits()
| void eve::physics::Fixture::setCategoryBits | ( | int | bits | ) |
◆ setDensity()
| void eve::physics::Fixture::setDensity | ( | float | density | ) |
在文件 Fixture.cpp 第 64 行定义.
◆ setFriction()
| void eve::physics::Fixture::setFriction | ( | float | friction | ) |
Material properties.
在文件 Fixture.cpp 第 50 行定义.
◆ setGroupIndex()
| void eve::physics::Fixture::setGroupIndex | ( | int | index | ) |
在文件 Fixture.cpp 第 92 行定义.
引用了 filter.
◆ setMaskBits()
| void eve::physics::Fixture::setMaskBits | ( | int | bits | ) |
在文件 Fixture.cpp 第 83 行定义.
引用了 filter.
◆ setRestitution()
| void eve::physics::Fixture::setRestitution | ( | float | restitution | ) |
在文件 Fixture.cpp 第 57 行定义.
◆ setSensor()
| void eve::physics::Fixture::setSensor | ( | bool | sensor | ) |
Sensor fixtures report contacts but never collide.
在文件 Fixture.cpp 第 43 行定义.
◆ setTag()
|
inline |
◆ testPoint()
| bool eve::physics::Fixture::testPoint | ( | float | x, |
| float | y | ||
| ) | const |
Pixel-space point-in-fixture test (uses World meter).
在文件 Fixture.cpp 第 105 行定义.
引用了 eve::physics::World::toMeters(), x , 以及 y.
友元及相关函数文档
◆ Body
◆ World
该类的文档由以下文件生成:
- src/modules/physics/Fixture.h
- src/modules/physics/Fixture.cpp