3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Shape; owned by the world. 更多...
#include <Shape3D.h>
Public 类型 | |
| enum class | Kind { Box , Sphere , Capsule } |
| Shape geometry kind. 更多... | |
Public 成员函数 | |
| Shape3D (World3D *world, Body3D *body, b3ShapeId shapeId, Kind kind, float a, float b, float c) | |
| Internal: wraps a Box3D shape (use Body3D::new*Shape). | |
| ~Shape3D () | |
| Shape3D (const Shape3D &)=delete | |
| Shape3D & | operator= (const Shape3D &)=delete |
| void | setSensor (bool sensor) |
| Sensor shapes 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 |
| Body3D * | getBody () |
| Owning body. | |
| bool | testPoint (float x, float y, float z) const |
| Point-in-shape test in world meters. | |
| void | destroy () |
| Destroys the shape inside its world. | |
| b3ShapeId | raw () const |
| Raw Box3D shape id / liveness. | |
| bool | isValid () const |
| void | invalidate () |
| Internal: marks the wrapper invalid after destruction. | |
友元 | |
| class | World3D |
| class | Body3D |
详细描述
3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Shape; owned by the world.
成员枚举类型说明
◆ Kind
|
strong |
构造及析构函数说明
◆ Shape3D() [1/2]
| eve::physics::Shape3D::Shape3D | ( | World3D * | world, |
| Body3D * | body, | ||
| b3ShapeId | shapeId, | ||
| Kind | kind, | ||
| float | a, | ||
| float | b, | ||
| float | c | ||
| ) |
Internal: wraps a Box3D shape (use Body3D::new*Shape).
在文件 Shape3D.cpp 第 25 行定义.
◆ ~Shape3D()
| eve::physics::Shape3D::~Shape3D | ( | ) |
在文件 Shape3D.cpp 第 29 行定义.
引用了 eve::physics::World3D::forgetShape(), eve::physics::Body3D::isValid() , 以及 isValid().
◆ Shape3D() [2/2]
|
delete |
成员函数说明
◆ destroy()
| void eve::physics::Shape3D::destroy | ( | ) |
Destroys the shape inside its world.
在文件 Shape3D.cpp 第 49 行定义.
引用了 eve::physics::World3D::forgetShape(), invalidate(), eve::physics::Body3D::isValid() , 以及 isValid().
◆ getBody()
◆ getDensity()
| float eve::physics::Shape3D::getDensity | ( | ) | const |
在文件 Shape3D.cpp 第 131 行定义.
引用了 isValid().
◆ getFriction()
| float eve::physics::Shape3D::getFriction | ( | ) | const |
在文件 Shape3D.cpp 第 115 行定义.
引用了 isValid().
◆ getRestitution()
| float eve::physics::Shape3D::getRestitution | ( | ) | const |
在文件 Shape3D.cpp 第 122 行定义.
引用了 isValid().
◆ invalidate()
| void eve::physics::Shape3D::invalidate | ( | ) |
Internal: marks the wrapper invalid after destruction.
在文件 Shape3D.cpp 第 42 行定义.
引用了 isValid().
被这些函数引用 destroy().
◆ isSensor()
| bool eve::physics::Shape3D::isSensor | ( | ) | const |
在文件 Shape3D.cpp 第 108 行定义.
引用了 isValid().
◆ isValid()
| bool eve::physics::Shape3D::isValid | ( | ) | const |
在文件 Shape3D.cpp 第 40 行定义.
被这些函数引用 destroy(), getDensity(), getFriction(), getRestitution(), invalidate(), isSensor(), setDensity(), setFriction(), setRestitution(), setSensor(), testPoint() , 以及 ~Shape3D().
◆ operator=()
◆ raw()
|
inline |
◆ setDensity()
| void eve::physics::Shape3D::setDensity | ( | float | density | ) |
在文件 Shape3D.cpp 第 126 行定义.
引用了 isValid().
◆ setFriction()
| void eve::physics::Shape3D::setFriction | ( | float | friction | ) |
◆ setRestitution()
| void eve::physics::Shape3D::setRestitution | ( | float | restitution | ) |
在文件 Shape3D.cpp 第 117 行定义.
引用了 isValid().
◆ setSensor()
| void eve::physics::Shape3D::setSensor | ( | bool | sensor | ) |
Sensor shapes report contacts but never collide.
在文件 Shape3D.cpp 第 102 行定义.
引用了 eve::physics::Body3D::isValid() , 以及 isValid().
◆ testPoint()
| bool eve::physics::Shape3D::testPoint | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Point-in-shape test in world meters.
在文件 Shape3D.cpp 第 133 行定义.
引用了 Box, Capsule, eve::physics::Body3D::isValid(), isValid(), eve::physics::Body3D::raw(), Sphere, x, y , 以及 z.
友元及相关函数文档
◆ Body3D
◆ World3D
该类的文档由以下文件生成:
- src/modules/physics/Shape3D.h
- src/modules/physics/Shape3D.cpp