Magnum::Shapes namespace

Shape library.

Contents

Collision detection system.

This library is built if WITH_SHAPES is enabled when building Magnum. To use this library with CMake, you need to request the Shapes component of the Magnum package and link to the Magnum::Shapes target:

find_package(Magnum REQUIRED Shapes)

# ...
target_link_libraries(your-app Magnum::Shapes)

See Downloading and building, Usage with CMake and Collision detection for more information.

Classes

template<UnsignedInt dimensions>
class AbstractShape deprecated
Base class for object shapes.
template<UnsignedInt dimensions>
class AxisAlignedBox deprecated
Axis-aligned box.
template<UnsignedInt dimensions>
class Box deprecated
Unit-size box with assigned transformation matrix.
template<UnsignedInt dimensions>
class Capsule deprecated
Capsule defined by cylinder start and end point and radius.
template<UnsignedInt dimensions>
class Collision deprecated
Collision data.
template<UnsignedInt dimensions>
class Composition deprecated
Composition of shapes.
template<UnsignedInt dimensions>
class Cylinder deprecated
Infinite cylinder defined by line and radius.
template<UnsignedInt dimensions>
class InvertedSphere deprecated
Inverted sphere defined by position and radius.
template<UnsignedInt dimensions>
class Line deprecated
Infinite line, defined by two points.
template<UnsignedInt dimensions>
class LineSegment deprecated
Line segment, defined by starting and ending point.
class Plane deprecated
Infinite plane, defined by position and normal (3D only)
template<UnsignedInt dimensions>
class Point deprecated
Point.
template<class T>
class Shape deprecated
Object shape.
template<UnsignedInt dimensions>
class ShapeGroup deprecated
Group of shapes.
template<UnsignedInt dimensions>
class Sphere deprecated
Sphere defined by position and radius.

Enums

enum class CompositionOperation: UnsignedByte { Not, And, Or } deprecated
Shape operation.

Typedefs

using AbstractShape2D = AbstractShape<2> deprecated
Base class for two-dimensional object shapes.
using AbstractShape3D = AbstractShape<3> deprecated
Base class for three-dimensional object shapes.
using AxisAlignedBox2D = AxisAlignedBox<2> deprecated
Two-dimensional axis-aligned box.
using AxisAlignedBox3D = AxisAlignedBox<3> deprecated
Three-dimensional axis-aligned box.
using Box2D = Box<2> deprecated
Two-dimensional box.
using Box3D = Box<3> deprecated
Three-dimensional box.
using Capsule2D = Capsule<2> deprecated
Two-dimensional capsule.
using Capsule3D = Capsule<3> deprecated
Three-dimensional capsule.
using Collision2D = Collision<2> deprecated
Two-dimensional collision data.
using Collision3D = Collision<3> deprecated
Three-dimensional collision data.
using Composition2D = Composition<2> deprecated
Two-dimensional shape composition.
using Composition3D = Composition<3> deprecated
Three-dimensional shape composition.
using Cylinder2D = Cylinder<2> deprecated
Infinite two-dimensional cylinder.
using Cylinder3D = Cylinder<3> deprecated
Infinite three-dimensional cylinder.
using Line2D = Line<2> deprecated
Infinite two-dimensional line.
using Line3D = Line<3> deprecated
Infinite three-dimensional line.
using LineSegment2D = LineSegment<2> deprecated
Two-dimensional line segment.
using LineSegment3D = LineSegment<3> deprecated
Three-dimensional line segment.
using Point2D = Point<2> deprecated
Two-dimensional point.
using Point3D = Point<3> deprecated
Three-dimensional point.
using ShapeGroup2D = ShapeGroup<2> deprecated
Group of two-dimensional shapes.
using ShapeGroup3D = ShapeGroup<3> deprecated
Group of three-dimensional shapes.
using Sphere2D = Sphere<2> deprecated
Two-dimensional sphere.
using Sphere3D = Sphere<3> deprecated
Three-dimensional sphere.
using InvertedSphere2D = InvertedSphere<2> deprecated
Inverted two-dimensional sphere.
using InvertedSphere3D = InvertedSphere<3> deprecated
Inverted three-dimensional sphere.

Functions

template<UnsignedInt dimensions>
auto operator%(const Point<dimensions>& a, const AxisAlignedBox<dimensions>& b) -> bool deprecated
Collision occurence of Point and AxisAlignedBox.
template<UnsignedInt dimensions>
auto operator%(const Point<dimensions>& a, const Capsule<dimensions>& b) -> bool deprecated
Collision occurence of Point and Capsule.
template<UnsignedInt dimensions>
auto operator%(const Sphere<dimensions>& a, const Capsule<dimensions>& b) -> bool deprecated
Collision occurence of Sphere and Capsule.
template<UnsignedInt dimensions>
auto operator<<(Debug& debug, typename Composition<dimensions>::Type value) -> Debug& deprecated
Debug output operator.
template<UnsignedInt dimensions>
auto operator%(const Point<dimensions>& a, const Cylinder<dimensions>& b) -> bool deprecated
Collision occurence of Point and Cylinder.
template<UnsignedInt dimensions>
auto operator%(const Sphere<dimensions>& a, const Cylinder<dimensions>& b) -> bool deprecated
Collision occurence of Sphere and Cylinder.
auto operator%(const Line3D& a, const Plane& b) -> bool deprecated
Collision occurence of Line and Plane.
auto operator%(const LineSegment3D& a, const Plane& b) -> bool deprecated
Collision occurence of LineSegment and Plane.
template<UnsignedInt dimensions>
auto operator%(const Point<dimensions>& a, const Sphere<dimensions>& b) -> bool deprecated
Collision occurence of Point and Sphere.
template<UnsignedInt dimensions>
auto operator%(const Point<dimensions>& a, const InvertedSphere<dimensions>& b) -> bool deprecated
Collision occurence of Point and InvertedSphere.
template<UnsignedInt dimensions>
auto operator/(const Point<dimensions>& a, const Sphere<dimensions>& b) -> Collision<dimensions> deprecated
Collision of Point and Sphere.
template<UnsignedInt dimensions>
auto operator/(const Point<dimensions>& a, const InvertedSphere<dimensions>& b) -> Collision<dimensions> deprecated
Collision of Point and InvertedSphere.
template<UnsignedInt dimensions>
auto operator%(const Line<dimensions>& a, const Sphere<dimensions>& b) -> bool deprecated
Collision occurence of Line and Sphere.
template<UnsignedInt dimensions>
auto operator%(const LineSegment<dimensions>& a, const Sphere<dimensions>& b) -> bool deprecated
Collision occurence of LineSegment and Sphere.
template<UnsignedInt dimensions>
auto operator%(const Sphere<dimensions>& a, const InvertedSphere<dimensions>& b) -> bool deprecated
Collision occurence of Sphere and InvertedSphere.
template<UnsignedInt dimensions>
auto operator/(const Sphere<dimensions>& a, const InvertedSphere<dimensions>& b) -> Collision<dimensions> deprecated
Collision of Sphere and InvertedSphere.

Enum documentation

enum class Magnum::Shapes::CompositionOperation: UnsignedByte

Shape operation.

Enumerators
Not

Boolean NOT

And

Boolean AND

Or

Boolean OR

Typedef documentation

typedef AbstractShape<2> Magnum::Shapes::AbstractShape2D

Base class for two-dimensional object shapes.

typedef AbstractShape<3> Magnum::Shapes::AbstractShape3D

Base class for three-dimensional object shapes.

typedef AxisAlignedBox<2> Magnum::Shapes::AxisAlignedBox2D

Two-dimensional axis-aligned box.

typedef AxisAlignedBox<3> Magnum::Shapes::AxisAlignedBox3D

Three-dimensional axis-aligned box.

typedef Box<2> Magnum::Shapes::Box2D

Two-dimensional box.

typedef Box<3> Magnum::Shapes::Box3D

Three-dimensional box.

typedef Capsule<2> Magnum::Shapes::Capsule2D

Two-dimensional capsule.

typedef Capsule<3> Magnum::Shapes::Capsule3D

Three-dimensional capsule.

typedef Collision<2> Magnum::Shapes::Collision2D

Two-dimensional collision data.

typedef Collision<3> Magnum::Shapes::Collision3D

Three-dimensional collision data.

typedef Composition<2> Magnum::Shapes::Composition2D

Two-dimensional shape composition.

typedef Composition<3> Magnum::Shapes::Composition3D

Three-dimensional shape composition.

typedef Cylinder<2> Magnum::Shapes::Cylinder2D

Infinite two-dimensional cylinder.

typedef Cylinder<3> Magnum::Shapes::Cylinder3D

Infinite three-dimensional cylinder.

typedef Line<2> Magnum::Shapes::Line2D

Infinite two-dimensional line.

typedef Line<3> Magnum::Shapes::Line3D

Infinite three-dimensional line.

typedef LineSegment<2> Magnum::Shapes::LineSegment2D

Two-dimensional line segment.

typedef LineSegment<3> Magnum::Shapes::LineSegment3D

Three-dimensional line segment.

typedef Point<2> Magnum::Shapes::Point2D

Two-dimensional point.

typedef Point<3> Magnum::Shapes::Point3D

Three-dimensional point.

typedef ShapeGroup<2> Magnum::Shapes::ShapeGroup2D

Group of two-dimensional shapes.

See Shape for more information.

typedef ShapeGroup<3> Magnum::Shapes::ShapeGroup3D

Group of three-dimensional shapes.

See Shape for more information.

typedef Sphere<2> Magnum::Shapes::Sphere2D

Two-dimensional sphere.

typedef Sphere<3> Magnum::Shapes::Sphere3D

Three-dimensional sphere.

typedef InvertedSphere<2> Magnum::Shapes::InvertedSphere2D

Inverted two-dimensional sphere.

typedef InvertedSphere<3> Magnum::Shapes::InvertedSphere3D

Inverted three-dimensional sphere.

Function documentation

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Point<dimensions>& a, const AxisAlignedBox<dimensions>& b)

Collision occurence of Point and AxisAlignedBox.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Point<dimensions>& a, const Capsule<dimensions>& b)

Collision occurence of Point and Capsule.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Sphere<dimensions>& a, const Capsule<dimensions>& b)

Collision occurence of Sphere and Capsule.

template<UnsignedInt dimensions>
Debug& Magnum::Shapes::operator<<(Debug& debug, typename Composition<dimensions>::Type value)

Debug output operator.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Point<dimensions>& a, const Cylinder<dimensions>& b)

Collision occurence of Point and Cylinder.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Sphere<dimensions>& a, const Cylinder<dimensions>& b)

Collision occurence of Sphere and Cylinder.

bool Magnum::Shapes::operator%(const Line3D& a, const Plane& b)

Collision occurence of Line and Plane.

bool Magnum::Shapes::operator%(const LineSegment3D& a, const Plane& b)

Collision occurence of LineSegment and Plane.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Point<dimensions>& a, const Sphere<dimensions>& b)

Collision occurence of Point and Sphere.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Point<dimensions>& a, const InvertedSphere<dimensions>& b)

Collision occurence of Point and InvertedSphere.

template<UnsignedInt dimensions>
Collision<dimensions> Magnum::Shapes::operator/(const Point<dimensions>& a, const Sphere<dimensions>& b)

Collision of Point and Sphere.

template<UnsignedInt dimensions>
Collision<dimensions> Magnum::Shapes::operator/(const Point<dimensions>& a, const InvertedSphere<dimensions>& b)

Collision of Point and InvertedSphere.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Line<dimensions>& a, const Sphere<dimensions>& b)

Collision occurence of Line and Sphere.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const LineSegment<dimensions>& a, const Sphere<dimensions>& b)

Collision occurence of LineSegment and Sphere.

template<UnsignedInt dimensions>
bool Magnum::Shapes::operator%(const Sphere<dimensions>& a, const InvertedSphere<dimensions>& b)

Collision occurence of Sphere and InvertedSphere.

template<UnsignedInt dimensions>
Collision<dimensions> Magnum::Shapes::operator/(const Sphere<dimensions>& a, const InvertedSphere<dimensions>& b)

Collision of Sphere and InvertedSphere.