本文整理汇总了C++中BinaryWriter::Push方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryWriter::Push方法的具体用法?C++ BinaryWriter::Push怎么用?C++ BinaryWriter::Push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryWriter
的用法示例。
在下文中一共展示了BinaryWriter::Push方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
bool Model_IO::Save(BinaryWriter& writer, const achar* path)
{
// ヘッダー
uint8_t header[] = "MDL";
for (int32_t i = 0; i < 4; i++)
{
writer.Push(header[i]);
}
// バージョン
writer.Push(0);
// ボーン
SaveDeformer(Deformer_, writer, path);
// メッシュ
SaveMeshes(Meshes, writer, path);
// アニメーション
writer.Push((int32_t)AnimationSources.size());
for (int32_t i = 0; i < AnimationSources.size(); i++)
{
SaveAnimationSource(AnimationSources[i], writer, path);
}
writer.Push((int32_t) AnimationClips.size());
for (int32_t i = 0; i <AnimationClips.size(); i++)
{
SaveAnimationClip(AnimationClips[i], writer, path);
}
return true;
}
示例2: SaveAnimationSource
void Model_IO::SaveAnimationSource(AnimationSource& as, BinaryWriter& writer, const achar* path)
{
writer.Push(as.Name);
writer.Push((int32_t) as.KeyframeAnimations.size());
for (int32_t i = 0; i < as.KeyframeAnimations.size(); i++)
{
SaveKeyframeAnimation(as.KeyframeAnimations[i], writer, path);
}
}
示例3: SaveDeformer
void Model_IO::SaveDeformer(Deformer& deformer, BinaryWriter& writer, const achar* path)
{
writer.Push((int32_t)deformer.Bones.size());
for (auto i = 0; i < deformer.Bones.size(); i++)
{
auto& bone = deformer.Bones[i];
writer.Push(deformer.Bones[i].Name);
writer.Push(deformer.Bones[i].ParentBoneIndex);
writer.Push((int32_t)deformer.Bones[i].RotationType);
writer.Push(deformer.Bones[i].LocalMat);
}
}
示例4: SaveMaterials
void Model_IO::SaveMaterials(std::vector<Material>& materials, BinaryWriter& writer, const achar* path)
{
writer.Push((int32_t) materials.size());
for (int32_t i = 0; i < materials.size(); i++)
{
SaveMaterial(materials[i], writer, path);
}
}
示例5: SaveMeshes
void Model_IO::SaveMeshes(std::vector<Mesh>& meshes, BinaryWriter& writer, const achar* path)
{
writer.Push((int32_t) meshes.size());
for (auto i = 0; i < meshes.size(); i++)
{
SaveMesh(meshes[i], writer, path);
}
}
示例6: SaveMesh
void Model_IO::SaveMesh(Mesh& mesh, BinaryWriter& writer, const achar* path)
{
writer.Push((int32_t)mesh.DividedMeshes.size());
for (auto i = 0; i < mesh.DividedMeshes.size(); i++)
{
SaveDividedMesh(mesh.DividedMeshes[i], writer, path);
}
SaveMaterials(mesh.Materials, writer, path);
}
示例7: Push
void AffIndexTable::Push(BinaryWriter& writer)
{
array<int16_t, CHARCODE_MAX> indexes;
for (auto& x : m_indexes)
{
indexes[(int)(x.first)] = x.second;
}
for (auto& x : indexes)
{
writer.Push(x);
}
}
示例8: SaveKeyframeAnimation
void Model_IO::SaveKeyframeAnimation(KeyframeAnimation& ka, BinaryWriter& writer, const achar* path)
{
writer.Push(ka.Name);
writer.Push((int32_t) ka.Keyframes.size());
for (int32_t i = 0; i < ka.Keyframes.size(); i++)
{
writer.Push(ka.Keyframes[i].KeyValue);
writer.Push(ka.Keyframes[i].LeftHandle);
writer.Push(ka.Keyframes[i].RightHandle);
writer.Push((int32_t)ka.Keyframes[i].Interpolation);
}
}
示例9: SaveMaterial
void Model_IO::SaveMaterial(Material& material, BinaryWriter& writer, const achar* path)
{
if (material.Type == 1)
{
writer.Push((int32_t)1);
astring path;
writer.Push(path);
}
else
{
writer.Push((int32_t) 0);
writer.Push(material.OriginalColorTexture.c_str());
writer.Push(material.OriginalNormalTexture.c_str());
writer.Push(material.OriginalMetalnessTexture.c_str());
}
}
示例10: SaveAnimationClip
void Model_IO::SaveAnimationClip(AnimationClip& ac, BinaryWriter& writer, const achar* path)
{
writer.Push(ac.Name);
writer.Push(ac.Index);
}
示例11: SaveDividedMesh
void Model_IO::SaveDividedMesh(DividedMesh& mesh, BinaryWriter& writer, const achar* path)
{
writer.Push((int32_t) mesh.Vertices.size());
for (int32_t i = 0; i < mesh.Vertices.size(); i++)
{
auto& v = mesh.Vertices[i];
writer.Push(v.Position);
writer.Push(v.Normal);
writer.Push(v.Binormal);
writer.Push(v.UV1);
writer.Push(v.UV2);
writer.Push(v.VColor.R);
writer.Push(v.VColor.G);
writer.Push(v.VColor.B);
writer.Push(v.VColor.A);
writer.Push(v.BoneWeights[0]);
writer.Push(v.BoneWeights[1]);
writer.Push(v.BoneWeights[2]);
writer.Push(v.BoneWeights[3]);
writer.Push(v.BoneIndexes[0]);
writer.Push(v.BoneIndexes[1]);
writer.Push(v.BoneIndexes[2]);
writer.Push(v.BoneIndexes[3]);
writer.Push(v.BoneIndexesOriginal[0]);
writer.Push(v.BoneIndexesOriginal[1]);
writer.Push(v.BoneIndexesOriginal[2]);
writer.Push(v.BoneIndexesOriginal[3]);
}
writer.Push((int32_t) mesh.Faces.size());
for (auto i = 0; i < mesh.Faces.size(); i++)
{
auto& f = mesh.Faces[i];
writer.Push(f.Indexes[0]);
writer.Push(f.Indexes[1]);
writer.Push(f.Indexes[2]);
}
writer.Push((int32_t) mesh.MaterialOffsets.size());
for (int32_t i = 0; i < mesh.MaterialOffsets.size(); i++)
{
writer.Push(mesh.MaterialOffsets[i].MaterialIndex);
writer.Push(mesh.MaterialOffsets[i].FaceOffset);
}
writer.Push((int32_t) mesh.BoneConnectors.size());
for (int32_t i = 0; i < mesh.BoneConnectors.size(); i++)
{
writer.Push(mesh.BoneConnectors[i].TargetIndex);
writer.Push(mesh.BoneConnectors[i].OffsetMatrix);
}
}