Remove Vector3 Constructor (#494)
- Packing was enabled because the compiler may add padding which we don't want. - Constructors were removed because they were either rather primitive or broken (the `pRawFloats` one). - Use of constructor was replaced with a simple cast, which works just as well.
This commit is contained in:
parent
cf8b267d31
commit
ddb4670354
|
@ -13,13 +13,6 @@ union Vector3
|
|||
|
||||
float raw[3];
|
||||
|
||||
Vector3() : x(0), y(0), z(0) {}
|
||||
Vector3(float x, float y, float z) : x(x), y(y), z(z) {}
|
||||
Vector3(float* pRawFloats) // assumes float[3] => vector
|
||||
{
|
||||
memcpy(raw, pRawFloats, sizeof(this));
|
||||
}
|
||||
|
||||
void MakeValid()
|
||||
{
|
||||
for (auto& fl : raw)
|
||||
|
|
|
@ -765,8 +765,8 @@ std::string DataTableToString(Datatable* datatable)
|
|||
|
||||
case DatatableType::VECTOR:
|
||||
{
|
||||
Vector3 pVector((float*)pUntypedVal);
|
||||
sCSVString += fmt::format("<{},{},{}>", pVector.x, pVector.y, pVector.z);
|
||||
Vector3* pVector = (Vector3*)(pUntypedVal);
|
||||
sCSVString += fmt::format("<{},{},{}>", pVector->x, pVector->y, pVector->z);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue