FixedPoint (Estructura)
Actualización: noviembre 2007
Representa un número de punto fijo 16.16.
Espacio de nombres: Microsoft.WindowsMobile.DirectX.Direct3D
Ensamblado: Microsoft.WindowsMobile.DirectX (en Microsoft.WindowsMobile.DirectX.dll)
Sintaxis
'Declaración
Public Structure FixedPoint _
Implements IComparable, IFormattable, IConvertible
'Uso
Dim instance As FixedPoint
public struct FixedPoint : IComparable,
IFormattable, IConvertible
public value class FixedPoint : IComparable,
IFormattable, IConvertible
JScript admite el uso de estructuras, pero no admite la declaración de estructuras nuevas.
Comentarios
Esta estructura se utiliza para interoperar con los distintos tipos de Windows Mobile Direct3D que tienen interfaces de punto fijo. La representación interna de esta clase es una estructura Int32.
Ejemplos
En el ejemplo siguiente se muestra cómo se puede utilizar una estructura FixedPoint.
' The following code is from the
' Direct3D Mobile Fixed Point Billboard Sample.
' It uses FixedPoint to position meshes of trees randomly.
' Initialize the tree data
Dim i As Integer
For i = 0 To numberTrees - 1
Dim t As New Tree()
' Position the trees randomly
Do
Dim fTheta As Single = 2.0F * _
System.Convert.ToSingle(Math.PI) * _
System.Convert.ToSingle(randObj.NextDouble())
Dim fRadius As Single = 25.0F + 55.0F * _
System.Convert.ToSingle(randObj.NextDouble())
Dim position As Vector3Fixed
position.X = CType(fRadius * _
System.Convert.ToSingle( _
Math.Sin(fTheta)), FixedPoint)
position.Z = CType(fRadius * _
System.Convert.ToSingle(Math.Cos(fTheta)), FixedPoint)
position.Y = CType(HeightField( _
System.Convert.ToSingle(position.X), _
System.Convert.ToSingle(position.Z)), FixedPoint)
t.Position = position
Loop While Not IsTreePositionValid(t.Position)
// The following code is from the
// Direct3D Mobile Fixed Point Billboard Sample.
// It uses FixedPoint to position meshes of trees randomly.
// Initialize the tree data
for (int i=0; i<numberTrees; i++)
{
Tree t = new Tree();
do
{
float fTheta = 2.0f * (float)Math.PI *
(float)randObj.NextDouble();
float fRadius = 25.0f + 55.0f * (float)randObj.NextDouble();
Vector3Fixed position;
position.X =
(FixedPoint)(fRadius * (float)Math.Sin(fTheta));
position.Z =
(FixedPoint)(fRadius * (float)Math.Cos(fTheta));
position.Y =
(FixedPoint)HeightField((float)position.X,
(float)position.Z);
t.Position = position;
}
while (!IsTreePositionValid(t.Position));
Seguridad para subprocesos
Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.
Plataformas
Windows CE, Windows Mobile para Smartphone, Windows Mobile para Pocket PC
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Información de versión
.NET Compact Framework
Compatible con: 3.5, 2.0
Vea también
Referencia
Microsoft.WindowsMobile.DirectX.Direct3D (Espacio de nombres)