Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Merge back from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed May 3, 2015
2 parents d74505d + 162c021 commit a1b4303
Show file tree
Hide file tree
Showing 8 changed files with 776 additions and 166 deletions.
2 changes: 1 addition & 1 deletion src/BoundingFrustum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ internal string DebugDisplayString
#region Public Constructors

/// <summary>
/// Creates a new instance of <see cref="BoundingFrustum"/> class.
/// Constructs the frustum by extracting the view planes from a matrix.
/// </summary>
/// <param name="value">Combined matrix which usually is (View * Projection).</param>
public BoundingFrustum(Matrix value)
Expand Down
52 changes: 26 additions & 26 deletions src/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ public Color(Vector4 color)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from the XYZW unit length components of a vector.
/// </summary>
/// <param name="color">A <see cref="Vector3"/> representing a color.</param>
public Color(Vector3 color)
Expand All @@ -1597,12 +1597,12 @@ public Color(Vector3 color)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from a <see cref="Color"/> and an alpha value.
/// </summary>
/// <param name="color">
/// A <see cref="Color"/> for RGB values of new <see cref="Color"/> instance.
/// </param>
/// <param name="alpha">Alpha component value.</param>
/// <param name="alpha">The alpha component value from 0 to 255.</param>
public Color(Color color, int alpha)
{
_packedValue = 0;
Expand All @@ -1614,12 +1614,12 @@ public Color(Color color, int alpha)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from color and alpha value.
/// </summary>
/// <param name="color">
/// A <see cref="Color"/> for RGB values of new <see cref="Color"/> instance.
/// </param>
/// <param name="alpha">Alpha component value.</param>
/// <param name="alpha">Alpha component value from 0.0f to 1.0f.</param>
public Color(Color color, float alpha)
{
_packedValue = 0;
Expand All @@ -1631,11 +1631,11 @@ public Color(Color color, float alpha)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from scalars which representing red, green and blue values. Alpha value will be opaque.
/// </summary>
/// <param name="r">Red component value.</param>
/// <param name="g">Green component value.</param>
/// <param name="b">Blue component value.</param>
/// <param name="r">Red component value from 0.0f to 1.0f.</param>
/// <param name="g">Green component value from 0.0f to 1.0f.</param>
/// <param name="b">Blue component value from 0.0f to 1.0f.</param>
public Color(float r, float g, float b)
{
_packedValue = 0;
Expand All @@ -1647,11 +1647,11 @@ public Color(float r, float g, float b)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from scalars which representing red, green and blue values. Alpha value will be opaque.
/// </summary>
/// <param name="r">Red component value.</param>
/// <param name="g">Green component value.</param>
/// <param name="b">Blue component value.</param>
/// <param name="r">Red component value from 0 to 255.</param>
/// <param name="g">Green component value from 0 to 255.</param>
/// <param name="b">Blue component value from 0 to 255.</param>
public Color(int r, int g, int b)
{
_packedValue = 0;
Expand All @@ -1662,12 +1662,12 @@ public Color(int r, int g, int b)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from scalars which representing red, green, blue and alpha values.
/// </summary>
/// <param name="r">Red component value.</param>
/// <param name="g">Green component value.</param>
/// <param name="b">Blue component value.</param>
/// <param name="alpha">Alpha component value.</param>
/// <param name="r">Red component value from 0 to 255.</param>
/// <param name="g">Green component value from 0 to 255.</param>
/// <param name="b">Blue component value from 0 to 255.</param>
/// <param name="alpha">Alpha component value from 0 to 255.</param>
public Color(int r, int g, int b, int alpha)
{
_packedValue = 0;
Expand All @@ -1678,12 +1678,12 @@ public Color(int r, int g, int b, int alpha)
}

/// <summary>
/// Creates a new instance of <see cref="Color"/> struct.
/// Constructs an RGBA color from scalars which representing red, green, blue and alpha values.
/// </summary>
/// <param name="r">Red component value.</param>
/// <param name="g">Green component value.</param>
/// <param name="b">Blue component value.</param>
/// <param name="alpha">Alpha component value.</param>
/// <param name="r">Red component value from 0.0f to 1.0f.</param>
/// <param name="g">Green component value from 0.0f to 1.0f.</param>
/// <param name="b">Blue component value from 0.0f to 1.0f.</param>
/// <param name="alpha">Alpha component value from 0.0f to 1.0f.</param>
public Color(float r, float g, float b, float alpha)
{
_packedValue = 0;
Expand Down Expand Up @@ -1718,16 +1718,16 @@ public bool Equals(Color other)
}

/// <summary>
/// Returns the color in a 0-to-1 normalized <see cref="Vector3"/> format.
/// Gets a <see cref="Vector3"/> representation for this object.
/// </summary>
/// /// <returns>A <see cref="Vector3"/> representation for this object.</returns>
/// <returns>A <see cref="Vector3"/> representation for this object.</returns>
public Vector3 ToVector3()
{
return new Vector3(R / 255.0f, G / 255.0f, B / 255.0f);
}

/// <summary>
/// Returns the color in a 0-to-1 normalized <see cref="Vector4"/> format.
/// Gets a <see cref="Vector4"/> representation for this object.
/// </summary>
/// <returns>A <see cref="Vector4"/> representation for this object.</returns>
public Vector4 ToVector4()
Expand Down
8 changes: 4 additions & 4 deletions src/Curve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public bool IsConstant
}

/// <summary>
/// Gets the collection of curve keys.
/// The collection of curve keys.
/// </summary>
public CurveKeyCollection Keys
{
Expand All @@ -47,7 +47,7 @@ public CurveKeyCollection Keys
}

/// <summary>
/// Gets or sets how to handle weighting values that are greater than the last control point in the curve.
/// Defines how to handle weighting values that are greater than the last control point in the curve.
/// </summary>
public CurveLoopType PostLoop
{
Expand All @@ -56,7 +56,7 @@ public CurveLoopType PostLoop
}

/// <summary>
/// Gets or sets how to handle weighting values that are less than the first control point in the curve.
/// Defines how to handle weighting values that are less than the first control point in the curve.
/// </summary>
public CurveLoopType PreLoop
{
Expand All @@ -69,7 +69,7 @@ public CurveLoopType PreLoop
#region Public Constructors

/// <summary>
/// Creates a new instance of <see cref="Curve"/> class.
/// Constructs a curve.
/// </summary>
public Curve()
{
Expand Down
50 changes: 38 additions & 12 deletions src/Graphics/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// A basic 3D model with per mesh parent bones.
/// </summary>
public class Model
{
#region Public Properties

/// <summary>
/// Gets a collection of ModelBone objects which describe how each mesh in the
/// Meshes collection for this model relates to its parent mesh.
/// A collection of <see cref="ModelBone"/> objects which describe how each mesh in the
/// mesh collection for this model relates to its parent mesh.
/// </summary>
public ModelBoneCollection Bones
{
Expand All @@ -29,9 +32,9 @@ public ModelBoneCollection Bones
}

/// <summary>
/// Gets a collection of ModelMesh objects which compose the model. Each ModelMesh
/// A collection of <see cref="ModelMesh"/> objects which compose the model. Each <see cref="ModelMesh"/>
/// in a model may be moved independently and may be composed of multiple materials
/// identified as ModelMeshPart objects.
/// identified as <see cref="ModelMeshPart"/> objects.
/// </summary>
public ModelMeshCollection Meshes
{
Expand All @@ -40,7 +43,7 @@ public ModelMeshCollection Meshes
}

/// <summary>
/// Gets the root bone for this model.
/// Root bone for this model.
/// </summary>
public ModelBone Root
{
Expand All @@ -49,7 +52,10 @@ public ModelBone Root
}

/// <summary>
/// Gets or sets an object identifying this model.
/// Custom attached object.
/// <remarks>
/// Skinning data is example of attached object for model.
/// </remarks>
/// </summary>
public object Tag
{
Expand All @@ -65,13 +71,15 @@ public object Tag

#endregion

#region Public Constructors
#region Internal Constructor

public Model()
{
}

public Model(GraphicsDevice graphicsDevice, List<ModelBone> bones, List<ModelMesh> meshes)
/// <summary>
/// Constructs a model.
/// </summary>
/// <param name="graphicsDevice">A valid reference to <see cref="GraphicsDevice"/>.</param>
/// <param name="bones">The collection of bones.</param>
/// <param name="meshes">The collection of meshes.</param>
internal Model(GraphicsDevice graphicsDevice, List<ModelBone> bones, List<ModelMesh> meshes)
{
Bones = new ModelBoneCollection(bones);
Meshes = new ModelMeshCollection(meshes);
Expand All @@ -81,6 +89,12 @@ public Model(GraphicsDevice graphicsDevice, List<ModelBone> bones, List<ModelMes

#region Public Methods

/// <summary>
/// Draws the model meshes.
/// </summary>
/// <param name="world">The world transform.</param>
/// <param name="view">The view transform.</param>
/// <param name="projection">The projection transform.</param>
public void Draw(Matrix world, Matrix view, Matrix projection)
{
int boneCount = Bones.Count;
Expand Down Expand Up @@ -113,6 +127,10 @@ public void Draw(Matrix world, Matrix view, Matrix projection)
}
}

/// <summary>
/// Copies bone transforms relative to all parent bones of the each bone from this model to a given array.
/// </summary>
/// <param name="destinationBoneTransforms">The array receiving the transformed bones.</param>
public void CopyAbsoluteBoneTransformsTo(Matrix[] destinationBoneTransforms)
{
if (destinationBoneTransforms == null)
Expand Down Expand Up @@ -145,6 +163,10 @@ public void CopyAbsoluteBoneTransformsTo(Matrix[] destinationBoneTransforms)
}
}

/// <summary>
/// Copies bone transforms relative to <see cref="Model.Root"/> bone from a given array to this model.
/// </summary>
/// <param name="sourceBoneTransforms">The array of prepared bone transform data.</param>
public void CopyBoneTransformsFrom(Matrix[] sourceBoneTransforms)
{
if (sourceBoneTransforms == null)
Expand All @@ -161,6 +183,10 @@ public void CopyBoneTransformsFrom(Matrix[] sourceBoneTransforms)
}
}

/// <summary>
/// Copies bone transforms relative to <see cref="Model.Root"/> bone from this model to a given array.
/// </summary>
/// <param name="destinationBoneTransforms">The array receiving the transformed bones.</param>
public void CopyBoneTransformsTo(Matrix[] destinationBoneTransforms)
{
if (destinationBoneTransforms == null)
Expand Down
4 changes: 2 additions & 2 deletions src/Graphics/Viewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public Rectangle TitleSafeArea
#region Public Constructors

/// <summary>
/// Creates a new instance of <see cref="Viewport"/> struct.
/// Constructs a viewport from the given values. The <see cref="MinDepth"/> will be 0.0 and <see cref="MaxDepth"/> will be 1.0.
/// </summary>
/// <param name="x">The x coordinate of the upper-left corner of the view bounds in pixels.</param>
/// <param name="y">The y coordinate of the upper-left corner of the view bounds in pixels.</param>
Expand All @@ -195,7 +195,7 @@ public Viewport(int x, int y, int width, int height)
}

/// <summary>
/// Creates a new instance of <see cref="Viewport"/> struct.
/// Constructs a viewport from the given values.
/// </summary>
/// <param name="bounds">A <see cref="Rectangle"/> that defines the location and size of the <see cref="Viewport"/> in a render target.</param>
public Viewport(Rectangle bounds)
Expand Down
Loading

0 comments on commit a1b4303

Please sign in to comment.