56 const glm::mat4 &transform) {
89 stream.
seek(faceTypeOffset);
93 uint32 index = prevFaceCount;
95 for (
uint32 i = 0; i < faceCount; ++i) {
114 stream.
seek(faceOffset);
116 size_t prevIndexCount =
_indices.size();
117 uint32 indexCount = 3 * faceCount;
118 _indices.resize(prevIndexCount + indexCount);
119 uint32 index = prevIndexCount;
120 size_t prevVertexCount =
_vertices.size() / 3;
122 for (
uint32 i = 0; i < indexCount; ++i) {
127 static void multiply(
const float *v,
const glm::mat4 &m,
float *rv) {
128 rv[0] = v[0] * m[0][0] + v[1] * m[1][0] + v[2] * m[2][0] + m[3][0];
129 rv[1] = v[0] * m[0][1] + v[1] * m[1][1] + v[2] * m[2][1] + m[3][1];
130 rv[2] = v[0] * m[0][2] + v[1] * m[1][2] + v[2] * m[2][2] + m[3][2];
131 float w = v[0] * m[0][3] + v[1] * m[1][3] + v[2] * m[2][3] + m[3][3];
140 const glm::mat4 &transform) {
141 stream.
seek(vertexOffset);
143 size_t prevVerticesSize =
_vertices.size();
144 uint32 verticesSize = 3 * vertexCount;
145 _vertices.resize(prevVerticesSize + verticesSize);
146 uint32 index = prevVerticesSize;
148 for (
uint32 i = 0; i < vertexCount; ++i) {
#define ResMan
Shortcut for accessing the sound manager.
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
static void multiply(const float *v, const glm::mat4 &m, float *rv)
void appendFromStream(Common::SeekableReadStream &stream, const glm::mat4 &transform)
uint32 readUint32LE()
Read an unsigned 32-bit word stored in little endian (LSB first) order from the stream and return it...
A class holding an UTF-8 string.
std::vector< uint32 > _indices
virtual size_t seek(ptrdiff_t offset, Origin whence=kOriginBegin)=0
Sets the stream position indicator for the stream.
void appendIndices(Common::SeekableReadStream &stream, uint32 faceCount, uint32 faceOffset)
void appendFaceTypes(Common::SeekableReadStream &stream, uint32 faceCount, uint32 faceTypeOffset)
Exception that provides a stack of explanations.
A simple scoped smart pointer template.
void appendVertices(Common::SeekableReadStream &stream, uint32 vertexCount, uint32 vertexOffset, const glm::mat4 &transform)
std::vector< bool > _faceWalkableMap
const char * c_str() const
Return the (utf8 encoded) string data.
virtual size_t skip(ptrdiff_t offset)
Skip the specified number of bytes, adding that offset to the current position in the stream...
std::vector< float > _vertices
void warning(const char *s,...)
uint32 readUint32BE()
Read an unsigned 32-bit word stored in big endian (MSB first) order from the stream and return it...
void refreshIndexGroups()
FORCEINLINE float readIEEEFloatLE()
Read a 32-bit IEEE float stored in little endian (LSB first) order from the stream and return it...
FileType
Various file types used by the Aurora engine and found in archives.
const char * what() const
Interface for a seekable & readable data stream.
void load(const Common::UString &resRef, ::Aurora::FileType type=::Aurora::kFileTypeWOK, const glm::mat4 &transform=glm::mat4())
The global resource manager for Aurora resources.