Box2D
3.0.0
A Real-Time-Oriented 2-D Physics Engine
|
#include <Shape.hpp>
Classes | |
struct | Conf |
struct | Visitor |
Visitor interface. More... | |
Public Member Functions | |
Shape ()=delete | |
Default constructor is deleted. More... | |
Shape (const Conf &conf) noexcept | |
Initializing constructor. More... | |
Shape (const Shape &)=default | |
virtual | ~Shape ()=default |
virtual child_count_t | GetChildCount () const noexcept=0 |
Gets the number of child primitives of the shape. More... | |
virtual DistanceProxy | GetChild (child_count_t index) const noexcept=0 |
Gets the child for the given index. More... | |
virtual bool | TestPoint (const Transformation &xf, const Length2D p) const noexcept=0 |
Tests a point for containment in this shape. More... | |
virtual RayCastOutput | RayCast (const RayCastInput &input, const Transformation &xf, child_count_t childIndex) const noexcept=0 |
virtual MassData | GetMassData () const noexcept=0 |
Gets the mass properties of this shape using its dimensions and density. More... | |
virtual void | Accept (Visitor &visitor) const =0 |
Accepts a visitor. More... | |
Length | GetVertexRadius () const noexcept |
Gets the vertex radius. More... | |
void | SetVertexRadius (Length vertexRadius) |
Density | GetDensity () const noexcept |
Gets the density of this fixture. More... | |
void | SetDensity (Density density) noexcept |
Sets the density of this fixture. More... | |
RealNum | GetFriction () const noexcept |
Gets the coefficient of friction. More... | |
void | SetFriction (RealNum friction) noexcept |
Sets the coefficient of friction. This will not change the friction of existing contacts. More... | |
RealNum | GetRestitution () const noexcept |
Gets the coefficient of restitution. More... | |
void | SetRestitution (RealNum restitution) noexcept |
Sets the coefficient of restitution. This will not change the restitution of existing contacts. More... | |
Shape is an abstract base class for shapes. A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in World are created automatically when a Fixture is created. Shapes may encapsulate one or more child shapes.
|
delete |
Default constructor is deleted.
This is a base class that shouldn't ever be directly instantiated.
|
inlinenoexcept |
Initializing constructor.
|
default |
|
virtualdefault |
|
pure virtual |
Accepts a visitor.
Implemented in box2d::PolygonShape, box2d::ChainShape, box2d::CircleShape, and box2d::EdgeShape.
|
pure virtualnoexcept |
Gets the child for the given index.
Implemented in box2d::PolygonShape, box2d::ChainShape, box2d::CircleShape, and box2d::EdgeShape.
|
pure virtualnoexcept |
Gets the number of child primitives of the shape.
Implemented in box2d::PolygonShape, box2d::ChainShape, box2d::CircleShape, and box2d::EdgeShape.
|
inlinenoexcept |
Gets the density of this fixture.
|
inlinenoexcept |
Gets the coefficient of friction.
|
pure virtualnoexcept |
Gets the mass properties of this shape using its dimensions and density.
Implemented in box2d::PolygonShape, box2d::ChainShape, box2d::CircleShape, and box2d::EdgeShape.
|
inlinenoexcept |
Gets the coefficient of restitution.
|
inlinenoexcept |
Gets the vertex radius.
|
pure virtualnoexcept |
Implemented in box2d::PolygonShape, box2d::ChainShape, box2d::CircleShape, and box2d::EdgeShape.
|
inlinenoexcept |
Sets the density of this fixture.
density | Non-negative density in kg/m^2. |
|
inlinenoexcept |
Sets the coefficient of friction. This will not change the friction of existing contacts.
|
inlinenoexcept |
Sets the coefficient of restitution. This will not change the restitution of existing contacts.
|
inline |
|
pure virtualnoexcept |
Tests a point for containment in this shape.
xf | the shape world transform. |
p | a point in world coordinates. |
true
if point is contained in this shape, false
otherwise. Implemented in box2d::PolygonShape, box2d::ChainShape, box2d::CircleShape, and box2d::EdgeShape.