コード例 #1
0
 public static void Emit(this SceneSerializer s, IOutputStream o, PivotSO so)
 {
     o.AddAttribute(IOStrings.ASOType, IOStrings.TypePivot);
     o.AddAttribute(IOStrings.ASOName, so.Name);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
 }
コード例 #2
0
 public static void EmitPivotSO(SceneSerializer s, IOutputStream o, PivotSO so)
 {
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
 }
コード例 #3
0
 public static void EmitPolyCurveSO(SceneSerializer s, IOutputStream o, PolyCurveSO so)
 {
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
     o.AddAttribute(IOStrings.APolyCurve3, so.Curve.Vertices);
     o.AddAttribute(IOStrings.APolyCurveClosed, so.Curve.Closed);
 }
コード例 #4
0
 public static void EmitBoxSO(SceneSerializer s, IOutputStream o, BoxSO so)
 {
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
     o.AddAttribute(IOStrings.AWidth, so.Width);
     o.AddAttribute(IOStrings.AHeight, so.Height);
     o.AddAttribute(IOStrings.ADepth, so.Depth);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
 }
コード例 #5
0
 public static void Emit(this SceneSerializer s, IOutputStream o, PolyTubeSO so)
 {
     o.AddAttribute(IOStrings.ASOType, IOStrings.TypePolyTube);
     o.AddAttribute(IOStrings.ASOName, so.Name);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
     o.AddAttribute(IOStrings.APolyCurve3, so.Curve.Vertices);
     o.AddAttribute(IOStrings.APolyCurveClosed, so.Curve.Closed);
     o.AddAttribute(IOStrings.APolygon2, so.Polygon.Vertices);
 }
コード例 #6
0
        public static void EmitCylinderSO(SceneSerializer s, IOutputStream o, CylinderSO so)
        {
            o.AddAttribute(IOStrings.ASOName, so.Name);
            o.AddAttribute(IOStrings.ASOUuid, so.UUID);
            s.EmitTransform(o, so);
            o.AddAttribute(IOStrings.ARadius, so.Radius);
            o.AddAttribute(IOStrings.AHeight, so.Height);
            Frame3f f = so.GetLocalFrame(CoordSpace.ObjectCoords);

            o.AddAttribute(IOStrings.AStartPoint, (f.Origin - 0.5f * so.ScaledHeight * f.Y));
            o.AddAttribute(IOStrings.AEndPoint, (f.Origin + 0.5f * so.ScaledHeight * f.Y));
            s.EmitMaterial(o, so.GetAssignedSOMaterial());
        }
コード例 #7
0
        public static void EmitDMeshSO(SceneSerializer s, IOutputStream o, DMeshSO so)
        {
            SceneSerializer.EmitOptions opt = s.CurrentOptions;

            o.AddAttribute(IOStrings.ASOName, so.Name);
            o.AddAttribute(IOStrings.ASOUuid, so.UUID);
            s.EmitTransform(o, so);
            s.EmitMaterial(o, so.GetAssignedSOMaterial());
            //s.EmitDMeshBinary(so.Mesh, o);
            if (opt.MinimalMeshStorage)
            {
                s.EmitDMeshCompressed_Minimal(so.Mesh, o);
            }
            else
            {
                s.EmitDMeshCompressed(so.Mesh, o);
            }
        }