resonance 1.0.1
Loading...
Searching...
No Matches
lodmesh.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "rnd/collideable.h"
6#include "rnd/raytest.h"
7
8class HxStr;
9
10namespace Rnd {
11
12class Mesh;
13
29class LodMesh : public std::vector<Mesh *> {
30public:
39 }
40
50
68 void Build(const HxStr &name, int nCount, bool bInternal);
69
77 void SetTransOwner(Mesh *pOwner);
78
90 void CopyScreenSizes(const LodMesh &source);
91
103 void SetScreenSizes(const std::vector<float> &screenSizes);
104
114 void ShareFaces(const LodMesh &templates);
115
124 void Sync();
125
134 void FindCollisions(const Segment &ray, std::list<Collideable::Collision> &collisions);
135
146 void SetVertexCount(unsigned nCount);
147
159 void Draw(float flScreenSize);
160};
161
162} // namespace Rnd
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Chain of generated meshes, one per level of detail, that deletes its meshes with itself.
Definition lodmesh.h:29
void DeleteMeshes()
Delete every mesh through its virtual destructor and empty the chain.
void Build(const HxStr &name, int nCount, bool bInternal)
Replace the chain with nCount newly created meshes.
void ShareFaces(const LodMesh &templates)
Point each level at the triangles of the same level of another chain, then Sync() it.
void SetVertexCount(unsigned nCount)
Resize the vertices of the finest level, which every level draws.
~LodMesh()
Delete every mesh of the chain.
Definition lodmesh.h:37
void CopyScreenSizes(const LodMesh &source)
Copy the screen size threshold of each level from another chain.
void Sync()
Call Mesh::Sync() on every level.
void SetTransOwner(Mesh *pOwner)
Point the transform owner of every mesh at one mesh.
void FindCollisions(const Segment &ray, std::list< Collideable::Collision > &collisions)
Test a ray against every level of the chain.
void SetScreenSizes(const std::vector< float > &screenSizes)
Give each level the screen size threshold of the same index.
void Draw(float flScreenSize)
Draw the level of detail a screen size selects.
Indexed triangle mesh with one material.
Definition mesh.h:46
The rendering engine.
Definition animhelper.h:3
Line segment a collision query is run along.
Definition collideable.h:22