Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | Public Attributes | List of all members
box2d::World::Def Struct Reference

World construction definitions. More...

#include <World.hpp>

Public Member Functions

constexpr DefUseGravity (LinearAcceleration2D value) noexcept
 
constexpr DefUseMinVertexRadius (Length value) noexcept
 
constexpr DefUseMaxVertexRadius (Length value) noexcept
 

Public Attributes

LinearAcceleration2D gravity = EarthlyGravity
 Gravity. More...
 
Length minVertexRadius = DefaultLinearSlop * RealNum{2}
 Minimum vertex radius. More...
 
Length maxVertexRadius = RealNum{255} * Meter
 Maximum vertex radius. More...
 

Detailed Description

World construction definitions.

Member Function Documentation

◆ UseGravity()

constexpr World::Def & box2d::World::Def::UseGravity ( LinearAcceleration2D  value)
inlinenoexcept

◆ UseMaxVertexRadius()

constexpr World::Def & box2d::World::Def::UseMaxVertexRadius ( Length  value)
inlinenoexcept

◆ UseMinVertexRadius()

constexpr World::Def & box2d::World::Def::UseMinVertexRadius ( Length  value)
inlinenoexcept

Member Data Documentation

◆ gravity

LinearAcceleration2D box2d::World::Def::gravity = EarthlyGravity

Gravity.

The acceleration all dynamic bodies are subject to.

Note
Use Vec2{0, 0} to disable gravity.

◆ maxVertexRadius

Length box2d::World::Def::maxVertexRadius = RealNum{255} * Meter

Maximum vertex radius.

This is the maximum vertex radius that this world establishes which bodies shall allow fixtures to be created with. Trying to create a fixture with a shape having a larger vertex radius shall be rejected with a nullptr returned value.

◆ minVertexRadius

Length box2d::World::Def::minVertexRadius = DefaultLinearSlop * RealNum{2}

Minimum vertex radius.

This is the minimum vertex radius that this world establishes which bodies shall allow fixtures to be created with. Trying to create a fixture with a shape having a smaller vertex radius shall be rejected with a nullptr returned value.

Note
This value probably should not be changed except to experiment with what can happen.
Making it smaller means some shapes could have insufficient buffer for continuous collision.
Making it larger may create artifacts for vertex collision.

The documentation for this struct was generated from the following file: