mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
+ Got rid of zip lib requirement in G3D...
Still can re-enable code by defining _HAVE_ZIP...
+ Remove silly X11 lib dependency from G3D
Code doesn't seem to do anything yet anyway, and even if, we don't want it :p
+ Fix another weird G3D build problem...
+ Remove some __asm usage in g3d, which is not available on Win64
My editor also decided to remove a ton of trailing white spaces...tss...
+ Reapply G3D fixes for 64bit VC
+ not use SSE specific header when SSE not enabled in *nix
+ Updated project files
+ New vmap_assembler VC90/VC80 Project
+ vmap assembler binaries updates
NOTE: Old vmap fikes expected work (as tests show) with new library version.
But better use new generated versions. Its different in small parts to bad or good...
(based on Lynx3d's repo commit 44798d3)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
82 lines
2.4 KiB
C++
82 lines
2.4 KiB
C++
#ifndef G3D_Welder_h
|
|
#define G3D_Welder_h
|
|
|
|
#include "G3D/platform.h"
|
|
#include "G3D/Array.h"
|
|
#include "G3D/Vector3.h"
|
|
#include "G3D/Vector2.h"
|
|
|
|
namespace G3D {
|
|
|
|
class Any;
|
|
|
|
class Welder {
|
|
private:
|
|
|
|
Welder() {}
|
|
|
|
public:
|
|
|
|
class Settings {
|
|
public:
|
|
/** Surfaces with normals that are within this angle of each
|
|
other are considered to be curved. Default value is toRadians(70.0f).*/
|
|
float normalSmoothingAngle;
|
|
float vertexWeldRadius;
|
|
float textureWeldRadius;
|
|
float normalWeldRadius;
|
|
|
|
inline Settings(float normalSmoothAngle = toRadians(70.0f)) :
|
|
normalSmoothingAngle(normalSmoothAngle),
|
|
vertexWeldRadius(0.0001f),
|
|
textureWeldRadius(0.0001f),
|
|
normalWeldRadius(0.01f) {}
|
|
|
|
|
|
Settings(const Any& any);
|
|
operator Any() const;
|
|
};
|
|
|
|
/**
|
|
Mutates geometry, texCoord, and indexArray so that the output has collocated vertices collapsed (welded).
|
|
|
|
@param vertices Input and output
|
|
@param textureCoords Input and output
|
|
@param normals Output only
|
|
@param indices Input and output. This is an array of trilist indices.
|
|
@param oldToNewIndex Output argument
|
|
@param normalSmoothingAngle Varies from 0 (flat shading) to toRadians(180) for extremely smooth shading. Default is toRadians(70)
|
|
*/
|
|
static void weld(
|
|
Array<Vector3>& vertices,
|
|
Array<Vector2>& textureCoords,
|
|
Array<Vector3>& normals,
|
|
Array<Array<int>*>& indices,
|
|
const Settings& settings);
|
|
|
|
/**
|
|
Mutates geometry, texCoord, and indexArray so that the output has collocated vertices collapsed (welded).
|
|
|
|
@param vertices Input and output
|
|
@param textureCoords Input and output
|
|
@param normals Output only
|
|
@param indices Input and output. This is an array of trilist indices.
|
|
@param oldToNewIndex Output argument
|
|
@param normalSmoothingAngle Varies from 0 (flat shading) to toRadians(180) for extremely smooth shading. Default is toRadians(70)
|
|
*/
|
|
inline static void weld(
|
|
Array<Vector3>& vertices,
|
|
Array<Vector2>& textureCoords,
|
|
Array<Vector3>& normals,
|
|
Array<int>& indices,
|
|
const Settings& settings) {
|
|
|
|
Array<Array<int>*> meta;
|
|
meta.append(&indices);
|
|
weld(vertices, textureCoords, normals, meta, settings);
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|