OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
pfxemittermesh.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5#include <zenkit/ModelMesh.hh>
6
7#include <Tempest/Point>
8
9class PackedMesh;
10class Pose;
11
13 public:
14 PfxEmitterMesh(const PackedMesh& src);
15 PfxEmitterMesh(const zenkit::ModelMesh& src);
16
17 Tempest::Vec3 randCoord(float rnd, const Pose* pose) const;
18
19 private:
20 struct Triangle {
21 uint32_t id[3] = {};
22 float sz = 0;
23 float prefix = 0;
24 };
25
26 struct AnimData {
27 Tempest::Vec3 v[4];
28 uint8_t id[4] = {};
29 float weights[4] = {};
30 };
31
32 Tempest::Vec3 randCoord(const Triangle& t, float rnd, const Pose* pose) const;
33 Tempest::Vec3 animCoord(const Pose& pose, uint32_t index) const;
34 void mkIndex();
35
36 static float area(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3);
37
38 std::vector<Triangle> triangle;
39 std::vector<Tempest::Vec3> vertices;
40 std::vector<AnimData> vertAnim;
41 };
42
Tempest::Vec3 randCoord(float rnd, const Pose *pose) const
Definition pose.h:16