Commit Graph

66 Commits

Author SHA1 Message Date
NeroBurner 1d69a23ba4
Joystick sensitivity for player movement (#11262)
This commit deprecates the forward, backward, left, and right binary
inputs currently used for player movement in the PlayerControl struct.
In their place, it adds the movement_speed and movement_direction
values, which represents the player movement is a polar coordinate
system.

movement_speed is a scalar from 0.0 to 1.0. movement_direction is
an angle from 0 to +-Pi:

	       FWD
	        0
	        _
	 LFT   / \   RGT
	-Pi/2 |   | +Pi/2
	       \_/
	       +-Pi
	       BCK

Boolean movement bits will still be set for server telegrams and
Lua script invocations to provide full backward compatibility.
When generating these values from an analog input, a direction is
considered active when it is 22.5 degrees away from either
orthogonal axis.

Co-authored-by: Markus Koch <markus@notsyncing.net>
Co-authored-by: sfan5 <sfan5@live.de>
2021-08-27 20:24:24 +02:00
Lean Rada 328d949225
Start sprite animation at the beginning (#11509)
When setting a sprite animation, do not keep the last animation's frame number. Setting a new animation should start the animation at the start of the new animation.
2021-08-16 17:56:38 +02:00
hecks a049e8267f
Remove unused ITextSceneNode header (#11476)
Co-authored-by: hecktest <>
2021-07-22 00:55:20 +02:00
Liso c47313db65
Shadow mapping render pass (#11244)
Co-authored-by: x2048 <codeforsmile@gmail.com>
2021-06-06 18:51:21 +02:00
sfan5 f30dcdb504 Fix procession ordering issue in content_cao 2021-05-30 11:40:14 +02:00
Loic Blot de85bc9227 fix: some code tidy about includes & irr namespaces 2021-05-03 19:49:19 +02:00
Loic Blot 809e68fdc0 refacto: don't use RenderingEngine singleton on CAO
* we don't need on CAO side more than SceneManager, and temporary. Pass only required SceneManager as a parameter to build CAO and add them to the current scene
* Use temporary the RenderingEngine singleton from ClientEnvironment, waitfor for better solution
* Make ClientActiveObject::addToScene virtual function mandatory to be defined by children to ensure we don't forget to properly define it
2021-05-03 19:49:19 +02:00
sfan5 1e4913cd76
Irrlicht support code maintenance 2021-03-31 13:15:47 +02:00
rubenwardy f85e9ab925
Add nametag background setting and object property (#10937) 2021-02-17 19:51:28 +00:00
sfan5 74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
sfan5 b504a1aa4b Fix player sprite visibility in first person
closes #10525
2020-11-12 21:08:26 +01:00
sfan5 c441baa91b Fix overloaded virtual warnings with get/setAttachment() 2020-11-12 21:08:26 +01:00
SmallJoker c940a57a38 ContentCAO: Fix segfault when minimap is disabled 2020-11-08 11:30:16 +01:00
Lars Müller e3bd6704a0
Revert "Fix short 180 degree rotation when using set_bone_position (#10405)" (#10534)
This reverts commit 0f98b54aa4.
2020-11-04 21:43:32 +01:00
sfan5 c7aa92aaed Fix show_on_minimap default value for local player
fixes #10526
2020-10-20 16:36:05 +02:00
sfan5 660115c1ab
Decouple entity minimap markers from nametags replacing with show_on_minimap property (#10443) 2020-10-19 20:38:15 +02:00
Jordan Snelling 3068853e8a
Add First Person Attachments (#10360)
Fixes some other third person camera specific attachments.
Implements a single new flag for entities to be forced visible in first person mode.
Old mods do not need to be updated to use the new flag and are fully backwards compatible.
2020-10-04 15:10:34 +02:00
Lars Müller 0f98b54aa4
Fix short 180 degree rotation when using set_bone_position (#10405) 2020-10-04 15:09:12 +02:00
SmallJoker 947466ab28 (se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.

Removes unused Wide String serialization functions
2020-10-01 09:52:59 +02:00
ANAND 291a6b70d6 Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
2020-08-15 12:19:20 +03:00
sfan5 9bba52c400
content_cao: Support texture animation for upright_sprite (#10020) 2020-07-30 17:39:57 +02:00
hecktest 7be082f9a8
Fix bone-attached entities (#10015) 2020-06-26 00:06:29 +02:00
sfan5 495f7198ef content_cao: Fix behavior of legacy "textures" field for wielditems 2020-06-18 19:36:06 +02:00
Danila Shutov 3a6dfda358
Make shading of CAOs optional (#10033) 2020-06-16 20:48:31 +01:00
sfan5 3f0cbbc372 Use multiple light positions for CAO lighting 2020-06-11 21:13:26 +02:00
sfan5 f89794108c content_cao: Do not expire visuals for texture updates 2020-06-11 21:12:36 +02:00
hecktest 09e285f38c
Fix player-to-object attachment teleport bug (#10008)
Fixes two bugs:

 * The camera offset was not applied to an object while detaching, briefly placing the irrlicht matrixnode in world space.
 *  When attaching, the matrixnode's absolute position was evaluated without evaluating the parent first, resulting in zeroed positions.
2020-06-09 19:36:47 +02:00
Danila Shutov fe1f72ab0a
Recalculate mesh normals for CAOs (#10000) 2020-06-07 18:14:00 +02:00
SmallJoker 8fc9e7eb11 GenericCAO: Fix glow not working since a08d18a 2020-06-07 14:17:32 +02:00
SmallJoker c1e01bc638
Move shared parameters sending to UnitSAO (#9968)
Better header sorting by topic
Make UnitSAO-specific parameters private
Skip redundant recursive entity sending code (since ~5.2.0)
2020-06-04 19:31:46 +02:00
SmallJoker a08d18acad
ContentCAO: Update light of all attached entities (#9975) 2020-06-01 19:01:47 +02:00
sfan5 4c8e1c3200 Clean up CAO nametag handling and remove deprecated AO_CMD
AO_CMD_UPDATE_NAMETAG_ATTRIBUTES was deprecated in
9eee3c3f46 (0.4.14)
2020-05-29 22:54:50 +02:00
sfan5 db7c262ee8 content_cao: Do not expire visuals when not necessary
fixes #6572
2020-05-29 22:54:50 +02:00
sfan5 f51cf7c68a
Fix two bugs in content_cao
fixes #9889 (backface_culling with visual = "cube")
fixes #9916 (crash with visual = "upright_sprite")
2020-05-24 11:48:51 +02:00
ANAND c1ce4be756
Make automatic_rotate relative, allow setting rotation (#8468)
automatic_rotate does not make sense if it is absolute. Make it relative.

To avoid bouncing, set_rotation did not update the client when automatic_rotate was set. That's no longer necessary because the new spinning method applies the rotation on top of the current one, and the updates are necessary for set_rotation to actually transform the object.

Co-authored-by: ANAND <ClobberXD@gmail.com>

Co-authored-by: Pedro Gimeno <pgimeno@users.noreply.notabug.org>
2020-05-16 21:42:31 +02:00
Lars Müller 9ba24f89f5
Damage texture modifier (#9833)
Adds a new object property "damage_texture_modifier"
2020-05-11 21:41:36 +02:00
theviper121 e1fc72c6f3
Fix UpdateBonePosition() breaking animations (#9577) 2020-04-26 19:32:04 +02:00
Danila Shutov cdbe3c5e57
Reuse object_shader for "wielditem" and "item" entity drawtypes (#9537) 2020-04-19 18:47:13 +02:00
Alex fbf74dc524
Use TILE_MATERIAL_ALPHA for use_texture_alpha entity flag (#9639)
Fixes #9637.
2020-04-11 13:45:14 +02:00
Loïc Blot f648fb76ae
Drop genericobject.{cpp,h} (#9629)
* Drop genericobject.{cpp,h}

This file is not for generic object but for ActiveObject message passing.
Put ownership of the various commands to the right objects and cleanup the related code.

* Protect ServerActiveObject::m_messages_out

* typo fix
2020-04-10 19:49:20 +02:00
sfan5 de73f989eb
Overall improvements to log messages (#9598)
Hide some unnecessarily verbose ones behind --trace or disable them entirely.
Remove duplicate ones. Improve their contents in some places.
2020-04-08 20:13:23 +02:00
sfan5 04961491c1 Fix crash on wielditem/item entities
bug was introduced in f3032a637c
2020-03-28 12:56:48 +01:00
Danila Shutov f3032a637c
Fix incorrect light updates for wielditem and item visuals (#9540)
An alternative to #9537
2020-03-23 21:57:44 +01:00
Danila Shutov 5c1b72544a
Fix entity lighting (#9514)
fixes #9482
2020-03-16 22:58:13 +01:00
Danila Shutov 6958071f49
Basic model shading (#9374) 2020-02-16 20:37:28 +01:00
SmallJoker 103d9c5c53 Renaming the function wasn't enough 2019-12-07 15:55:49 +01:00
SmallJoker aa8df112ff Attachments: Fix interpolation from (0,0,0) after detach
GenericCAO::getPosition() did not take the camera offset into account
LocalPlayer attachment cleanup: Use sane getParent() function
Make that getPosition() (GenericCAO and LocalPlayer) always return the absolute position
2019-12-07 15:12:26 +01:00
SmallJoker f6de86ce4b Fix LocalPlayer-bound sound playback broken by 81c2370 2019-12-05 20:52:30 +01:00
sfan5 825579b43d Fix upright_sprite lighting when colors are set
fixes #9020
2019-10-06 17:19:42 +02:00
Jacob Lifshay 76032159bd Fix unwanted detaching when damage = 0 2019-10-05 15:45:05 +02:00