Hymn to Beauty
C++ 3D Engine
Physics::Shape Class Reference

#include <Shape.hpp>

Classes

struct  Box
 Parameters used to create a box shape. More...
 
struct  Capsule
 Parameters used to create a capsule shape. More...
 
struct  Cone
 Parameters used to create a cone shape. More...
 
struct  Cylinder
 Parameters used to create a cylinder shape. More...
 
struct  Plane
 Parameters used to create a plane shape. More...
 
struct  Sphere
 Parameters used to create a sphere shape. More...
 

Public Types

enum class  Kind {
  Sphere , Plane , Box , Cylinder ,
  Cone , Capsule
}
 The various kinds of shapes that are wrapped by Shape. More...
 

Public Member Functions

 Shape (const Sphere &params)
 Construct a sphere shape. More...
 
 Shape (const Plane &params)
 Construct a plane shape. More...
 
 Shape (const Box &params)
 Construct a box shape. More...
 
 Shape (const Cylinder &params)
 Construct a cylinder shape. More...
 
 Shape (const Cone &params)
 Construct a cone shape. More...
 
 Shape (const Capsule &params)
 Construct a capsule shape. More...
 
 ~Shape ()
 Destructor. More...
 
Kind GetKind () const
 Get the type of wrapped shape. More...
 
const SphereGetSphereData () const
 Get sphere data of the shape. More...
 
const PlaneGetPlaneData () const
 Get plane data of the shape. More...
 
const BoxGetBoxData () const
 Get box data of the shape. More...
 
const CylinderGetCylinderData () const
 Get cylinder data of the shape. More...
 
const ConeGetConeData () const
 Get cone data of the shape. More...
 
const CapsuleGetCapsuleData () const
 Get capsule data of the shape. More...
 

Friends

class ::PhysicsManager
 
class ::Component::RigidBody
 
class Trigger
 

Detailed Description

Represents a shape for physics objects and facilitates creation of underlying types.

Member Enumeration Documentation

◆ Kind

enum class Physics::Shape::Kind
strong

The various kinds of shapes that are wrapped by Shape.

Enumerator
Sphere 
Plane 
Box 
Cylinder 
Cone 
Capsule 

Constructor & Destructor Documentation

◆ Shape() [1/6]

Physics::Shape::Shape ( const Sphere params)
explicit

Construct a sphere shape.

Parameters
paramsSphere specific parameters.

◆ Shape() [2/6]

Physics::Shape::Shape ( const Plane params)
explicit

Construct a plane shape.

Parameters
paramsPlane specific parameters.

◆ Shape() [3/6]

Physics::Shape::Shape ( const Box params)
explicit

Construct a box shape.

Parameters
paramsBox specific parameters.

◆ Shape() [4/6]

Physics::Shape::Shape ( const Cylinder params)
explicit

Construct a cylinder shape.

Parameters
paramsCylinder specific parameters.

◆ Shape() [5/6]

Physics::Shape::Shape ( const Cone params)
explicit

Construct a cone shape.

Parameters
paramsCone specific parameters.

◆ Shape() [6/6]

Physics::Shape::Shape ( const Capsule params)
explicit

Construct a capsule shape.

Parameters
paramsCapsule specific parameters.

◆ ~Shape()

Physics::Shape::~Shape ( )

Destructor.

Member Function Documentation

◆ GetBoxData()

const Shape::Box * Physics::Shape::GetBoxData ( ) const

Get box data of the shape.

Returns
Box data, or nullptr if the shape is not a box.

◆ GetCapsuleData()

const Shape::Capsule * Physics::Shape::GetCapsuleData ( ) const

Get capsule data of the shape.

Returns
Capsule data, or nullptr if the shape is not a capsule.

◆ GetConeData()

const Shape::Cone * Physics::Shape::GetConeData ( ) const

Get cone data of the shape.

Returns
Cone data, or nullptr if the shape is not a cone.

◆ GetCylinderData()

const Shape::Cylinder * Physics::Shape::GetCylinderData ( ) const

Get cylinder data of the shape.

Returns
Cylinder data, or nullptr if the shape is not a cylinder.

◆ GetKind()

Shape::Kind Physics::Shape::GetKind ( ) const

Get the type of wrapped shape.

Returns
The type of shape.

◆ GetPlaneData()

const Shape::Plane * Physics::Shape::GetPlaneData ( ) const

Get plane data of the shape.

Returns
Plane data, or nullptr if the shape is not a plane.

◆ GetSphereData()

const Shape::Sphere * Physics::Shape::GetSphereData ( ) const

Get sphere data of the shape.

Returns
Sphere data, or nullptr if the shape is not a sphere.

Friends And Related Function Documentation

◆ ::Component::RigidBody

friend class ::Component::RigidBody
friend

◆ ::PhysicsManager

friend class ::PhysicsManager
friend

◆ Trigger

friend class Trigger
friend

Member Data Documentation

◆ box

Box Physics::Shape::box

◆ capsule

Capsule Physics::Shape::capsule

◆ cone

Cone Physics::Shape::cone

◆ cylinder

Cylinder Physics::Shape::cylinder

◆ plane

Plane Physics::Shape::plane

◆ sphere

Sphere Physics::Shape::sphere

The documentation for this class was generated from the following files: