Catch the template files up and add the improved convex editor bits.

This commit is contained in:
Areloch 2019-05-19 21:30:45 -05:00
parent 3697737498
commit ebb51bb178
18 changed files with 1617 additions and 333 deletions

View file

@ -131,9 +131,46 @@ public:
S32 id;
};
struct surfaceMaterial
{
// The name of the Material we will use for rendering
String materialName;
// The actual Material instance
BaseMatInstance* materialInst;
surfaceMaterial()
{
materialName = "";
materialInst = NULL;
}
};
struct surfaceUV
{
S32 matID;
Point2F offset;
Point2F scale;
float zRot;
bool horzFlip;
bool vertFlip;
surfaceUV() : matID(0), offset(Point2F(0.0f, 0.0f)), scale(Point2F(1.0f, 1.0f)), zRot(0.0f), horzFlip(false), vertFlip(false) {}
};
struct surfaceBuffers
{
// The GFX vertex and primitive buffers
GFXVertexBufferHandle< VertexType > mVertexBuffer;
GFXPrimitiveBufferHandle mPrimitiveBuffer;
U32 mVertCount;
U32 mPrimCount;
};
struct Geometry
{
void generate( const Vector< PlaneF > &planes, const Vector< Point3F > &tangents );
void generate(const Vector< PlaneF > &planes, const Vector< Point3F > &tangents, const Vector< surfaceMaterial > surfaceTextures, const Vector< Point2F > texOffset, const Vector< Point2F > texScale, const Vector< bool > horzFlip, const Vector< bool > vertFlip);
Vector< Point3F > points;
Vector< Face > faces;
@ -215,6 +252,9 @@ protected:
static S32 QSORT_CALLBACK _comparePlaneDist( const void *a, const void *b );
static bool protectedSetSurface( void *object, const char *index, const char *data );
static bool protectedSetSurfaceTexture( void *object, const char *index, const char *data );
static bool protectedSetSurfaceUV(void *object, const char *index, const char *data);
protected:
@ -225,11 +265,11 @@ protected:
BaseMatInstance* mMaterialInst;
// The GFX vertex and primitive buffers
GFXVertexBufferHandle< VertexType > mVertexBuffer;
/*GFXVertexBufferHandle< VertexType > mVertexBuffer;
GFXPrimitiveBufferHandle mPrimitiveBuffer;
U32 mVertCount;
U32 mPrimCount;
U32 mPrimCount;*/
Geometry mGeometry;
@ -239,6 +279,11 @@ protected:
Vector< Point3F > mFaceCenters;
//this is mostly for storage purposes, so we can save the texture mods
Vector< surfaceMaterial > mSurfaceTextures;
Vector< surfaceUV > mSurfaceUVs;
Vector< surfaceBuffers > mSurfaceBuffers;
Convex *mConvexList;
PhysicsBody *mPhysicsRep;