Move math namespace to fix #746.
This commit is contained in:
@@ -28,13 +28,13 @@
|
||||
#include "IcoSphere.h"
|
||||
|
||||
using namespace filament;
|
||||
using namespace math;
|
||||
using namespace filament::math;
|
||||
using namespace utils;
|
||||
|
||||
|
||||
struct Geometry {
|
||||
IcoSphere sphere = IcoSphere{ 2 };
|
||||
std::vector<math::short4> tangents;
|
||||
std::vector<filament::math::short4> tangents;
|
||||
filament::VertexBuffer* vertexBuffer = nullptr;
|
||||
filament::IndexBuffer* indexBuffer = nullptr;
|
||||
};
|
||||
@@ -62,7 +62,7 @@ Sphere::Sphere(Engine& engine, Material const* material, bool culling)
|
||||
.quatType = VertexBuffer::SHORT4,
|
||||
.quatCount = vertices.size(),
|
||||
.outBuffer = geometry->tangents.data(),
|
||||
.outStride = sizeof(math::short4),
|
||||
.outStride = sizeof(filament::math::short4),
|
||||
.normals = vertices.data()
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ Sphere::Sphere(Engine& engine, Material const* material, bool culling)
|
||||
VertexBuffer::BufferDescriptor(vertices.data(), vertices.size() * sizeof(float3)));
|
||||
|
||||
geometry->vertexBuffer->setBufferAt(engine, 1,
|
||||
VertexBuffer::BufferDescriptor(geometry->tangents.data(), geometry->tangents.size() * sizeof(math::short4)));
|
||||
VertexBuffer::BufferDescriptor(geometry->tangents.data(), geometry->tangents.size() * sizeof(filament::math::short4)));
|
||||
|
||||
|
||||
geometry->indexBuffer = IndexBuffer::Builder()
|
||||
@@ -113,7 +113,7 @@ Sphere::~Sphere() {
|
||||
em.destroy(mRenderable);
|
||||
}
|
||||
|
||||
Sphere& Sphere::setPosition(math::float3 const& position) noexcept {
|
||||
Sphere& Sphere::setPosition(filament::math::float3 const& position) noexcept {
|
||||
auto& tcm = mEngine.getTransformManager();
|
||||
auto ci = tcm.getInstance(mRenderable);
|
||||
mat4f model = tcm.getTransform(ci);
|
||||
|
||||
Reference in New Issue
Block a user