Merge branch 'master' of https://github.com/DigitalPulseSoftware/NazaraEngine
This commit is contained in:
commit
d1a969288f
|
|
@ -159,6 +159,36 @@ namespace Nz
|
||||||
return LuaImplQueryArg(instance, index, arg, defValue, TypeTag<T>());
|
return LuaImplQueryArg(instance, index, arg, defValue, TypeTag<T>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
unsigned int LuaImplQueryArg(const LuaState& instance, int index, std::vector<T>* container, TypeTag<std::vector<T>>)
|
||||||
|
{
|
||||||
|
instance.CheckType(index, Nz::LuaType_Table);
|
||||||
|
std::size_t index = 1;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
instance.PushInteger(index++);
|
||||||
|
|
||||||
|
if (instance.GetTable() == Nz::LuaType_Nil)
|
||||||
|
{
|
||||||
|
instance.Pop();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
T arg {};
|
||||||
|
|
||||||
|
if (LuaImplQueryArg(instance, -1, &arg, TypeTag<T>()) != 1)
|
||||||
|
{
|
||||||
|
instance.Error("Type needs more than one place to be initialized");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
container->push_back(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Function returns
|
// Function returns
|
||||||
inline int LuaImplReplyVal(const LuaState& instance, bool val, TypeTag<bool>)
|
inline int LuaImplReplyVal(const LuaState& instance, bool val, TypeTag<bool>)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Nz
|
||||||
static void DrawCone(const Vector3f& origin, const Quaternionf& rotation, float angle, float length);
|
static void DrawCone(const Vector3f& origin, const Quaternionf& rotation, float angle, float length);
|
||||||
static void DrawLine(const Vector3f& p1, const Vector3f& p2);
|
static void DrawLine(const Vector3f& p1, const Vector3f& p2);
|
||||||
static void DrawPoints(const Vector3f* ptr, unsigned int pointCount);
|
static void DrawPoints(const Vector3f* ptr, unsigned int pointCount);
|
||||||
static void DrawNormals(const StaticMesh* subMesh);
|
static void DrawNormals(const StaticMesh* subMesh, float normalLength = 0.01f);
|
||||||
static void DrawTangents(const StaticMesh* subMesh);
|
static void DrawTangents(const StaticMesh* subMesh);
|
||||||
|
|
||||||
static void EnableDepthBuffer(bool depthBuffer);
|
static void EnableDepthBuffer(bool depthBuffer);
|
||||||
|
|
|
||||||
|
|
@ -556,7 +556,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugDrawer::DrawNormals(const StaticMesh* subMesh)
|
void DebugDrawer::DrawNormals(const StaticMesh* subMesh, float normalLength)
|
||||||
{
|
{
|
||||||
if (!s_initialized && !Initialize())
|
if (!s_initialized && !Initialize())
|
||||||
{
|
{
|
||||||
|
|
@ -583,7 +583,7 @@ namespace Nz
|
||||||
outputVertex->position = inputVertex->position;
|
outputVertex->position = inputVertex->position;
|
||||||
outputVertex++;
|
outputVertex++;
|
||||||
|
|
||||||
outputVertex->position = inputVertex->position + inputVertex->normal*0.01f;
|
outputVertex->position = inputVertex->position + inputVertex->normal*normalLength;
|
||||||
outputVertex++;
|
outputVertex++;
|
||||||
|
|
||||||
inputVertex++;
|
inputVertex++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue