QcBoatModel Namespace
The look of a boat (decision E-920): an open hull of planks with an oarlock on each side wall, built of boxes like the other static models, pointing north (-z) and turned by the boat's yaw, and two paddles turning in the oarlocks. More...
| Header: | #include <clientcore/entitymeshes/QcBoatModel.h> |
Classes
| struct | Paddle |
Types
| enum class | Side { Left, Right } |
Variables
| const std::array<QcBoatModel::Side, 2> | sides |
| const double | strokeSeconds |
| const double | wallHeight |
Functions
| double | bob(double seconds, quint32 id) |
| QcVec3 | gripOf(QcBoatModel::Side side, QcBoatModel::Paddle paddle) |
| QcBoatModel::Paddle | paddleAt(double rowPhase) |
| QList<QcMobPart> | paddleParts(const QString &planks, QcBoatModel::Side side) |
| QcVec3 | paddlePoint(QcBoatModel::Side side, QcBoatModel::Paddle paddle, const QcVec3 &local) |
| QcVec3 | partPoint(QcBoatModel::Side side, QcBoatModel::Paddle paddle, const QcVec3 &corner) |
| QList<QcMobPart> | parts(const QString &planks) |
| QString | planksOf(const QcContentRegistry &content, QcItemId item) |
| double | rowPhase(double seconds, bool rowing) |
| double | signOf(QcBoatModel::Side side) |
Detailed Description
Its planks are those of the block its item names (QcItemDefinition::boatBlock), so every kind of wood gives its boat and its paddles their colour without textures of their own. A floating boat bobs a little on the water. While the boat is rowed the paddles row in strokes (rowPhase 0..1); otherwise they rest along the sides with their blades in the water. The driver's hands hold the grips (QcAnimator: inBoat).
Classes
class Paddle
How a paddle lies in its oarlock, in degrees: sweep turns its outer end towards the stern (negative towards the bow), lift tilts its outer end down towards the water. More...
Type Documentation
enum class QcBoatModel::Side
The side of the boat a paddle is on; the value is the sign of its x in the boat's frame.
| Constant | Value | Description |
|---|---|---|
QcBoatModel::Side::Left | -1 | The left side, x < 0. |
QcBoatModel::Side::Right | 1 | The right side, x > 0. |
Variable Documentation
const std::array<QcBoatModel::Side, 2> QcBoatModel::sides
Both sides, right first.
const double QcBoatModel::strokeSeconds
Seconds per paddle stroke while rowing.
const double QcBoatModel::wallHeight
Height of the side walls above the boat's feet; the oarlocks sit on them.
Function Documentation
double QcBoatModel::bob(double seconds, quint32 id)
Returns how far a floating boat lies above or below its place at seconds of the client clock; each boat (by id) in its own phase.
QcVec3 QcBoatModel::gripOf(QcBoatModel::Side side, QcBoatModel::Paddle paddle)
Returns where the driver's hand holds the paddle on side, lying as paddle, in the boat's frame.
QcBoatModel::Paddle QcBoatModel::paddleAt(double rowPhase)
Returns the paddle at the moment rowPhase (0..1) of a stroke; negative: at rest. Both paddles move alike.
QList<QcMobPart> QcBoatModel::paddleParts(const QString &planks, QcBoatModel::Side side)
Returns the boxes of the paddle on side in its own frame: the oarlock at the origin, the shaft along +x (the left paddle's mirrored along -x), the grip inside the boat, the blade outside. Placed with partPoint; textured with planks.
QcVec3 QcBoatModel::paddlePoint(QcBoatModel::Side side, QcBoatModel::Paddle paddle, const QcVec3 &local)
Returns the point local of a paddle's frame (outer end along +x) in the boat's frame, for the paddle on side lying as paddle.
QcVec3 QcBoatModel::partPoint(QcBoatModel::Side side, QcBoatModel::Paddle paddle, const QcVec3 &corner)
Returns the corner of a box of paddleParts(…, side) in the boat's frame, the paddle lying as paddle.
QList<QcMobPart> QcBoatModel::parts(const QString &planks)
Returns the boxes of a boat built of planks with the texture planks, without the paddles.
QString QcBoatModel::planksOf(const QcContentRegistry &content, QcItemId item)
Returns the texture of the planks of the boat item item: the side of its boatBlock; empty for items content does not know or that place no boat.
double QcBoatModel::rowPhase(double seconds, bool rowing)
Returns the phase of the stroke at seconds of the client clock while the boat is rowed (rowing); -1 when not.
[constexpr] double QcBoatModel::signOf(QcBoatModel::Side side)
Returns the sign of the x of side in the boat's frame: +1 right, -1 left.