Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/game.cc8
-rw-r--r--src/game/game.h2
-rw-r--r--src/game/ship.cc27
3 files changed, 5 insertions, 32 deletions
diff --git a/src/game/game.cc b/src/game/game.cc
index 83daa93..2f5490f 100644
--- a/src/game/game.cc
+++ b/src/game/game.cc
@@ -190,7 +190,7 @@ Game *Game::game_instance = 0;
Game::Game() : core::Module("Project::OSiRiON")
{
game_instance = this;
- g_autolevel = 0;
+ g_impulsespeed = 0;
}
Game::~Game()
@@ -231,8 +231,8 @@ void Game::init()
func = core::Func::add("list_ship", (core::FuncPtr) func_list_ship);
func->set_info("list ship statistics");
- g_autolevel = core::Cvar::get("g_autolevel", "1", core::Cvar::Game | core::Cvar::Archive);
- g_autolevel->set_info("[bool] enable or disale experimental autolevelling");
+ g_impulsespeed = core::Cvar::get("g_impulsespeed", "15", core::Cvar::Game | core::Cvar::Archive);
+ g_impulsespeed->set_info("[float] speed of the impulse drive");
// indicate the module is ready to run frames
module_running = true;
@@ -240,7 +240,7 @@ void Game::init()
void Game::shutdown()
{
- g_autolevel = 0;
+ g_impulsespeed = 0;
// game functions are automaticly removed
// remove engine core functions
diff --git a/src/game/game.h b/src/game/game.h
index 3d8e3b9..eed0b29 100644
--- a/src/game/game.h
+++ b/src/game/game.h
@@ -50,7 +50,7 @@ public:
static inline Game *instance() { return game_instance; }
- core::Cvar *g_autolevel;
+ core::Cvar *g_impulsespeed;
private:
bool load_world();
diff --git a/src/game/ship.cc b/src/game/ship.cc
index aa47044..007b841 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -63,20 +63,6 @@ void Ship::frame(float seconds)
// update thrust
entity_thrust = target_thrust;
-
- if (autolevel() && Game::instance()->g_autolevel->value()) {
- n.assign(math::crossproduct(entity_axis.up(), math::Vector3f(0, 0, 1.0f)));
- if (!(n.length() < MIN_DELTA)) {
- cosangle = math::dotproduct(entity_axis.up(), math::Vector3f(0, 0, 1.0f));
- target_roll = acos(cosangle);
- math::clamp(target_roll, 0.0f, 1.0f);
- target_roll *= M_1_PI;
- target_roll *= math::sgnf(math::dotproduct(entity_axis.left(), math::Vector3f(0.0, 0.0f, 1.0f)));
- } else {
- target_roll = 0;
- }
- }
-
if (current_target_roll < target_roll) {
current_target_roll += direction_change_speed * seconds;
if (current_target_roll > target_roll)
@@ -95,19 +81,6 @@ void Ship::frame(float seconds)
current_target_roll = 0.0f;
}
- // auto-leveling
- if (autolevel() && Game::instance()->g_autolevel->value()) {
- n.assign(math::crossproduct(entity_axis.up(), math::Vector3f(0.0f, 0.0f, 1.0f)));
- if (!(n.length() < MIN_DELTA)) {
- cosangle = math::dotproduct(entity_axis.up(), math::Vector3f(0.0f, 0.0f, 1.0f));
- target_pitch = acos(cosangle);
- math::clamp(target_roll, 0.0f, 1.0f);
- target_pitch *= -math::sgnf(math::dotproduct(entity_axis.forward(), math::Vector3f(0.0, 0.0f, 1.0f)));
- } else {
- target_pitch = 0;
- }
- }
-
// update target_axis direction
if (current_target_direction < target_direction) {
current_target_direction += direction_change_speed * seconds;