scenepic 1.1.0
3D Visualization Made Easy
Public Member Functions | Static Public Attributes | Friends | List of all members
scenepic::MeshUpdate Class Reference

Class which represents an update to an existing mesh in which only the vertex buffer is changed. More...

#include <mesh_update.h>

Public Member Functions

const std::string & base_mesh_id () const
 The unique identifier of the original base mesh. More...
 
const std::string & mesh_id () const
 The unique identifier of the newly updated mesh. More...
 
VertexBufferRef vertex_buffer ()
 The updated vertex buffer. More...
 
std::string to_string () const
 Return a JSON string representing the object. More...
 
JsonValue to_json () const
 Convert this object into ScenePic json. More...
 
std::uint32_t frame_index () const
 The unique index of the frame or the index of its keyframe (if quantized). More...
 
bool is_quantized () const
 Whether this update is quantized. More...
 
void quantize (std::uint32_t keyframe_index, float fixed_point_range, const ConstVertexBufferRef &keyframe_vertex_buffer)
 Quantize the mesh update in reference to a keyframe. More...
 
VertexBuffer unquantize () const
 Unquantize the buffer (for testing purposes) More...
 
float difference_range (const ConstVertexBufferRef &vertex_buffer) const
 The range of differences between this frame and the current keyframe. More...
 

Static Public Attributes

static const std::size_t QuantizationBinCount
 The number of quantization bins. More...
 

Friends

class Scene
 

Detailed Description

Class which represents an update to an existing mesh in which only the vertex buffer is changed.

By only updating a mesh the ScenePic file can become smaller, due to only needing to store the vertex buffer instead of the full mesh topology.

Member Function Documentation

◆ base_mesh_id()

const std::string & scenepic::MeshUpdate::base_mesh_id ( ) const

The unique identifier of the original base mesh.

◆ difference_range()

float scenepic::MeshUpdate::difference_range ( const ConstVertexBufferRef &  vertex_buffer) const

The range of differences between this frame and the current keyframe.

Parameters
vertex_bufferthe keyframe vertex buffer
Returns
the range in difference values

◆ frame_index()

std::uint32_t scenepic::MeshUpdate::frame_index ( ) const

The unique index of the frame or the index of its keyframe (if quantized).

◆ is_quantized()

bool scenepic::MeshUpdate::is_quantized ( ) const

Whether this update is quantized.

◆ mesh_id()

const std::string & scenepic::MeshUpdate::mesh_id ( ) const

The unique identifier of the newly updated mesh.

◆ quantize()

void scenepic::MeshUpdate::quantize ( std::uint32_t  keyframe_index,
float  fixed_point_range,
const ConstVertexBufferRef &  keyframe_vertex_buffer 
)

Quantize the mesh update in reference to a keyframe.

Parameters
keyframe_indexthe index of the keyframe
fixed_point_rangethe range to use for the fixed point representation
keyframe_vertex_bufferthe keyframe vertex buffer

◆ to_json()

JsonValue scenepic::MeshUpdate::to_json ( ) const

Convert this object into ScenePic json.

Returns
a json value

◆ to_string()

std::string scenepic::MeshUpdate::to_string ( ) const

Return a JSON string representing the object.

◆ unquantize()

VertexBuffer scenepic::MeshUpdate::unquantize ( ) const

Unquantize the buffer (for testing purposes)

◆ vertex_buffer()

VertexBufferRef scenepic::MeshUpdate::vertex_buffer ( )

The updated vertex buffer.

Friends And Related Function Documentation

◆ Scene

friend class Scene
friend

Member Data Documentation

◆ QuantizationBinCount

const std::size_t scenepic::MeshUpdate::QuantizationBinCount
static
Initial value:
=
std::numeric_limits<FixedPointVertexBuffer::Scalar>::max()

The number of quantization bins.


The documentation for this class was generated from the following file: