Пример #1
0
//! Adds a standard data block (type: group node) to the chain of all data blocks.
//! Returns the total # of data blocks in the data block chain.
size_t U3DFileWriter::addStandardBlock_GroupNode(const std::string& groupNodeName, const std::string& parentNodeName)
{
    U3DDataBlockWriter GroupNodeBlock;
    GroupNodeBlock.blockType = mlU3D::BLOCKTYPE_GROUPNODE;

    GroupNodeBlock.writeString(groupNodeName);              // Write Group Node Name (9.5.1.1)
    _writeParentNodeData(GroupNodeBlock, parentNodeName);   // Write Parent Node Data (9.5.1.2) (Parent Node Name = empty --> = world)

    return addDataBlock(GroupNodeBlock);
}
Пример #2
0
//! Adds a standard data block (type: light node) to the chain of all data blocks.
//! Returns the total # of data blocks in the data block chain.
size_t U3DFileWriter::addStandardBlock_LightNode(const std::string& lightNodeName, const std::string& lightResourceName)
{
    U3DDataBlockWriter LightNodeBlock;
    LightNodeBlock.blockType = mlU3D::BLOCKTYPE_LIGHTNODE;

    LightNodeBlock.writeString(lightNodeName);      // Write Light Node Name (9.5.3.1)
    _writeParentNodeData(LightNodeBlock, "");       // Write Parent Node Data (9.5.3.2) (Parent Node Name = empty --> = world)
    LightNodeBlock.writeString(lightResourceName);  // Write Light Resource Name (9.5.3.1) (Same as Light Node Name)

    return addDataBlock(LightNodeBlock);
}
Пример #3
0
//! Adds a standard data block (type: model node) to the chain of all data blocks.
//! Returns the total # of data blocks in the data block chain.
size_t U3DFileWriter::addStandardBlock_ModelNode(const mlU3D::ModelNode& modelNode)
{
    U3DDataBlockWriter ModelNodeBlock;
    ModelNodeBlock.blockType = mlU3D::BLOCKTYPE_MODELNODE;
    std::string parentName = mlU3D::U3DTools::getParentNameFromGroupPath(modelNode.groupPath);

    ModelNodeBlock.writeString(modelNode.internalName);            // Write Model Node Name (9.5.2.1)

    _writeParentNodeData(ModelNodeBlock, parentName);              // Write Parent Node Data (9.5.2.2)

    ModelNodeBlock.writeString(modelNode.geometryGeneratorName);   // Write Model Resource Name (9.5.2.3)
    ModelNodeBlock.writeU32(modelNode.visibility);                 // Write Model Visibility (9.5.2.4);

    return addDataBlock(ModelNodeBlock);
}
Пример #4
0
//! Adds a standard data block (type: model node) to the chain of all data blocks.
//! Returns the total # of data blocks in the data block chain.
size_t U3DFileWriter::addStandardBlock_ModelNode(const U3DObjectInfoStruct& objectInfo)
{
  U3DDataBlockWriter ModelNodeBlock;
  ModelNodeBlock.blockType = U3D_BLOCKTYPE_MODELNODE;
  std::string parentName = getParentNameFromGroupPath(objectInfo.GroupPath);

  //ModelNodeBlock.writeString(objectInfo.DisplayName);        // Write Model Node Name (9.5.2.1) - Unfortunately, the model node name must be unique... :-(
  ModelNodeBlock.writeString(objectInfo.InternalName);       // Write Model Node Name (9.5.2.1)

  _writeParentNodeData(ModelNodeBlock, parentName);          // Write Parent Node Data (9.5.2.2)

  ModelNodeBlock.writeString(objectInfo.ResourceName);       // Write Model Resource Name (9.5.2.3) 
  ModelNodeBlock.writeU32(objectInfo.Visibility);            // Write Model Visibility (9.5.2.4);

  return addDataBlock(ModelNodeBlock);
}
Пример #5
0
//! Adds a standard data block (type: view node) to the chain of all data blocks.
//! Returns the total # of data blocks in the data block chain.
size_t U3DFileWriter::addStandardBlock_ViewNode(const std::string& viewNodeName, const std::string& viewResourceName)
{
    U3DDataBlockWriter ViewNodeBlock;
    ViewNodeBlock.blockType = mlU3D::BLOCKTYPE_VIEWNODE;

    ViewNodeBlock.writeString(viewNodeName);                   // Write View Node Name (9.5.4.1)
    _writeParentNodeData(ViewNodeBlock, "");                   // Write Parent Node Data (9.5.4.2) (Parent Node Name = empty --> = world)
    ViewNodeBlock.writeString(viewResourceName);               // Write View Resource Name (9.5.4.3) (Same as View Node Name) [UNUSED BY ACROBAT]
    ViewNodeBlock.writeU32(mlU3D::VIEWNODEATTRIBUTE_DEFAULT);  // Write View Node Attributes (9.5.4.4)
    ViewNodeBlock.writeF32(0.0f);                              // Write View Near Clip (9.5.4.5.1)
    ViewNodeBlock.writeF32(0.0f);                              // Write View Far Clip (9.5.4.5.2)
    ViewNodeBlock.writeF32(0.0f);                              // Write View Projection (9.5.4.6.1)
    //ViewNodeBlock.writeF32(0.0f);                            // Write View Orthographic Height (9.5.4.6.2) (only for orthographic projection) [UNUSED BY ACROBAT]
    ViewNodeBlock.writeF32(100.0f);                            // Write View Port Width (9.5.4.7.1)
    ViewNodeBlock.writeF32(100.0f);                            // Write View Port Height (9.5.4.7.2)
    ViewNodeBlock.writeF32(50.0f);                             // Write View Port Horizontal Position (9.5.4.7.3)
    ViewNodeBlock.writeF32(50.0f);                             // Write View Port Vertical Position (9.5.4.7.4)
    ViewNodeBlock.writeU32(0x00000000);                        // Write Backdrop Count (9.5.4.8) [UNUSED BY ACROBAT]
    ViewNodeBlock.writeU32(0x00000000);                        // Write Overlay Count (9.5.4.10) [UNUSED BY ACROBAT]

    return addDataBlock(ViewNodeBlock);
}