Files
dorayme/source/include/objfile.h
Godzil c17bfadc76 Started working on parsing OBJ Files.
Why string manipulation is so tedious in C/++ :(
2020-03-05 17:46:40 +00:00

52 lines
925 B
C++

/*
* DoRayMe - a quick and dirty Raytracer
* OBJ File header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_OBJFILE_H
#define DORAYME_OBJFILE_H
#include <shape.h>
#include <renderstat.h>
class OBJFile : public Shape
{
private:
uint32_t allocatedFaceGroupCount;
Shape* *faceGroupList;
uint32_t faceGroupCount;
uint32_t allocatedVertexCount;
Tuple* *vertexList;
uint32_t vertexCount;
private:
Intersect localIntersect(Ray r);
Tuple localNormalAt(Tuple point);
public:
/* Some stats */
uint32_t ignoredLines;
protected:
void addGroup(Shape *group);
void addVertex(Tuple *vertex);
BoundingBox bounds;
public:
OBJFile();
OBJFile(const char *filepath);
int parseOBJFile(const char *content);
BoundingBox getLocalBounds();
bool haveFiniteBounds() { return true; };
};
#endif /* DORAYME_OBJFILE_H */