Skip to content

Commit 5b509d2

Browse files
Merge pull request #122 from rcsoccersim/develop
Official Release 18.1.1
2 parents 28bf674 + 379f029 commit 5b509d2

8 files changed

+43
-23
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5.1)
22

3-
project(RCSSServer VERSION 18.1.0)
3+
project(RCSSServer VERSION 18.1.1)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)

ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2023-03-15 Hidehisa Akiyama <hidehisaakiyama@users.noreply.github.com>
2+
3+
* CMakeLists.txt:
4+
* NEWS:
5+
* configure.ac:
6+
- update a point version number. Official release 18.1.1.
7+
- Fix a problem in which the focus point is sometimes not updated.
8+
19
2023-03-14 Hidehisa Akiyama <hidehisaakiyama@users.noreply.github.com>
210

311
* CMakeLists.txt:

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[18.1.1]
2+
* Fix a problem in which the focus point is sometimes not updated.
3+
14
[18.1.0]
25
* Revert the message frequency and the noise model of the visual
36
information. Now, these settings are same as 17.0.1.

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
AC_PREREQ([2.69])
55
LT_PREREQ([2.2])
6-
AC_INIT([RCSSServer],[18.1.0],[https://github.com/rcsoccersim/],[rcssserver])
6+
AC_INIT([RCSSServer],[18.1.1],[https://github.com/rcsoccersim/],[rcssserver])
77

88
#AM_INIT_AUTOMAKE([gnu 1.7.2 check-news dist-bzip2 dist-zip])
99
AM_INIT_AUTOMAKE([gnu 1.7.2 check-news foreign])

src/player.cpp

+6-13
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ Player::Player( Stadium & stadium,
203203
//
204204
M_focus_dist( 0.0 ),
205205
M_focus_dir( 0.0 ),
206-
M_focus_point( 0.0, 0.0 ),
207206
//
208207
M_ball_collide( false ),
209208
M_player_collide( false ),
@@ -251,7 +250,6 @@ Player::Player( Stadium & stadium,
251250

252251
setPlayerType( 0 );
253252
recoverAll();
254-
updateFocusPoint();
255253
}
256254

257255
Player::~Player()
@@ -1191,7 +1189,6 @@ Player::change_focus( double moment_dist, double moment_dir )
11911189
M_focus_dir = rcss::bound( -M_visible_angle * 0.5,
11921190
normalize_angle( M_focus_dir + Deg2Rad( moment_dir ) ),
11931191
+M_visible_angle * 0.5 );
1194-
updateFocusPoint();
11951192

11961193
++M_change_focus_count;
11971194
}
@@ -1815,7 +1812,6 @@ Player::change_view( rcss::pcom::VIEW_WIDTH viewWidth )
18151812
M_focus_dir = rcss::bound( -M_visible_angle * 0.5,
18161813
M_focus_dir,
18171814
+M_visible_angle * 0.5 );
1818-
updateFocusPoint();
18191815

18201816
++M_change_view_count;
18211817
}
@@ -2412,7 +2408,6 @@ Player::turnImpl()
24122408
{
24132409
M_angle_body_committed = this->M_angle_body;
24142410
M_angle_neck_committed = this->M_angle_neck;
2415-
updateFocusPoint();
24162411
M_vel.assign( 0.0, 0.0 );
24172412
M_accel.assign( 0.0, 0.0 );
24182413
}
@@ -2422,14 +2417,6 @@ Player::updateAngle()
24222417
{
24232418
M_angle_body_committed = this->M_angle_body;
24242419
M_angle_neck_committed = this->M_angle_neck;
2425-
updateFocusPoint();
2426-
}
2427-
2428-
void
2429-
Player::updateFocusPoint()
2430-
{
2431-
const double focus_angle = normalize_angle( angleBodyCommitted() + angleNeckCommitted() + focusDir() );
2432-
M_focus_point = pos() + PVector::fromPolar( focusDist(), focus_angle );
24332420
}
24342421

24352422
void
@@ -2490,6 +2477,12 @@ Player::canHearFullFrom( const Player & sender ) const
24902477
}
24912478
}
24922479

2480+
PVector
2481+
Player::focusPoint() const
2482+
{
2483+
return pos() + PVector::fromPolar( focusDist(),
2484+
normalize_angle( angleBodyCommitted() + angleNeckCommitted() + focusDir() ) );
2485+
}
24932486

24942487
void
24952488
Player::recoverAll()

src/player.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ class Player
147147
double M_angle_neck_committed;
148148
double M_focus_dist; //!< distance to the focus point from the center of the player
149149
double M_focus_dir; //!< direction to the focus point relative to the neck angle
150-
PVector M_focus_point; //!< the global focus position on the pitch
151150

152151
//
153152
// collision state
@@ -353,7 +352,7 @@ class Player
353352
const double & angleNeckCommitted() const { return M_angle_neck_committed; }
354353
double focusDist() const { return M_focus_dist; }
355354
double focusDir() const { return M_focus_dir; }
356-
const PVector & focusPoint() const { return M_focus_point; }
355+
PVector focusPoint() const;
357356

358357
//
359358
// update stamina
@@ -468,8 +467,6 @@ class Player
468467

469468
private:
470469

471-
void updateFocusPoint();
472-
473470
bool parseCommand( const char * command );
474471
int parseEar( const char * command );
475472

src/visualsenderplayer.cpp

+13-3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ VisualSenderPlayerV1::sendVisual()
106106
return;
107107
}
108108

109+
updateCache();
110+
109111
serializer().serializeVisualBegin( transport(), stadium().time() );
110112
sendFlags();
111113
sendBalls();
@@ -1035,7 +1037,8 @@ VisualSenderPlayerV13::~VisualSenderPlayerV13()
10351037
*/
10361038

10371039
VisualSenderPlayerV18::VisualSenderPlayerV18( const Params & params )
1038-
: VisualSenderPlayerV13( params )
1040+
: VisualSenderPlayerV13( params ),
1041+
M_focus_point( 0.0, 0.0 )
10391042
{
10401043

10411044
}
@@ -1045,6 +1048,14 @@ VisualSenderPlayerV18::~VisualSenderPlayerV18()
10451048

10461049
}
10471050

1051+
1052+
void
1053+
VisualSenderPlayerV18::updateCache()
1054+
{
1055+
M_focus_point = self().focusPoint();
1056+
}
1057+
1058+
10481059
void
10491060
VisualSenderPlayerV18::sendLowFlag( const PObject & flag )
10501061
{
@@ -1314,13 +1325,12 @@ VisualSenderPlayerV18::calcQuantDistFocusPoint( const PObject & obj,
13141325
const double unquant_dist,
13151326
const double qstep )
13161327
{
1317-
const double dist_focus_point = obj.pos().distance( self().focusPoint() );
1328+
const double dist_focus_point = obj.pos().distance( M_focus_point );
13181329
const double quant_dist_focus_point = calcQuantDist( dist_focus_point, qstep );
13191330

13201331
return std::max( 0.0, unquant_dist - ( dist_focus_point - quant_dist_focus_point ) );
13211332
}
13221333

1323-
13241334
/*!
13251335
//===================================================================
13261336
//

src/visualsenderplayer.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ class VisualSenderPlayer
131131
M_sendcnt = 0;
132132
}
133133

134+
virtual
135+
void updateCache()
136+
{ }
137+
134138
};
135139

136140

@@ -644,6 +648,9 @@ class VisualSenderPlayerV13
644648

645649
class VisualSenderPlayerV18
646650
: public VisualSenderPlayerV13 {
651+
private:
652+
PVector M_focus_point;
653+
647654
public:
648655
VisualSenderPlayerV18( const Params & params );
649656

@@ -652,6 +659,9 @@ class VisualSenderPlayerV18
652659

653660
protected:
654661

662+
virtual
663+
void updateCache() override;
664+
655665
virtual
656666
void sendLowFlag( const PObject & flag ) override;
657667
virtual
@@ -671,7 +681,6 @@ class VisualSenderPlayerV18
671681
double calcQuantDistFocusPoint( const PObject & obj,
672682
const double unquant_dist,
673683
const double q_step );
674-
675684
};
676685

677686
}

0 commit comments

Comments
 (0)