diff options
author | Stijn Buys <ingar@osirion.org> | 2011-02-09 16:01:17 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-02-09 16:01:17 +0000 |
commit | a255dbc032d15a4f5024bc60baa19c45ebceecc6 (patch) | |
tree | ca5517aae243957b824767169674248c70f7b1d3 /src/core | |
parent | 38eb51c26ab0d9dbebc974c7a21f96a429ce3098 (diff) |
added sv_collisionmargin Cvar and applied the value to mesh collisions,
added seconds parameter to sys::get_datetime(),
added con_timestamps Cvar,
enabled console timestamps on the dedicated server by default.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/application.cc | 11 | ||||
-rw-r--r-- | src/core/cvar.cc | 3 | ||||
-rw-r--r-- | src/core/cvar.h | 3 | ||||
-rw-r--r-- | src/core/entity.cc | 9 |
4 files changed, 20 insertions, 6 deletions
diff --git a/src/core/application.cc b/src/core/application.cc index 5c7e4e7..c731833 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -133,6 +133,9 @@ void Application::init(int count, char **arguments) Cvar::sv_keepalive = Cvar::get("sv_keepalive", "120", core::Cvar::Archive); Cvar::sv_keepalive->set_info("[int] number of seconds to keep dynamic objects alive"); + + Cvar::sv_collisionmargin = Cvar::get("sv_collisionmargin", 1.0f / 64.0f, core::Cvar::Archive); + Cvar::sv_collisionmargin->set_info("[float] margin for mesh collisions"); // network settings Cvar::net_host = Cvar::get("net_host", "0.0.0.0", Cvar::Archive); @@ -164,6 +167,14 @@ void Application::init(int count, char **arguments) Cvar::con_ansi->set_info("[bool] console ANSI colors"); sys::set_ansi(Cvar::con_ansi->value()); + if (Cvar::sv_dedicated->value()) { + Cvar::con_timestamps = Cvar::get("con_timestamps", "1", Cvar::Archive); + } else { + Cvar::con_timestamps = Cvar::get("con_timestamps", "0", Cvar::Archive); + } + Cvar::con_timestamps->set_info("[bool] enable console timestamps"); + sys::set_console_timestamps(Cvar::con_timestamps->value()); + #ifdef _WIN32 // Initialize win32 socket library WSADATA wsa_data; diff --git a/src/core/cvar.cc b/src/core/cvar.cc index 66da4d4..609778a 100644 --- a/src/core/cvar.cc +++ b/src/core/cvar.cc @@ -18,6 +18,8 @@ namespace core { Cvar *Cvar::con_ansi = 0; +Cvar *Cvar::con_timestamps = 0; + Cvar *Cvar::sv_dedicated = 0; Cvar *Cvar::sv_private = 0; Cvar *Cvar::sv_framerate = 0; @@ -25,6 +27,7 @@ Cvar *Cvar::sv_name = 0; Cvar *Cvar::sv_description = 0; Cvar *Cvar::sv_password = 0; Cvar *Cvar::sv_keepalive = 0; +Cvar *Cvar::sv_collisionmargin = 0; Cvar *Cvar::net_host = 0; Cvar *Cvar::net_port = 0; diff --git a/src/core/cvar.h b/src/core/cvar.h index ffc11bf..864d751 100644 --- a/src/core/cvar.h +++ b/src/core/cvar.h @@ -156,9 +156,10 @@ public: static Cvar *sv_description; // server description static Cvar *sv_password; // server rcon password static Cvar *sv_keepalive; // entity keepalive timeout + static Cvar *sv_collisionmargin; // bullet collision margin static Cvar *con_ansi; // console ANSI colors - + static Cvar *con_timestamps;// console timestamps static Cvar *net_host; // network server ip (default binds to all interfaces) static Cvar *net_port; // network port diff --git a/src/core/entity.cc b/src/core/entity.cc index 7aa72fa..ebe4938 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -515,8 +515,7 @@ void Entity::reset() btVector3 modelscalevec(modelscale, modelscale, modelscale); meshshape->setLocalScaling(modelscalevec); - //meshshape->setMargin(0.0f); - //meshshape->updateBound(); + meshshape->setMargin(Cvar::sv_collisionmargin->value()); entity_collision_shape = meshshape; // con_debug << " " << label() << " attached collision mesh: " << model()->collisionmesh()->size() << " triangles" << std::endl; @@ -609,7 +608,7 @@ void EntityDynamic::reset() btVector3 modelscalevec(modelscale, modelscale, modelscale); meshshape->setLocalScaling(modelscalevec); - //meshshape->setMargin(0.0f); + meshshape->setMargin(Cvar::sv_collisionmargin->value()); meshshape->updateBound(); entity_collision_shape = meshshape; @@ -1027,10 +1026,10 @@ void EntityControlable::reset() btVector3 modelscalevec(modelscale, modelscale, modelscale); meshshape->setLocalScaling(modelscalevec); - //meshshape->setMargin(0.0f); + meshshape->setMargin(Cvar::sv_collisionmargin->value()); meshshape->updateBound(); - entity_collision_shape = meshshape; + entity_collision_shape = meshshape; } else { // use bounding box entity_collision_shape = new btBoxShape(to_btVector3(model()->box().max() * modelscale)); |