Skip to content

Commit

Permalink
Changed ALL tabs to spaces in preparation for a merge
Browse files Browse the repository at this point in the history
Changed ALL line endings to LF (a few files were in CF/LF). This fixes screwup from commit 81746916438203c5dfc06177d8eb91e84d4f50f3 where all eols were changed to CF/LF
  • Loading branch information
darksylinc committed Feb 22, 2014
1 parent 306982b commit 83e497b
Show file tree
Hide file tree
Showing 1,690 changed files with 274,642 additions and 274,642 deletions.
50 changes: 25 additions & 25 deletions Components/MeshLodGenerator/include/OgreLodBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,42 @@ namespace Ogre
{
/// Thread-safe buffer for storing Hardware index buffer
struct _OgreLodExport LodIndexBuffer {
size_t indexSize; /// Index size: 2 or 4 byte/index is supported only.
size_t indexCount; /// index count from indexStart.
size_t indexStart; /// Offset from the start of the indexBuffer
size_t indexBufferSize; /// size of the index buffer in bytes
Ogre::SharedPtr<unsigned char> indexBuffer; /// if NULL, then the previous Lod level's buffer is used. (compression)
void fillBuffer(Ogre::IndexData* data); /// Fills the buffer from an Ogre::IndexData. Call this on Ogre main thread only
size_t indexSize; /// Index size: 2 or 4 byte/index is supported only.
size_t indexCount; /// index count from indexStart.
size_t indexStart; /// Offset from the start of the indexBuffer
size_t indexBufferSize; /// size of the index buffer in bytes
Ogre::SharedPtr<unsigned char> indexBuffer; /// if NULL, then the previous Lod level's buffer is used. (compression)
void fillBuffer(Ogre::IndexData* data); /// Fills the buffer from an Ogre::IndexData. Call this on Ogre main thread only
};
/// Thread-safe buffer for storing Hardware vertex buffer
struct _OgreLodExport LodVertexBuffer {
size_t vertexCount;
Ogre::SharedPtr<Vector3> vertexBuffer;
Ogre::SharedPtr<Vector3> vertexNormalBuffer;
void fillBuffer(Ogre::VertexData* data);
size_t vertexCount;
Ogre::SharedPtr<Vector3> vertexBuffer;
Ogre::SharedPtr<Vector3> vertexNormalBuffer;
void fillBuffer(Ogre::VertexData* data);
};
/// Data representing all required information from a Mesh. Used by LodInputProviderBuffer.
struct _OgreLodExport LodInputBuffer
{
struct _OgreLodExport Submesh {
LodIndexBuffer indexBuffer;
LodVertexBuffer vertexBuffer;
bool useSharedVertexBuffer;
};
vector<Submesh>::type submesh;
LodVertexBuffer sharedVertexBuffer;
String meshName;
Real boundingSphereRadius;
void fillBuffer(Ogre::MeshPtr mesh);
struct _OgreLodExport Submesh {
LodIndexBuffer indexBuffer;
LodVertexBuffer vertexBuffer;
bool useSharedVertexBuffer;
};
vector<Submesh>::type submesh;
LodVertexBuffer sharedVertexBuffer;
String meshName;
Real boundingSphereRadius;
void fillBuffer(Ogre::MeshPtr mesh);
};
/// Data representing the output of the Mesh reduction. Used by LodOutputProviderBuffer.
struct _OgreLodExport LodOutputBuffer {

struct _OgreLodExport Submesh {
vector<LodIndexBuffer>::type genIndexBuffers;
};
/// Contains every generated indexBuffer from every submesh. submeshCount*lodLevelCount buffers.
vector<Submesh>::type submesh;
struct _OgreLodExport Submesh {
vector<LodIndexBuffer>::type genIndexBuffers;
};
/// Contains every generated indexBuffer from every submesh. submeshCount*lodLevelCount buffers.
vector<Submesh>::type submesh;
};
}
#endif
26 changes: 13 additions & 13 deletions Components/MeshLodGenerator/include/OgreLodCollapseCost.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ namespace Ogre

class _OgreLodExport LodCollapseCost {
public:
virtual ~LodCollapseCost() {}
/// This is called after the LodInputProvider has initialized LodData.
virtual void initCollapseCosts(LodData* data);
/// Called from initCollapseCosts for every edge.
virtual void initVertexCollapseCost(LodData* data, LodData::Vertex* vertex);
/// Called when edge cost gets invalid.
virtual void updateVertexCollapseCost(LodData* data, LodData::Vertex* vertex);
/// Called by initVertexCollapseCost and updateVertexCollapseCost, when the vertex minimal cost needs to be updated.
virtual void computeVertexCollapseCost(LodData* data, LodData::Vertex* vertex, Real& collapseCost, LodData::Vertex*& collapseTo);
/// Returns the collapse cost of the given edge.
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge) = 0;
virtual ~LodCollapseCost() {}
/// This is called after the LodInputProvider has initialized LodData.
virtual void initCollapseCosts(LodData* data);
/// Called from initCollapseCosts for every edge.
virtual void initVertexCollapseCost(LodData* data, LodData::Vertex* vertex);
/// Called when edge cost gets invalid.
virtual void updateVertexCollapseCost(LodData* data, LodData::Vertex* vertex);
/// Called by initVertexCollapseCost and updateVertexCollapseCost, when the vertex minimal cost needs to be updated.
virtual void computeVertexCollapseCost(LodData* data, LodData::Vertex* vertex, Real& collapseCost, LodData::Vertex*& collapseTo);
/// Returns the collapse cost of the given edge.
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge) = 0;
protected:
// Helper functions:
bool isBorderVertex(const LodData::Vertex* vertex) const;
// Helper functions:
bool isBorderVertex(const LodData::Vertex* vertex) const;
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ namespace Ogre
{

class _OgreLodExport LodCollapseCostCurvature :
public LodCollapseCost
public LodCollapseCost
{
public:
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
};

}
Expand Down
20 changes: 10 additions & 10 deletions Components/MeshLodGenerator/include/OgreLodCollapseCostOutside.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ namespace Ogre
{

class _OgreLodExport LodCollapseCostOutside :
public LodCollapseCost
public LodCollapseCost
{
public:
LodCollapseCostOutside(LodCollapseCostPtr costCalculator, Real outsideWeight, Real outsideWalkAngle);
~LodCollapseCostOutside();
virtual void initCollapseCosts(LodData* data);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
LodCollapseCostOutside(LodCollapseCostPtr costCalculator, Real outsideWeight, Real outsideWalkAngle);
~LodCollapseCostOutside();
virtual void initCollapseCosts(LodData* data);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
protected:

Real mOutsideWeight;
Real mOutsideWalkAngle;
Real mOutsideWeight;
Real mOutsideWalkAngle;

// Result of this collapse cost algorithm will be modified, if it is outside.
LodCollapseCostPtr mCostCalculator;
LodOutsideMarker* mOutsideMarker;
// Result of this collapse cost algorithm will be modified, if it is outside.
LodCollapseCostPtr mCostCalculator;
LodOutsideMarker* mOutsideMarker;
};

}
Expand Down
34 changes: 17 additions & 17 deletions Components/MeshLodGenerator/include/OgreLodCollapseCostProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,32 @@ namespace Ogre
{

class _OgreLodExport LodCollapseCostProfiler :
public LodCollapseCost
public LodCollapseCost
{
public:
LodCollapseCostProfiler(LodProfile& profile, LodCollapseCostPtr& costCalculator) : mProfile(profile), mCostCalculator(costCalculator) {}
virtual void initCollapseCosts(LodData* data);
virtual void computeVertexCollapseCost(LodData* data, LodData::Vertex* vertex, Real& collapseCost, LodData::Vertex*& collapseTo);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
LodCollapseCostProfiler(LodProfile& profile, LodCollapseCostPtr& costCalculator) : mProfile(profile), mCostCalculator(costCalculator) {}
virtual void initCollapseCosts(LodData* data);
virtual void computeVertexCollapseCost(LodData* data, LodData::Vertex* vertex, Real& collapseCost, LodData::Vertex*& collapseTo);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
protected:

struct ProfiledEdge {
LodData::Vertex* dst;
Real cost;
};
struct ProfiledEdge {
LodData::Vertex* dst;
Real cost;
};

typedef vector<bool>::type HasVertexProfileList;
typedef vector<bool>::type HasVertexProfileList;

HasVertexProfileList mHasProfile;
HasVertexProfileList mHasProfile;

typedef HashMultiMap<LodData::Vertex*, ProfiledEdge> ProfileLookup;
ProfileLookup mProfileLookup;
LodProfile mProfile;
typedef HashMultiMap<LodData::Vertex*, ProfiledEdge> ProfileLookup;
ProfileLookup mProfileLookup;
LodProfile mProfile;

// If an edge doesn't have a profile, this collapsecost algorithm will be used.
LodCollapseCostPtr mCostCalculator;
// If an edge doesn't have a profile, this collapsecost algorithm will be used.
LodCollapseCostPtr mCostCalculator;

void injectProfile(LodData* data);
void injectProfile(LodData* data);
};

}
Expand Down
22 changes: 11 additions & 11 deletions Components/MeshLodGenerator/include/OgreLodCollapseCostQuadric.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ namespace Ogre
{

class _OgreLodExport LodCollapseCostQuadric :
public LodCollapseCost
public LodCollapseCost
{
public:
virtual void initCollapseCosts(LodData* data);
virtual void updateVertexCollapseCost(LodData* data, LodData::Vertex* vertex);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
virtual void initCollapseCosts(LodData* data);
virtual void updateVertexCollapseCost(LodData* data, LodData::Vertex* vertex);
virtual Real computeEdgeCollapseCost(LodData* data, LodData::Vertex* src, LodData::Edge* dstEdge);
protected:

struct TriangleQuadricPlane {
Matrix4 quadric;
};
vector<Matrix4>::type mTrianglePlaneQuadricList;
vector<Matrix4>::type mVertexQuadricList;
void computeTrianglePlaneQuadric(LodData* data, size_t triangleID);
void computeVertexQuadric(LodData* data, size_t vertexID);
struct TriangleQuadricPlane {
Matrix4 quadric;
};
vector<Matrix4>::type mTrianglePlaneQuadricList;
vector<Matrix4>::type mVertexQuadricList;
void computeTrianglePlaneQuadric(LodData* data, size_t triangleID);
void computeVertexQuadric(LodData* data, size_t vertexID);
};

}
Expand Down
86 changes: 43 additions & 43 deletions Components/MeshLodGenerator/include/OgreLodCollapser.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,55 +39,55 @@ namespace Ogre
class _OgreLodExport LodCollapser
{
public:
virtual ~LodCollapser() {}
/// Reduces vertices until vertexCountLimit or collapseCostLimit is reached.
virtual void collapse(LodData* data, LodCollapseCost* cost, LodOutputProvider* output, int vertexCountLimit, Real collapseCostLimit);
virtual ~LodCollapser() {}
/// Reduces vertices until vertexCountLimit or collapseCostLimit is reached.
virtual void collapse(LodData* data, LodCollapseCost* cost, LodOutputProvider* output, int vertexCountLimit, Real collapseCostLimit);

/**
* @brief Returns the last reduced vertex.
*
* You should call this function after generateLodLevels!
*
* @param data This parameter is not used, but this will guarantee that data is alive.
* @param outVec The vector receiving the position of the vertex.
* @return Whether the outVec was changed. If the mesh is reduced at least 1 vertex, then it returns true.
*/
bool _getLastVertexPos(LodData* data, Vector3& outVec);
/**
* @brief Returns the last reduced vertex.
*
* You should call this function after generateLodLevels!
*
* @param data This parameter is not used, but this will guarantee that data is alive.
* @param outVec The vector receiving the position of the vertex.
* @return Whether the outVec was changed. If the mesh is reduced at least 1 vertex, then it returns true.
*/
bool _getLastVertexPos(LodData* data, Vector3& outVec);

/**
* @brief Returns the destination of the edge, which was last reduced.
*
* You should call this function after generateLodLevels!
*
* @param data This parameter is not used, but this will guarantee that data is alive.
* @param outVec The vector receiving the CollapseTo position.
* @return Whether the outVec was changed. If the mesh is reduced at least 1 vertex, then it returns true.
*/
bool _getLastVertexCollapseTo(LodData* data, Vector3& outVec);
/**
* @brief Returns the destination of the edge, which was last reduced.
*
* You should call this function after generateLodLevels!
*
* @param data This parameter is not used, but this will guarantee that data is alive.
* @param outVec The vector receiving the CollapseTo position.
* @return Whether the outVec was changed. If the mesh is reduced at least 1 vertex, then it returns true.
*/
bool _getLastVertexCollapseTo(LodData* data, Vector3& outVec);
protected:
struct CollapsedEdge {
unsigned int srcID;
unsigned int dstID;
unsigned short submeshID;
};
typedef vector<CollapsedEdge>::type CollapsedEdges;
struct CollapsedEdge {
unsigned int srcID;
unsigned int dstID;
unsigned short submeshID;
};
typedef vector<CollapsedEdge>::type CollapsedEdges;

/// tmp variable, to overcome allocation on every collapse.
CollapsedEdges tmpCollapsedEdges;
/// tmp variable, to overcome allocation on every collapse.
CollapsedEdges tmpCollapsedEdges;

/// Last reduced vertex. Can be used for debugging purposes. For example the Mesh Lod Editor uses it to select edge.
LodData::Vertex* mLastReducedVertex;
/// Last reduced vertex. Can be used for debugging purposes. For example the Mesh Lod Editor uses it to select edge.
LodData::Vertex* mLastReducedVertex;

/// Collapses a single vertex.
void collapseVertex(LodData* data, LodCollapseCost* cost, LodOutputProvider* output, LodData::Vertex* src);
void assertOutdatedCollapseCost(LodData* data, LodCollapseCost* cost, LodData::Vertex* vertex);
void assertValidMesh(LodData* data);
void assertValidVertex(LodData* data, LodData::Vertex* v);
bool hasSrcID(unsigned int srcID, unsigned short submeshID);
void removeTriangleFromEdges(LodData::Triangle* triangle, LodData::Vertex* skip);
size_t findDstID(unsigned int srcID, unsigned short submeshID);
void replaceVertexID(LodData::Triangle* triangle, unsigned int oldID, unsigned int newID, LodData::Vertex* dst);
/// Collapses a single vertex.
void collapseVertex(LodData* data, LodCollapseCost* cost, LodOutputProvider* output, LodData::Vertex* src);
void assertOutdatedCollapseCost(LodData* data, LodCollapseCost* cost, LodData::Vertex* vertex);
void assertValidMesh(LodData* data);
void assertValidVertex(LodData* data, LodData::Vertex* v);
bool hasSrcID(unsigned int srcID, unsigned short submeshID);
void removeTriangleFromEdges(LodData::Triangle* triangle, LodData::Vertex* skip);
size_t findDstID(unsigned int srcID, unsigned short submeshID);
void replaceVertexID(LodData::Triangle* triangle, unsigned int oldID, unsigned int newID, LodData::Vertex* dst);
};

}
Expand Down
Loading

0 comments on commit 83e497b

Please sign in to comment.