Changed: Changed manual deep-copy of parameter vertex array to usage of memcpy()
This commit is contained in:
@@ -10,12 +10,12 @@
|
|||||||
|
|
||||||
#include "../include/models/bounding_box.hpp"
|
#include "../include/models/bounding_box.hpp"
|
||||||
#include "../include/utils/debug.hpp"
|
#include "../include/utils/debug.hpp"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
BoundingBox::BoundingBox(Vector3 *t_vertices)
|
BoundingBox::BoundingBox(Vector3 *t_vertices)
|
||||||
{
|
{
|
||||||
//Perform a deep copy of vertex array parameter
|
//Perform a deep copy of vertex array parameter
|
||||||
for (int i = 0; i < 8; i++)
|
memcpy(_vertices, t_vertices, 8 * sizeof(Vector3));
|
||||||
_vertices[i] = t_vertices[i];
|
|
||||||
|
|
||||||
//This might be shortened with Vector3 operator overloading, but current
|
//This might be shortened with Vector3 operator overloading, but current
|
||||||
//implementation is more human readable.
|
//implementation is more human readable.
|
||||||
|
|||||||
Reference in New Issue
Block a user