Expand EngineAPI type definitions

This commit is contained in:
Lukas Joergensen 2019-08-03 12:39:41 +02:00 committed by Lukas Aldershaab
parent f5f0eb2bb4
commit a241d27b58
13 changed files with 284 additions and 36 deletions

View file

@ -26,6 +26,8 @@
#include "math/mMatrix.h"
#include "console/console.h"
#include "console/enginePrimitives.h"
#include "console/engineTypes.h"
const MatrixF MatrixF::Identity( true );
@ -192,4 +194,10 @@ void MatrixF::dumpMatrix(const char *caption /* =NULL */) const
Con::printf("%s | %-8.4f %-8.4f %-8.4f %-8.4f |", spacerRef, m[idx(1,0)], m[idx(1, 1)], m[idx(1, 2)], m[idx(1, 3)]);
Con::printf("%s | %-8.4f %-8.4f %-8.4f %-8.4f |", spacerRef, m[idx(2,0)], m[idx(2, 1)], m[idx(2, 2)], m[idx(2, 3)]);
Con::printf("%s | %-8.4f %-8.4f %-8.4f %-8.4f |", spacerRef, m[idx(3,0)], m[idx(3, 1)], m[idx(3, 2)], m[idx(3, 3)]);
}
}
EngineFieldTable::Field MatrixFEngineExport::getMatrixField()
{
typedef MatrixF ThisType;
return _FIELD_AS(F32, m, m, 16, "");
}

View file

@ -35,12 +35,18 @@
#include "math/mPoint4.h"
#endif
#ifndef _ENGINETYPEINFO_H_
#include "console/engineTypeInfo.h"
#endif
/// 4x4 Matrix Class
///
/// This runs at F32 precision.
class MatrixF
{
friend class MatrixFEngineExport;
private:
F32 m[16]; ///< Note: Torque uses row-major matrices
@ -224,6 +230,12 @@ public:
const static MatrixF Identity;
};
class MatrixFEngineExport
{
public:
static EngineFieldTable::Field getMatrixField();
};
//--------------------------------------
// Inline Functions

View file

@ -88,30 +88,59 @@ END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( RectI,
RectI, MathTypes,
"" )
FIELD( point, point, 1, "The XY coordinate of the Rect." )
FIELD( extent, extent, 1, "The width and height of the Rect." )
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( RectF,
RectF, MathTypes,
"" )
FIELD( point, point, 1, "The XY coordinate of the Rect.")
FIELD( extent, extent, 1, "The width and height of the Rect.")
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( MatrixF,
MatrixF, MathTypes,
"" )
MatrixFEngineExport::getMatrixField(),
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( AngAxisF,
AngAxisF, MathTypes,
"" )
FIELD( axis, axis, 1, "")
FIELD( angle, angle, 1, "")
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( TransformF,
TransformF, MathTypes,
"" )
FIELD(mPosition, position, 1, "")
FIELD(mOrientation, orientation, 1, "")
FIELD(mHasRotation, hasRotation, 1, "")
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( Box3F,
Box3F, MathTypes,
"" )
FIELD(minExtents, minExtents, 1, "Minimum extents of box")
FIELD(maxExtents, maxExtents, 1, "Maximum extents of box")
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT( EaseF,
EaseF, MathTypes,
"" )
FIELD(mDir, dir, 1, "inout, in, out")
FIELD(mType, type, 1, "linear, etc...")
FIELD_AS(F32, mParam, type, 2, "optional params")
END_IMPLEMENT_STRUCT;
IMPLEMENT_STRUCT(RotationF,
RotationF, MathTypes,