1#ifndef NANOMMO_CLIENT_CHARACTERS_H_
2#define NANOMMO_CLIENT_CHARACTERS_H_
19#include "content/figures.pb.h"
20#include "content/items.pb.h"
21#include "content/rig.pb.h"
22#include "content/skills.pb.h"
37 const figures::Figures& figures);
41 Characters(
const std::string& folder,
const std::vector<std::string>& files,
42 float height, Shader shader);
48 std::size_t
size()
const {
return characters_.size(); }
52 void Hold(uint32_t
id,
const items::Look& look, Shader shader);
56 void Wear(uint32_t
id,
const items::Look& look);
59 void Learn(uint32_t skill,
const skills::Look& look);
73 std::optional<std::pair<Vector3, Vector3>>
Blade(
const Figure& figure)
const;
96 std::map<int, Garment> hairs;
98 std::map<uint32_t, Garment> garments;
99 ModelAnimation* clips =
nullptr;
101 std::array<int, 5> clip_for{};
102 std::array<float, 5> speed{1.0f, 1.0f, 1.0f, 1.0f, 1.0f};
104 std::array<std::array<float, 2>, 5> footfalls{};
112 const ModelAnimation* clip;
118 static void Ready(Character& character, Shader shader);
122 static void Dress(Character& character,
const figures::Figures& figures);
125 static void Unload(Character& character);
127 static Pose PoseFor(
const Character& character, protocol::Motion motion,
132 void PoseAs(
const Character& character,
const Figure& figure)
const;
135 static Matrix Placed(
const Character& character,
const Figure& figure);
138 static Matrix InHand(
const Character& character,
const Matrix& grip);
148 const Character& For(
const Figure& figure)
const;
150 figures::Figures figures_;
151 std::vector<Character> characters_;
152 std::map<uint32_t, Weapon> weapons_;
154 std::map<uint32_t, skills::Move> moves_;
void Learn(uint32_t skill, const skills::Look &look)
Keeps the skill's move, for the players who use it.
std::optional< Gait > GaitOf(const Figure &figure) const
Where the figure is in its walk or run: none, if it's doing neither.
void DrawGhost(const Figure &figure, Color color) const
void Wear(uint32_t id, const items::Look &look)
Characters(const Characters &)=delete
std::optional< std::pair< Vector3, Vector3 > > Blade(const Figure &figure) const
Characters & operator=(const Characters &)=delete
void Hold(uint32_t id, const items::Look &look, Shader shader)
Characters(Database &database)
void Draw(const Figure &figure, Color color, const Outline *outline) const
std::string ContentFolder()
std::string WeaponsFolder()
std::string MonstersFolder()
std::array< int, kJointBones.size()> Joints
Where a model's bones are, by joint, or -1 for one it doesn't have.