Metaverse Structured DataMetaverse Structured Data (MSD) is encoding scheme which uses Google Protocol Buffers implementation for encoding and decoding state and interaction payloads transmitted over MXP. Google Protocol Buffers .proto-files are IDL-files which are used by protogen application to create Encoding/Decoding classes. John Hurliman contributed the idea of using Google Protocol Buffers instead of XML based approach. Application Specific MSD Schemas
Common Data Types
// Metaverse Structured Data Types
message MsdVector3f {
required float X=1;
required float Y=2;
required float Z=3;
}
message MsdQuaternion4f {
required float X=1;
required float Y=2;
required float Z=3;
required float W=4;
}
message MsdColor4f {
required float R=1;
required float G=2;
required float B=3;
required float A=4;
}
MSD fragment types
ExamplesThis is an example of extending PerceptionEvent to carry terrain object data in compressed bitmap format:
// Terrain object extension for simple heightmap based terrains.
// Heightmap layer is scaled to fit the object are in X,Z-plane.
// Layer values are adressed in the array as follows:
// float floatValue=heightMap[x+y*width]
// Float array presenting height map is first encoded to short array as follows:
// short shortValue=(short)((floatValue-offset)*Scale)
// This is further compressed with deflate algorithm.
message OmBitmapTerrainExt {
required uint32 Width=1;
required uint32 Height=2;
required float Offset=3;
required float Scale=4;
required bytes HeightMap=5;
}
1665 Views |