mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- fixed parsing of 2D vectors in OBJ model loader
There is no `TVector2<>` constructor that accepts a pointer to float. However, there is such constructor in `TVector3<>`, so `TVector2<>` can be constructed from `float*` implicitly via temporary `TVector3<>` object.
This commit is contained in:
parent
e8f007c6ce
commit
ff784fc905
1 changed files with 3 additions and 4 deletions
|
@ -240,13 +240,12 @@ bool FOBJModel::Load(const char* fn, int lumpnum, const char* buffer, int length
|
|||
*/
|
||||
template<typename T, size_t L> void FOBJModel::ParseVector(TArray<T> &array)
|
||||
{
|
||||
float coord[L];
|
||||
for (size_t axis = 0; axis < L; axis++)
|
||||
T vec;
|
||||
for (unsigned axis = 0; axis < L; axis++)
|
||||
{
|
||||
sc.MustGetFloat();
|
||||
coord[axis] = (float)sc.Float;
|
||||
vec[axis] = (float)sc.Float;
|
||||
}
|
||||
T vec(coord);
|
||||
array.Push(vec);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue