Physics World description class. More...
#include <physics_world_description.h>
Public Member Functions | |
Construction | |
PhysicsWorldDescription () | |
Constructs a world description with default values. More... | |
PhysicsWorldDescription (const PhysicsWorldDescription ©) | |
Constructs a PhysicsWorldDescription. More... | |
virtual | ~PhysicsWorldDescription () |
Attributes | |
bool | is_sleep_enabled () const |
Returns if bodies are allowed to sleep when they come to rest. More... | |
bool | is_olm_enabled () const |
Returns true if the Physics world has the object lifetime management enabled. More... | |
Vec2f | get_gravity () const |
Returns the world gravity. More... | |
float | get_timestep () const |
Returns the tick timestep. More... | |
int | get_velocity_iterations () const |
Returns the amount of velocity iterations on every world tick. More... | |
int | get_position_iterations () const |
Returns the amount of position iterations on every world tick. More... | |
int | get_physic_scale () const |
Return the amount of pixels for 1 meter in the Physics World. More... | |
std::shared_ptr < PhysicsWorldDescriptionData > | get_data (const std::string &data_name) const |
Returns the object stored in the given data name. More... | |
Operations | |
PhysicsWorldDescription & | operator= (const PhysicsWorldDescription ©) |
Copy assignment operator. More... | |
void | set_sleep (bool value=true) |
toggles whether the bodies are able to sleep when they come to rest. More... | |
void | set_gravity (double xAcceleration, double yAcceleration) |
sets the world gravity More... | |
void | set_timestep (float timestep) |
sets the tick timestep. More... | |
void | set_velocity_iterations (int iterations) |
sets the amount of velocity iterations on every world tick. More... | |
void | set_position_iterations (int iterations) |
sets the amount of position iterations on every world tick. More... | |
void | set_physic_scale (int pixels) |
Change the amount of pixels for 1 meter in the Physics World. Simulation works best for objects that are larger than 0.1 meter but smaller than 10 meters. More... | |
void | set_olm (const bool value=true) |
Sets the object lifetime management. If enabled the physics objects are going to be removed from the Physics Context after the last API object pointing to them cease to exist. More... | |
void | set_data (const std::string &data_name, const std::shared_ptr< PhysicsWorldDescriptionData > &ptr) |
Store object in description. More... | |
Friends | |
class | PhysicsWorld_Impl |
Physics World description class.
This class allows you to setup a more advanced description when creating a Physics World.