QtCraft API C++ classes QML types Handbook

QcLocalSounds Class

Sounds of the local player's own movement, made on the client without a server round trip: steps on the block underfoot, jumps, landings, swimming strokes and splashes into water. More...

Header: #include <clientcore/sound/QcLocalSounds.h>

Public Functions

QList<QcSoundCue> update(const QcEntityMotion &before, const QcEntityMotion &after, bool sneaking, const QcBlockAccess &world)

Static Public Members

std::optional<QcBlockId> groundBelow(const QcVec3 &feet, const QcBlockAccess &world)
const float jumpVolume
const double landingSpeed
const float sneakStepVolume
const double splashSpeed
QString stepSound(const QcVec3 &feet, const QcBlockAccess &world)
const float stepVolume
const double strideMetres
const double strokeMetres

Detailed Description

Fed once per client tick with the predicted motion before and after the tick.

Member Function Documentation

[static] std::optional<QcBlockId> QcLocalSounds::groundBelow(const QcVec3 &feet, const QcBlockAccess &world)

Returns the block of world a standing entity stands on (its feet are on top of it); nullopt when not loaded.

[static] QString QcLocalSounds::stepSound(const QcVec3 &feet, const QcBlockAccess &world)

Returns the step sound of the ground of world below feet, or an empty key when it makes none.

QList<QcSoundCue> QcLocalSounds::update(const QcEntityMotion &before, const QcEntityMotion &after, bool sneaking, const QcBlockAccess &world)

Returns the sounds of the tick from motion before to motion after, on the ground of world; quieter steps while sneaking.

Member Variable Documentation

const float QcLocalSounds::jumpVolume

Volume of a jump.

const double QcLocalSounds::landingSpeed

Falling faster than this (m/s) makes a landing louder than a step.

const float QcLocalSounds::sneakStepVolume

Volume of a step while sneaking.

const double QcLocalSounds::splashSpeed

Entering water faster than this (m/s) makes a splash.

const float QcLocalSounds::stepVolume

Volume of a step.