Merge branch 'master' of github.com:supertuxkart/stk-code
This commit is contained in:
commit
bf61b98444
@ -4,76 +4,75 @@
|
|||||||
<header id="title" width="100%" height="fit" text_align="center" word_wrap="true" text="Touch Device Settings" />
|
<header id="title" width="100%" height="fit" text_align="center" word_wrap="true" text="Touch Device Settings" />
|
||||||
|
|
||||||
<spacer height="35" width="10" />
|
<spacer height="35" width="10" />
|
||||||
|
|
||||||
<label width="100%" I18N="In the multitouch settings screen" text="General"/>
|
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<label width="100%" I18N="In the multitouch settings screen" text="General"/>
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Device enabled"/>
|
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
<spacer width="40" height="100%" />
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Device enabled"/>
|
||||||
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
|
<spacer width="40" height="10" />
|
||||||
<checkbox id="buttons_enabled"/>
|
<checkbox id="buttons_enabled"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Buttons scale"/>
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Buttons scale"/>
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
<spacer width="40" height="100%" />
|
<spacer width="40" height="10" />
|
||||||
<gauge id="scale" proportion="1" min_value="50" max_value="150"/>
|
<gauge id="scale" proportion="1" min_value="50" max_value="150"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label width="100%" I18N="In the multitouch settings screen" text="Accelerometer"/>
|
<label width="100%" I18N="In the multitouch settings screen" text="Accelerometer"/>
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Disabled"/>
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Disabled"/>
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
<spacer width="40" height="100%" />
|
<spacer width="40" height="10" />
|
||||||
<checkbox id="accelerometer_disabled"/>
|
<checkbox id="accelerometer_disabled"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Phone"/>
|
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
|
||||||
<spacer width="40" height="100%" />
|
|
||||||
<checkbox id="accelerometer_phone"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Tablet"/>
|
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
|
||||||
<spacer width="40" height="100%" />
|
|
||||||
<checkbox id="accelerometer_tablet"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label width="100%" I18N="In the multitouch settings screen" text="Advanced"/>
|
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Deadzone center"/>
|
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
|
||||||
<spacer width="40" height="100%" />
|
|
||||||
<gauge id="deadzone_center" proportion="1" min_value="0" max_value="50"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
|
||||||
<label proportion="1" height="100%" text_align="right" I18N="In the multitouch settings screen" text="Deadzone edge"/>
|
|
||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
|
||||||
<spacer width="40" height="100%" />
|
|
||||||
<gauge id="deadzone_edge" proportion="1" min_value="0" max_value="50"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<spacer height="35" width="10"/>
|
|
||||||
|
|
||||||
<div width="fit" height="fit" layout="horizontal-row" align="center">
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
<button id="restore" text="Restore defaults"/>
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Phone"/>
|
||||||
<spacer width="40" height="100%" />
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
<button id="close" text="Apply"/>
|
<spacer width="40" height="10" />
|
||||||
</div>
|
<checkbox id="accelerometer_phone"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Tablet"/>
|
||||||
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
|
<spacer width="40" height="10" />
|
||||||
|
<checkbox id="accelerometer_tablet"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label width="100%" I18N="In the multitouch settings screen" text="Advanced"/>
|
||||||
|
|
||||||
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Deadzone center"/>
|
||||||
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
|
<spacer width="40" height="10" />
|
||||||
|
<gauge id="deadzone_center" proportion="1" min_value="0" max_value="50"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div width="75%" layout="horizontal-row" proportion="1">
|
||||||
|
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Deadzone edge"/>
|
||||||
|
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||||
|
<spacer width="40" height="10" />
|
||||||
|
<gauge id="deadzone_edge" proportion="1" min_value="0" max_value="50"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<spacer height="35" width="10"/>
|
||||||
|
|
||||||
|
<div width="fit" height="fit" layout="horizontal-row" align="center" proportion="1">
|
||||||
|
<button id="restore" text="Restore defaults"/>
|
||||||
|
<spacer width="40" height="10" />
|
||||||
|
<button id="close" text="Apply"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</stkgui>
|
</stkgui>
|
||||||
|
@ -926,6 +926,10 @@ namespace UserConfigParams
|
|||||||
PARAM_DEFAULT( BoolUserConfigParam(false, "artist_debug_mode",
|
PARAM_DEFAULT( BoolUserConfigParam(false, "artist_debug_mode",
|
||||||
"Whether to enable track debugging features") );
|
"Whether to enable track debugging features") );
|
||||||
|
|
||||||
|
PARAM_PREFIX BoolUserConfigParam m_hide_gui
|
||||||
|
PARAM_DEFAULT(BoolUserConfigParam(false, "debug_hide_gui",
|
||||||
|
"Whether to hide the GUI (artist debug mode)"));
|
||||||
|
|
||||||
PARAM_PREFIX BoolUserConfigParam m_everything_unlocked
|
PARAM_PREFIX BoolUserConfigParam m_everything_unlocked
|
||||||
PARAM_DEFAULT( BoolUserConfigParam(false, "everything_unlocked",
|
PARAM_DEFAULT( BoolUserConfigParam(false, "everything_unlocked",
|
||||||
"Enable all karts and tracks") );
|
"Enable all karts and tracks") );
|
||||||
|
@ -88,6 +88,7 @@ RTT::RTT(size_t width, size_t height)
|
|||||||
GLint rgb_format = GL_BGR;
|
GLint rgb_format = GL_BGR;
|
||||||
GLint diffuse_specular_internal_format = GL_R11F_G11F_B10F;
|
GLint diffuse_specular_internal_format = GL_R11F_G11F_B10F;
|
||||||
GLint type = GL_FLOAT;
|
GLint type = GL_FLOAT;
|
||||||
|
GLint srgb_internal_format = GL_SRGB8_ALPHA8;
|
||||||
|
|
||||||
#if defined(USE_GLES2)
|
#if defined(USE_GLES2)
|
||||||
if (!CVS->isEXTColorBufferFloatUsable())
|
if (!CVS->isEXTColorBufferFloatUsable())
|
||||||
@ -101,6 +102,8 @@ RTT::RTT(size_t width, size_t height)
|
|||||||
diffuse_specular_internal_format = GL_RGBA8;
|
diffuse_specular_internal_format = GL_RGBA8;
|
||||||
type = GL_UNSIGNED_BYTE;
|
type = GL_UNSIGNED_BYTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srgb_internal_format = GL_RGBA8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RenderTargetTextures[RTT_TMP1] = generateRTT(res, rgba_internal_format, rgba_format, type);
|
RenderTargetTextures[RTT_TMP1] = generateRTT(res, rgba_internal_format, rgba_format, type);
|
||||||
@ -110,9 +113,9 @@ RTT::RTT(size_t width, size_t height)
|
|||||||
RenderTargetTextures[RTT_LINEAR_DEPTH] = generateRTT(res, red32_internal_format, red_format, type, linear_depth_mip_levels);
|
RenderTargetTextures[RTT_LINEAR_DEPTH] = generateRTT(res, red32_internal_format, red_format, type, linear_depth_mip_levels);
|
||||||
RenderTargetTextures[RTT_NORMAL_AND_DEPTH] = generateRTT(res, rgba_internal_format, GL_RGBA, type);
|
RenderTargetTextures[RTT_NORMAL_AND_DEPTH] = generateRTT(res, rgba_internal_format, GL_RGBA, type);
|
||||||
RenderTargetTextures[RTT_COLOR] = generateRTT(res, rgba_internal_format, rgba_format, type);
|
RenderTargetTextures[RTT_COLOR] = generateRTT(res, rgba_internal_format, rgba_format, type);
|
||||||
RenderTargetTextures[RTT_MLAA_COLORS] = generateRTT(res, GL_SRGB8_ALPHA8, rgb_format, GL_UNSIGNED_BYTE);
|
RenderTargetTextures[RTT_MLAA_COLORS] = generateRTT(res, srgb_internal_format, rgb_format, GL_UNSIGNED_BYTE);
|
||||||
RenderTargetTextures[RTT_MLAA_TMP] = generateRTT(res, GL_SRGB8_ALPHA8, rgb_format, GL_UNSIGNED_BYTE);
|
RenderTargetTextures[RTT_MLAA_TMP] = generateRTT(res, srgb_internal_format, rgb_format, GL_UNSIGNED_BYTE);
|
||||||
RenderTargetTextures[RTT_MLAA_BLEND] = generateRTT(res, GL_SRGB8_ALPHA8, rgb_format, GL_UNSIGNED_BYTE);
|
RenderTargetTextures[RTT_MLAA_BLEND] = generateRTT(res, srgb_internal_format, rgb_format, GL_UNSIGNED_BYTE);
|
||||||
RenderTargetTextures[RTT_SSAO] = generateRTT(res, red_internal_format, red_format, type);
|
RenderTargetTextures[RTT_SSAO] = generateRTT(res, red_internal_format, red_format, type);
|
||||||
RenderTargetTextures[RTT_DISPLACE] = generateRTT(res, rgba_internal_format, rgba_format, type);
|
RenderTargetTextures[RTT_DISPLACE] = generateRTT(res, rgba_internal_format, rgba_format, type);
|
||||||
RenderTargetTextures[RTT_DIFFUSE] = generateRTT(res, diffuse_specular_internal_format, rgb_format, type);
|
RenderTargetTextures[RTT_DIFFUSE] = generateRTT(res, diffuse_specular_internal_format, rgb_format, type);
|
||||||
|
@ -863,6 +863,10 @@ void ShaderBasedRenderer::render(float dt)
|
|||||||
irr_driver->getVideoDriver()->setViewPort(core::recti(0, 0,
|
irr_driver->getVideoDriver()->setViewPort(core::recti(0, 0,
|
||||||
irr_driver->getActualScreenSize().Width,
|
irr_driver->getActualScreenSize().Width,
|
||||||
irr_driver->getActualScreenSize().Height));
|
irr_driver->getActualScreenSize().Height));
|
||||||
|
|
||||||
|
m_current_screen_size = core::vector2df(
|
||||||
|
irr_driver->getActualScreenSize().Width,
|
||||||
|
irr_driver->getActualScreenSize().Height);
|
||||||
|
|
||||||
for(unsigned int i=0; i<Camera::getNumCameras(); i++)
|
for(unsigned int i=0; i<Camera::getNumCameras(); i++)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "font/font_manager.hpp"
|
#include "font/font_manager.hpp"
|
||||||
#include "font/regular_face.hpp"
|
#include "font/regular_face.hpp"
|
||||||
|
#include "graphics/irr_driver.hpp"
|
||||||
#include "guiengine/engine.hpp"
|
#include "guiengine/engine.hpp"
|
||||||
#include "guiengine/scalable_font.hpp"
|
#include "guiengine/scalable_font.hpp"
|
||||||
#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
|
#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
|
||||||
@ -146,8 +147,14 @@ void DynamicRibbonWidget::add()
|
|||||||
m_right_widget = new IconButtonWidget(IconButtonWidget::SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO, false);
|
m_right_widget = new IconButtonWidget(IconButtonWidget::SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO, false);
|
||||||
|
|
||||||
const int average_y = m_y + (m_h - m_label_height)/2;
|
const int average_y = m_y + (m_h - m_label_height)/2;
|
||||||
m_arrows_w = 40;
|
|
||||||
const int button_h = 50;
|
unsigned int screen_height = irr_driver->getActualScreenSize().Height;
|
||||||
|
m_arrows_w = (int)(screen_height / 15);
|
||||||
|
m_arrows_w = std::max(m_arrows_w, 40);
|
||||||
|
#ifdef ANDROID
|
||||||
|
m_arrows_w *= 1.5f;
|
||||||
|
#endif
|
||||||
|
const int button_h = m_arrows_w;
|
||||||
|
|
||||||
// right arrow
|
// right arrow
|
||||||
rect<s32> right_arrow_location = rect<s32>(m_x + m_w - m_arrows_w,
|
rect<s32> right_arrow_location = rect<s32>(m_x + m_w - m_arrows_w,
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "utils/no_copy.hpp"
|
#include "utils/no_copy.hpp"
|
||||||
#include "utils/vec3.hpp"
|
#include "utils/vec3.hpp"
|
||||||
|
|
||||||
#include <line2d.h>
|
#include <line3d.h>
|
||||||
|
|
||||||
class AbstractKart;
|
class AbstractKart;
|
||||||
class Item;
|
class Item;
|
||||||
@ -194,10 +194,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool hitKart(const Vec3 &xyz, const AbstractKart *kart=NULL) const
|
bool hitKart(const Vec3 &xyz, const AbstractKart *kart=NULL) const
|
||||||
{
|
{
|
||||||
Vec3 diff = (xyz - m_xyz);
|
if (m_event_handler == kart && m_deactive_time > 0)
|
||||||
diff.setY(diff.getY() / 2.0f); // don't be too strict if the kart is a bit above the item
|
return false;
|
||||||
return (m_event_handler!=kart || m_deactive_time <=0) &&
|
Vec3 lc = quatRotate(m_original_rotation, xyz - m_xyz);
|
||||||
diff.length2()<m_distance_2;
|
// Don't be too strict if the kart is a bit above the item
|
||||||
|
lc.setY(lc.getY() / 2.0f);
|
||||||
|
return lc.length2() < m_distance_2;
|
||||||
} // hitKart
|
} // hitKart
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -214,7 +216,7 @@ protected:
|
|||||||
const AbstractKart *kart=NULL) const
|
const AbstractKart *kart=NULL) const
|
||||||
{
|
{
|
||||||
if(m_event_handler==kart && m_deactive_time >0) return false;
|
if(m_event_handler==kart && m_deactive_time >0) return false;
|
||||||
|
|
||||||
Vec3 closest = line.getClosestPoint(m_xyz.toIrrVector());
|
Vec3 closest = line.getClosestPoint(m_xyz.toIrrVector());
|
||||||
return hitKart(closest, kart);
|
return hitKart(closest, kart);
|
||||||
} // hitLine
|
} // hitLine
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "karts/skidding.hpp"
|
#include "karts/skidding.hpp"
|
||||||
#include "modes/linear_world.hpp"
|
#include "modes/linear_world.hpp"
|
||||||
#include "modes/profile_world.hpp"
|
#include "modes/profile_world.hpp"
|
||||||
|
#include "physics/triangle_mesh.hpp"
|
||||||
#include "race/race_manager.hpp"
|
#include "race/race_manager.hpp"
|
||||||
#include "tracks/drive_graph.hpp"
|
#include "tracks/drive_graph.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
@ -911,8 +912,15 @@ bool SkiddingAI::steerToAvoid(const std::vector<const Item *> &items_to_avoid,
|
|||||||
const Vec3& left = items_to_avoid[index_left_most]->getXYZ();
|
const Vec3& left = items_to_avoid[index_left_most]->getXYZ();
|
||||||
int node_index = items_to_avoid[index_left_most]->getGraphNode();
|
int node_index = items_to_avoid[index_left_most]->getGraphNode();
|
||||||
const Vec3& normal = DriveGraph::get()->getNode(node_index)->getNormal();
|
const Vec3& normal = DriveGraph::get()->getNode(node_index)->getNormal();
|
||||||
|
Vec3 hit;
|
||||||
|
Vec3 hit_nor(0, 1, 0);
|
||||||
|
const Material* m;
|
||||||
|
m_track->getPtrTriangleMesh()->castRay(
|
||||||
|
Vec3(line_to_target.getMiddle()) + normal,
|
||||||
|
Vec3(line_to_target.getMiddle()) + normal * -10000, &hit, &m,
|
||||||
|
&hit_nor);
|
||||||
Vec3 p1 = line_to_target.start,
|
Vec3 p1 = line_to_target.start,
|
||||||
p2 = line_to_target.getMiddle() + normal.toIrrVector(),
|
p2 = line_to_target.getMiddle() + hit_nor.toIrrVector(),
|
||||||
p3 = line_to_target.end;
|
p3 = line_to_target.end;
|
||||||
|
|
||||||
int item_index = -1;
|
int item_index = -1;
|
||||||
@ -929,12 +937,6 @@ bool SkiddingAI::steerToAvoid(const std::vector<const Item *> &items_to_avoid,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const Vec3& right = items_to_avoid[index_right_most]->getXYZ();
|
const Vec3& right = items_to_avoid[index_right_most]->getXYZ();
|
||||||
int node_index = items_to_avoid[index_right_most]->getGraphNode();
|
|
||||||
const Vec3& normal = DriveGraph::get()->getNode(node_index)->getNormal();
|
|
||||||
Vec3 p1 = line_to_target.start,
|
|
||||||
p2 = line_to_target.getMiddle() + normal.toIrrVector(),
|
|
||||||
p3 = line_to_target.end;
|
|
||||||
|
|
||||||
if (right.sideofPlane(p1, p2, p3) >= 0)
|
if (right.sideofPlane(p1, p2, p3) >= 0)
|
||||||
{
|
{
|
||||||
// Right of rightmost point
|
// Right of rightmost point
|
||||||
|
@ -48,6 +48,8 @@
|
|||||||
#include "tracks/drive_node.hpp"
|
#include "tracks/drive_node.hpp"
|
||||||
#include "utils/random_generator.hpp"
|
#include "utils/random_generator.hpp"
|
||||||
|
|
||||||
|
#include <line3d.h>
|
||||||
|
|
||||||
class LinearWorld;
|
class LinearWorld;
|
||||||
class DriveGraph;
|
class DriveGraph;
|
||||||
class ShowCurve;
|
class ShowCurve;
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "karts/skidding.hpp"
|
#include "karts/skidding.hpp"
|
||||||
#include "modes/linear_world.hpp"
|
#include "modes/linear_world.hpp"
|
||||||
#include "modes/profile_world.hpp"
|
#include "modes/profile_world.hpp"
|
||||||
|
#include "physics/triangle_mesh.hpp"
|
||||||
#include "race/race_manager.hpp"
|
#include "race/race_manager.hpp"
|
||||||
#include "tracks/drive_graph.hpp"
|
#include "tracks/drive_graph.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
@ -917,8 +918,15 @@ bool SkiddingAI::steerToAvoid(const std::vector<const Item *> &items_to_avoid,
|
|||||||
const Vec3& left = items_to_avoid[index_left_most]->getXYZ();
|
const Vec3& left = items_to_avoid[index_left_most]->getXYZ();
|
||||||
int node_index = items_to_avoid[index_left_most]->getGraphNode();
|
int node_index = items_to_avoid[index_left_most]->getGraphNode();
|
||||||
const Vec3& normal = DriveGraph::get()->getNode(node_index)->getNormal();
|
const Vec3& normal = DriveGraph::get()->getNode(node_index)->getNormal();
|
||||||
|
Vec3 hit;
|
||||||
|
Vec3 hit_nor(0, 1, 0);
|
||||||
|
const Material* m;
|
||||||
|
m_track->getPtrTriangleMesh()->castRay(
|
||||||
|
Vec3(line_to_target.getMiddle()) + normal,
|
||||||
|
Vec3(line_to_target.getMiddle()) + normal * -10000, &hit, &m,
|
||||||
|
&hit_nor);
|
||||||
Vec3 p1 = line_to_target.start,
|
Vec3 p1 = line_to_target.start,
|
||||||
p2 = line_to_target.getMiddle() + normal.toIrrVector(),
|
p2 = line_to_target.getMiddle() + hit_nor.toIrrVector(),
|
||||||
p3 = line_to_target.end;
|
p3 = line_to_target.end;
|
||||||
|
|
||||||
int item_index = -1;
|
int item_index = -1;
|
||||||
@ -935,12 +943,6 @@ bool SkiddingAI::steerToAvoid(const std::vector<const Item *> &items_to_avoid,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const Vec3& right = items_to_avoid[index_right_most]->getXYZ();
|
const Vec3& right = items_to_avoid[index_right_most]->getXYZ();
|
||||||
int node_index = items_to_avoid[index_right_most]->getGraphNode();
|
|
||||||
const Vec3& normal = DriveGraph::get()->getNode(node_index)->getNormal();
|
|
||||||
Vec3 p1 = line_to_target.start,
|
|
||||||
p2 = line_to_target.getMiddle() + normal.toIrrVector(),
|
|
||||||
p3 = line_to_target.end;
|
|
||||||
|
|
||||||
if (right.sideofPlane(p1, p2, p3) >= 0)
|
if (right.sideofPlane(p1, p2, p3) >= 0)
|
||||||
{
|
{
|
||||||
// Right of rightmost point
|
// Right of rightmost point
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
#include "tracks/drive_node.hpp"
|
#include "tracks/drive_node.hpp"
|
||||||
#include "utils/random_generator.hpp"
|
#include "utils/random_generator.hpp"
|
||||||
|
|
||||||
|
#include <line3d.h>
|
||||||
|
|
||||||
#ifdef AI_DEBUG
|
#ifdef AI_DEBUG
|
||||||
class ShowCurve;
|
class ShowCurve;
|
||||||
|
|
||||||
|
@ -2557,7 +2557,16 @@ void Kart::loadData(RaceManager::KartType type, bool is_animated_model)
|
|||||||
->isFogEnabled() );
|
->isFogEnabled() );
|
||||||
}
|
}
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
if (!CVS->supportsShadows())
|
bool create_shadow = m_kart_properties->getShadowTexture() != NULL &&
|
||||||
|
!CVS->supportsShadows();
|
||||||
|
|
||||||
|
#ifdef USE_GLES2
|
||||||
|
// Disable kart shadow for legacy pipeline in GLES renderer because it's
|
||||||
|
// broken
|
||||||
|
create_shadow = create_shadow && CVS->isGLSL();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (create_shadow)
|
||||||
{
|
{
|
||||||
m_shadow = new Shadow(m_kart_properties.get(), m_node,
|
m_shadow = new Shadow(m_kart_properties.get(), m_node,
|
||||||
-m_kart_model->getLowestPoint());
|
-m_kart_model->getLowestPoint());
|
||||||
|
@ -65,6 +65,9 @@ RaceGUI::RaceGUI()
|
|||||||
{
|
{
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
|
|
||||||
|
if (UserConfigParams::m_artist_debug_mode && UserConfigParams::m_hide_gui)
|
||||||
|
m_enabled = false;
|
||||||
|
|
||||||
// Determine maximum length of the rank/lap text, in order to
|
// Determine maximum length of the rank/lap text, in order to
|
||||||
// align those texts properly on the right side of the viewport.
|
// align those texts properly on the right side of the viewport.
|
||||||
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
||||||
|
@ -41,6 +41,7 @@ RaceGUIMultitouch::RaceGUIMultitouch(RaceGUIBase* race_gui)
|
|||||||
{
|
{
|
||||||
m_race_gui = race_gui;
|
m_race_gui = race_gui;
|
||||||
m_minimap_bottom = 0;
|
m_minimap_bottom = 0;
|
||||||
|
m_gui_action = false;
|
||||||
m_directionnal_wheel_tex = NULL;
|
m_directionnal_wheel_tex = NULL;
|
||||||
m_pause_tex = NULL;
|
m_pause_tex = NULL;
|
||||||
m_nitro_tex = NULL;
|
m_nitro_tex = NULL;
|
||||||
@ -147,6 +148,7 @@ void RaceGUIMultitouch::initMultitouchSteering()
|
|||||||
"android/blur_bg_button.png");
|
"android/blur_bg_button.png");
|
||||||
m_bg_button_focus_tex = irr_driver->getTexture(FileManager::GUI,
|
m_bg_button_focus_tex = irr_driver->getTexture(FileManager::GUI,
|
||||||
"android/blur_bg_button_focus.png");
|
"android/blur_bg_button_focus.png");
|
||||||
|
m_gui_action_tex = irr_driver->getTexture(FileManager::GUI,"challenge.png");
|
||||||
|
|
||||||
} // initMultitouchSteering
|
} // initMultitouchSteering
|
||||||
|
|
||||||
@ -209,8 +211,12 @@ void RaceGUIMultitouch::drawMultitouchSteering(const AbstractKart* kart,
|
|||||||
case MultitouchButtonType::BUTTON_FIRE:
|
case MultitouchButtonType::BUTTON_FIRE:
|
||||||
{
|
{
|
||||||
const Powerup* powerup = kart->getPowerup();
|
const Powerup* powerup = kart->getPowerup();
|
||||||
if (powerup->getType() != PowerupManager::POWERUP_NOTHING &&
|
if (m_gui_action == true)
|
||||||
!kart->hasFinishedRace())
|
{
|
||||||
|
btn_texture = m_gui_action_tex;
|
||||||
|
}
|
||||||
|
else if (powerup->getType() != PowerupManager::POWERUP_NOTHING
|
||||||
|
&& !kart->hasFinishedRace())
|
||||||
{
|
{
|
||||||
btn_texture = powerup->getIcon()->getTexture();
|
btn_texture = powerup->getIcon()->getTexture();
|
||||||
}
|
}
|
||||||
@ -271,7 +277,8 @@ void RaceGUIMultitouch::drawMultitouchSteering(const AbstractKart* kart,
|
|||||||
core::vector2df(scale, scale));
|
core::vector2df(scale, scale));
|
||||||
}
|
}
|
||||||
else if (button->type == MultitouchButtonType::BUTTON_FIRE &&
|
else if (button->type == MultitouchButtonType::BUTTON_FIRE &&
|
||||||
kart->getPowerup()->getNum() > 1)
|
kart->getPowerup()->getNum() > 1 &&
|
||||||
|
m_gui_action == false)
|
||||||
{
|
{
|
||||||
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
||||||
core::rect<s32> pos((int)(button->x),
|
core::rect<s32> pos((int)(button->x),
|
||||||
|
@ -35,6 +35,7 @@ private:
|
|||||||
RaceGUIBase* m_race_gui;
|
RaceGUIBase* m_race_gui;
|
||||||
MultitouchDevice* m_device;
|
MultitouchDevice* m_device;
|
||||||
|
|
||||||
|
bool m_gui_action;
|
||||||
unsigned int m_minimap_bottom;
|
unsigned int m_minimap_bottom;
|
||||||
|
|
||||||
video::ITexture* m_directionnal_wheel_tex;
|
video::ITexture* m_directionnal_wheel_tex;
|
||||||
@ -46,6 +47,7 @@ private:
|
|||||||
video::ITexture* m_drift_tex;
|
video::ITexture* m_drift_tex;
|
||||||
video::ITexture* m_bg_button_tex;
|
video::ITexture* m_bg_button_tex;
|
||||||
video::ITexture* m_bg_button_focus_tex;
|
video::ITexture* m_bg_button_focus_tex;
|
||||||
|
video::ITexture* m_gui_action_tex;
|
||||||
|
|
||||||
void initMultitouchSteering();
|
void initMultitouchSteering();
|
||||||
void closeMultitouchSteering();
|
void closeMultitouchSteering();
|
||||||
@ -59,6 +61,7 @@ public:
|
|||||||
const core::vector2df &scaling);
|
const core::vector2df &scaling);
|
||||||
|
|
||||||
unsigned int getMinimapBottom() {return m_minimap_bottom;}
|
unsigned int getMinimapBottom() {return m_minimap_bottom;}
|
||||||
|
void setGuiAction(bool enabled = true) {m_gui_action = enabled;}
|
||||||
|
|
||||||
}; // RaceGUIMultitouch
|
}; // RaceGUIMultitouch
|
||||||
|
|
||||||
|
@ -73,6 +73,10 @@ const int COMPLETED_HARD = 4;
|
|||||||
RaceGUIOverworld::RaceGUIOverworld()
|
RaceGUIOverworld::RaceGUIOverworld()
|
||||||
{
|
{
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
|
|
||||||
|
if (UserConfigParams::m_artist_debug_mode && UserConfigParams::m_hide_gui)
|
||||||
|
m_enabled = false;
|
||||||
|
|
||||||
m_is_first_render_call = true;
|
m_is_first_render_call = true;
|
||||||
m_close_to_a_challenge = false;
|
m_close_to_a_challenge = false;
|
||||||
m_current_challenge = NULL;
|
m_current_challenge = NULL;
|
||||||
@ -586,6 +590,11 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
|||||||
true, true /* vcenter */, NULL);
|
true, true /* vcenter */, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_multitouch_gui != NULL)
|
||||||
|
{
|
||||||
|
m_multitouch_gui->setGuiAction(m_close_to_a_challenge);
|
||||||
|
}
|
||||||
#endif // SERVER_ONLY
|
#endif // SERVER_ONLY
|
||||||
} // drawGlobalMiniMap
|
} // drawGlobalMiniMap
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "tracks/quad.hpp"
|
#include "tracks/quad.hpp"
|
||||||
#include "utils/cpp2011.hpp"
|
#include "utils/cpp2011.hpp"
|
||||||
|
|
||||||
|
#include <line3d.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
#include "io/xml_node.hpp"
|
#include "io/xml_node.hpp"
|
||||||
#include "matrix4.h"
|
|
||||||
#include "tracks/drive_graph.hpp"
|
#include "tracks/drive_graph.hpp"
|
||||||
#include "utils/log.hpp"
|
#include "utils/log.hpp"
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "tracks/drive_node.hpp"
|
#include "tracks/drive_node.hpp"
|
||||||
#include "utils/cpp2011.hpp"
|
#include "utils/cpp2011.hpp"
|
||||||
|
|
||||||
|
#include <line3d.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \ingroup tracks
|
* \ingroup tracks
|
||||||
*/
|
*/
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef HEADER_VEC3_HPP
|
#ifndef HEADER_VEC3_HPP
|
||||||
#define HEADER_VEC3_HPP
|
#define HEADER_VEC3_HPP
|
||||||
|
|
||||||
#include <triangle3d.h>
|
|
||||||
#include <vector3d.h>
|
#include <vector3d.h>
|
||||||
#include <vector2d.h>
|
#include <vector2d.h>
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
@ -216,12 +215,8 @@ public:
|
|||||||
|
|
||||||
float sideofPlane(const Vec3& x1, const Vec3& x2, const Vec3& x3) const
|
float sideofPlane(const Vec3& x1, const Vec3& x2, const Vec3& x3) const
|
||||||
{
|
{
|
||||||
core::triangle3df triangle(x1.toIrrVector(), x2.toIrrVector(), x3.toIrrVector());
|
return ((x2 - x1).cross(x3 - x1)).dot(*this - x1);
|
||||||
core::vector3df normal = triangle.getNormal();
|
|
||||||
return normal.dotProduct((*this - x1).toIrrVector());
|
|
||||||
|
|
||||||
} // sideOfPlane
|
} // sideOfPlane
|
||||||
}; // Vec3
|
}; // Vec3
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user