Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Mesh.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Linq;
4 
5 using SiliconStudio.Core;
6 using SiliconStudio.Core.Mathematics;
7 using SiliconStudio.Core.Serialization.Converters;
8 
9 namespace SiliconStudio.Paradox.Effects
10 {
11  [DataConverter(AutoGenerate = true)]
12  public class Mesh
13  {
14  /// <summary>
15  /// Initializes a new instance of the <see cref="Mesh"/> class.
16  /// </summary>
17  public Mesh()
18  {
19  Parameters = new ParameterCollection();
20  }
21 
22  /// <summary>
23  /// Initializes a new instance of the <see cref="Mesh"/> class using a shallow copy constructor.
24  /// </summary>
25  /// <param name="mesh">The mesh.</param>
26  public Mesh(Mesh mesh)
27  {
28  Draw = mesh.Draw;
29 
30  // TODO: share parameter collection or copy parameters in a new one?
31  Parameters = mesh.Parameters ?? new ParameterCollection();
32 
33  Material = mesh.Material;
34  NodeIndex = mesh.NodeIndex;
35  Name = mesh.Name;
36  BoundingBox = mesh.BoundingBox;
37  Skinning = mesh.Skinning;
38  }
39 
40  [DataMemberConvert]
41  public MeshDraw Draw { get; set; }
42 
43  [DataMemberConvert]
44  public Material Material { get; set; }
45 
46  [DataMemberConvert]
47  public ParameterCollection Parameters { get; set; }
48 
49  /// <summary>
50  /// Index of the transformation node in <see cref="Model"/>.
51  /// </summary>
52  [DataMemberConvert]
53  public int NodeIndex;
54 
55  [DataMemberConvert]
56  public string Name;
57 
58  /// <summary>
59  /// Gets or sets the bounding box encompassing this <see cref="Mesh"/>.
60  /// </summary>
61  [DataMemberConvert]
63 
64  // TODO: Skinning could be shared between multiple Mesh inside a ModelView (multimaterial, etc...)
65  [DataMemberConvert]
67  }
68 }
Represents an axis-aligned bounding box in three dimensional space.
Definition: BoundingBox.cs:42
Describes skinning for a Mesh, through a collection of MeshBoneDefinition.
Base class for converters to/from a data type.
BoundingBox BoundingBox
Gets or sets the bounding box encompassing this Mesh.
Definition: Mesh.cs:62
MeshSkinningDefinition Skinning
Definition: Mesh.cs:66
Mesh(Mesh mesh)
Initializes a new instance of the Mesh class using a shallow copy constructor.
Definition: Mesh.cs:26
int NodeIndex
Index of the transformation node in Model.
Definition: Mesh.cs:53
Mesh()
Initializes a new instance of the Mesh class.
Definition: Mesh.cs:17
A container to handle a hierarchical collection of effect variables.