Commit 23563640 authored by Max Lyon's avatar Max Lyon

add methods to export the check if positions or normals are double and get them as doubles

parent c92a6666
......@@ -289,7 +289,7 @@ namespace OMFormat {
inline size_t chunk_header_size( void ) { return sizeof(uint16); }
/// Return the size of a scale in bytes.
/// Return the size of a scaler in bytes.
inline size_t scalar_size( const Chunk::Header& _hdr )
{
return _hdr.float_ ? (0x01 << _hdr.bits_) : (0x04 << _hdr.bits_);
......
......@@ -90,11 +90,15 @@ public:
// get vertex data
virtual Vec3f point(VertexHandle _vh) const = 0;
virtual Vec3d pointd(VertexHandle _vh) const = 0;
virtual bool is_point_double() const = 0;
virtual Vec3f normal(VertexHandle _vh) const = 0;
virtual Vec3d normald(VertexHandle _vh) const = 0;
virtual bool is_normal_double() const = 0;
virtual Vec3uc color(VertexHandle _vh) const = 0;
virtual Vec4uc colorA(VertexHandle _vh) const = 0;
virtual Vec3ui colori(VertexHandle _vh) const = 0;
virtual Vec4ui colorAi(VertexHandle _vh) const = 0;
virtual Vec3ui colori(VertexHandle _vh) const = 0;
virtual Vec4ui colorAi(VertexHandle _vh) const = 0;
virtual Vec3f colorf(VertexHandle _vh) const = 0;
virtual Vec4f colorAf(VertexHandle _vh) const = 0;
virtual Vec2f texcoord(VertexHandle _vh) const = 0;
......
......@@ -94,11 +94,33 @@ public:
return vector_cast<Vec3f>(mesh_.point(_vh));
}
Vec3d pointd(VertexHandle _vh) const override
{
return vector_cast<Vec3d>(mesh_.point(_vh));
}
bool is_point_double() const override
{
return OMFormat::is_double(typename Mesh::Point()[0]);
}
bool is_normal_double() const override
{
return OMFormat::is_double(typename Mesh::Normal()[0]);
}
Vec3f normal(VertexHandle _vh) const override
{
return (mesh_.has_vertex_normals()
? vector_cast<Vec3f>(mesh_.normal(_vh))
: Vec3f(0.0f, 0.0f, 0.0f));
? vector_cast<Vec3f>(mesh_.normal(_vh))
: Vec3f(0.0f, 0.0f, 0.0f));
}
Vec3d normald(VertexHandle _vh) const override
{
return (mesh_.has_vertex_normals()
? vector_cast<Vec3d>(mesh_.normal(_vh))
: Vec3d(0.0f, 0.0f, 0.0f));
}
Vec3uc color(VertexHandle _vh) const override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment