|
@@ -190,23 +190,25 @@ template <class T> Vector3 Frustum_GetVertex(unsigned index, T* ptr)
|
|
|
// ========================================================================================
|
|
// ========================================================================================
|
|
|
|
|
|
|
|
// Vector<Vector<Vector3>> Polyhedron::faces_ | File: ../Math/Polyhedron.h
|
|
// Vector<Vector<Vector3>> Polyhedron::faces_ | File: ../Math/Polyhedron.h
|
|
|
-template <class T> unsigned Polyhedron_GetNumFaces(T* ptr)
|
|
|
|
|
|
|
+template <class T> i32 Polyhedron_GetNumFaces(T* ptr)
|
|
|
{
|
|
{
|
|
|
return ptr->faces_.Size();
|
|
return ptr->faces_.Size();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Vector<Vector<Vector3>> Polyhedron::faces_ | File: ../Math/Polyhedron.h
|
|
// Vector<Vector<Vector3>> Polyhedron::faces_ | File: ../Math/Polyhedron.h
|
|
|
-template <class T> CScriptArray* Polyhedron_GetFace(unsigned index, T* ptr)
|
|
|
|
|
|
|
+template <class T> CScriptArray* Polyhedron_GetFace(i32 index, T* ptr)
|
|
|
{
|
|
{
|
|
|
Vector<Vector3> face;
|
|
Vector<Vector3> face;
|
|
|
- if (index < ptr->faces_.Size())
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (index >= 0 && index < ptr->faces_.Size())
|
|
|
face = ptr->faces_[index];
|
|
face = ptr->faces_[index];
|
|
|
|
|
+
|
|
|
return VectorToArray<Vector3>(face, "Array<Vector3>");
|
|
return VectorToArray<Vector3>(face, "Array<Vector3>");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#define REGISTER_MEMBERS_MANUAL_PART_Polyhedron() \
|
|
#define REGISTER_MEMBERS_MANUAL_PART_Polyhedron() \
|
|
|
/* Vector<Vector<Vector3>> Polyhedron::faces_ | File: ../Math/Polyhedron.h */ \
|
|
/* Vector<Vector<Vector3>> Polyhedron::faces_ | File: ../Math/Polyhedron.h */ \
|
|
|
- engine->RegisterObjectMethod(className, "uint get_numFaces() const", AS_FUNCTION_OBJLAST(Polyhedron_GetNumFaces<T>), AS_CALL_CDECL_OBJLAST); \
|
|
|
|
|
- engine->RegisterObjectMethod(className, "Array<Vector3>@ get_face(uint) const", AS_FUNCTION_OBJLAST(Polyhedron_GetFace<T>), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
|
|
+ engine->RegisterObjectMethod(className, "int get_numFaces() const", AS_FUNCTION_OBJLAST(Polyhedron_GetNumFaces<T>), AS_CALL_CDECL_OBJLAST); \
|
|
|
|
|
+ engine->RegisterObjectMethod(className, "Array<Vector3>@ get_face(int) const", AS_FUNCTION_OBJLAST(Polyhedron_GetFace<T>), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
|
|
|
}
|
|
}
|