Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/camera.cc13
-rw-r--r--src/render/draw.cc16
2 files changed, 19 insertions, 10 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc
index 91a7095..ba056d0 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -230,10 +230,17 @@ void Camera::frame(float seconds)
if (core::localplayer()->view()) {
// player view entity
- distance = math::max(core::localplayer()->view()->radius(), 1.0f) * 3.0f;
+
camera_axis.assign(core::localplayer()->view()->axis());
- camera_axis.change_direction(180.0f);
- camera_target.assign(core::localplayer()->view()->location() - core::localplayer()->view()->axis().left()* (math::max(core::localplayer()->view()->radius(), 1.0f)*0.5f) );
+ if (core::localplayer()->view() == core::localcontrol()) {
+ camera_axis.change_pitch(pitch_free);
+ camera_target.assign(core::localplayer()->view()->location());
+ distance = math::max(core::localplayer()->view()->radius(), 1.0f) * 2.0f;
+ } else {
+ distance = math::max(core::localplayer()->view()->radius(), 1.0f) * 3.0f;
+ camera_axis.change_direction(180.0f);
+ camera_target.assign(core::localplayer()->view()->location() - core::localplayer()->view()->axis().left()* (math::max(core::localplayer()->view()->radius(), 1.0f)*0.5f) );
+ }
/*
} else if (core::localplayer()->zone()->default_view()) {
diff --git a/src/render/draw.cc b/src/render/draw.cc
index a56e1dc..6629ca9 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -556,7 +556,9 @@ void draw_model_fragments(core::Entity *entity)
if ((entity->type() == core::Entity::Dynamic) || (entity->type() == core::Entity::Controlable)) {
- if (static_cast<core::EntityDynamic *>(entity)->state() == core::Entity::NoPower) {
+ int state = static_cast<core::EntityDynamic *>(entity)->state();
+
+ if ((state == core::Entity::NoPower) || (state == core::Entity::Destroyed)) {
power = false;
} else if (entity->type() == core::Entity::Controlable) {
@@ -760,12 +762,12 @@ void draw_pass_model_fx(float elapsed)
power = true;
- if ((entity->type() == core::Entity::Dynamic) &&
- (static_cast<core::EntityDynamic *>(entity)->state() == core::Entity::NoPower)) {
- power = false;
- } else if ((entity->type() == core::Entity::Controlable) &&
- (static_cast<core::EntityControlable *>(entity)->state() == core::Entity::NoPower)) {
- power = false;
+ if ((entity->type() == core::Entity::Controlable) || (entity->type() == core::Entity::Dynamic)) {
+ int state = static_cast<core::EntityDynamic *>(entity)->state();
+
+ if ((state == core::Entity::NoPower) || (state == core::Entity::Destroyed)) {
+ power = false;
+ }
}
if (entity->model() && ext_render(entity)->detailvisible() && power) {