summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicleClass.h
blob: b902367967ab9b3a5be2795171c8ad0c86d404ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef RAILVEHICLECLASS_H
#define RAILVEHICLECLASS_H

#include "gfx/models/mesh.h"
#include <array>
#include <memory>
#include <string>

class Shader;
class Texture;
class ObjParser;
class Location;

class RailVehicleClass {
public:
	explicit RailVehicleClass(const std::string & name);

	void render(const Shader &, const Location &, const std::array<Location, 2> &) const;

	std::array<MeshPtr, 2> bogies;
	MeshPtr bodyMesh;
	std::shared_ptr<Texture> texture;
	float wheelBase;
	float length;

private:
	RailVehicleClass(std::unique_ptr<ObjParser> obj, std::shared_ptr<Texture>);
	static float bogieOffset(ObjParser & o);
	static float objectLength(ObjParser & o);
};
using RailVehicleClassPtr = std::shared_ptr<RailVehicleClass>;

#endif