Skip to content

Commit ee0a9c0

Browse files
committed
[items] added drawMotorBoat() (updated C++ API files)
1 parent f582e0f commit ee0a9c0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

client-api/C++/src/vibes.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,22 @@ namespace vibes
706706
fflush(channel.get());
707707
}
708708

709+
void drawMotorBoat(const double &cx, const double &cy, const double &rot, const double &length, Params params)
710+
{
711+
beginDrawingIfNeeded();
712+
Vec2d vc = { cx, cy };
713+
Params msg;
714+
msg["action"] = "draw";
715+
msg["figure"] = params.pop("figure",current_fig);
716+
msg["shape"] = (params, "type", "vehicle_motor_boat",
717+
"center", vc,
718+
"length", length,
719+
"orientation", rot);
720+
721+
fputs(Value(msg).toJSONString().append("\n\n").c_str(), channel.get());
722+
fflush(channel.get());
723+
}
724+
709725
void drawTank(const double &cx, const double &cy, const double &rot, const double &length, Params params)
710726
{
711727
beginDrawingIfNeeded();

client-api/C++/src/vibes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ namespace vibes {
356356
/// Draw a 2-D submarine (type AUV) at position (cx,cy)
357357
VIBES_FUNC_COLOR_PARAM_4(drawAUV,const double &,cx, const double &,cy, const double &,rot, const double &,length)
358358

359+
/// Draw a 2-D motor boat (type USV) at position (cx,cy)
360+
VIBES_FUNC_COLOR_PARAM_4(drawMotorBoat,const double &,cx, const double &,cy, const double &,rot, const double &,length)
361+
359362
/// Draw a 2-D tank at position (cx,cy)
360363
VIBES_FUNC_COLOR_PARAM_4(drawTank,const double &,cx, const double &,cy, const double &,rot, const double &,length)
361364

0 commit comments

Comments
 (0)