本文整理汇总了C#中MediaPortal.GUI.Library.TransformMatrix类的典型用法代码示例。如果您正苦于以下问题:C# TransformMatrix类的具体用法?C# TransformMatrix怎么用?C# TransformMatrix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransformMatrix类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了TransformMatrix类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateScaler
public static TransformMatrix CreateScaler(float scaleX, float scaleY, float scaleZ /*=1.0f*/)
{
TransformMatrix scaler = new TransformMatrix();
scaler.m[0, 0] = scaleX;
scaler.m[1, 1] = scaleY;
scaler.m[2, 2] = scaleZ;
return scaler;
}
示例2: CreateTranslation
public static TransformMatrix CreateTranslation(float transX, float transY, float transZ /*=0.0f*/)
{
TransformMatrix translation = new TransformMatrix();
translation.m[0, 3] = transX;
translation.m[1, 3] = transY;
translation.m[2, 3] = transZ;
return translation;
}
示例3: FinalTransformBucket
public FinalTransformBucket(TransformMatrix finalTransform, TransformMatrix finalTransformCalibrated)
{
// The matrices on the stack must be copies otherwise they may be illegally manipulated while on the stack.
_finalTransformMatrix = (TransformMatrix)finalTransform.Clone();
_finalTransformMatrixCalibrated = (TransformMatrix)finalTransformCalibrated.Clone();
}
示例4: UpdateFinalTransform
/// <summary>
///
/// </summary>
/// <param name="matrix"></param>
public static void UpdateFinalTransform(TransformMatrix matrix)
{
_finalTransform = matrix;
_finalTransformCalibrated = GetOffsetCorrectionTransform().multiply(matrix);
}
示例5: SetScalingResolution
/// <summary>
///
/// </summary>
/// <param name="posX"></param>
/// <param name="posY"></param>
/// <param name="needsScaling"></param>
public static void SetScalingResolution(int posX, int posY, bool needsScaling)
{
if (!needsScaling)
{
_guiTransform = TransformMatrix.CreateTranslation(posX, posY, 0);
}
Cameras.Clear();
Cameras.Add(new Point(Width / 2, Height / 2));
UpdateCameraPosition(Cameras[Cameras.Count-1]);
// reset the final transform and window transforms
UpdateFinalTransform(_guiTransform);
}
示例6: RotateZ
/// <summary>
/// Rotates the control transform matrix by the specified angle (in degrees) around the z-axis.
/// </summary>
public static void RotateZ(float angle, float x, float y)
{
TransformMatrix m = new TransformMatrix();
angle *= DEGREE_TO_RADIAN;
m.SetZRotation(angle, x, y, 1.0f);
UpdateFinalTransform(ControlTransform.multiplyAssign(m));
}
示例7: CreateFader
public static TransformMatrix CreateFader(float a)
{
TransformMatrix fader = new TransformMatrix();
fader.alpha = a;
return fader;
}
示例8: RenderAnimation
private bool RenderAnimation(uint time)
{
TransformMatrix transform = new TransformMatrix();
// show animation
_showAnimation.Animate(time, true);
UpdateStates(_showAnimation.AnimationType, _showAnimation.CurrentProcess, _showAnimation.CurrentState);
_showAnimation.RenderAnimation(ref transform);
// close animation
_closeAnimation.Animate(time, true);
UpdateStates(_closeAnimation.AnimationType, _closeAnimation.CurrentProcess, _closeAnimation.CurrentState);
_closeAnimation.RenderAnimation(ref transform);
GUIGraphicsContext.SetWindowTransform(transform);
return true;
}
示例9: Draw
/// <summary>
/// Draw a texture rotated around (x,y) blended with a diffuse texture.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="nw"></param>
/// <param name="nh"></param>
/// <param name="zrot"></param>
/// <param name="uoff"></param>
/// <param name="voff"></param>
/// <param name="umax"></param>
/// <param name="vmax"></param>
/// <param name="color"></param>
/// <param name="diffuseTextureNo"></param>
/// <param name="uoffd"></param>
/// <param name="voffd"></param>
/// <param name="umaxd"></param>
/// <param name="vmaxd"></param>
public void Draw(float x, float y, float nw, float nh, float zrot, float uoff, float voff,
float umax, float vmax, uint color, int blendableTextureNo, float uoffd,
float voffd, float umaxd, float vmaxd, FontEngineBlendMode blendMode)
{
if (_textureNumber >= 0)
{
// Rotate around the x,y point of the specified rectangle; maintain aspect ratio (1.0f)
TransformMatrix localTransform = new TransformMatrix();
localTransform.SetZRotation(zrot, x, y, 1.0f);
TransformMatrix finalTransform = GUIGraphicsContext.GetFinalTransform();
localTransform = finalTransform.multiply(localTransform);
DXNative.FontEngineDrawTexture2(_textureNumber, x, y, nw, nh, uoff, voff, umax, vmax,
color, localTransform.Matrix,
blendableTextureNo, uoffd, voffd, umaxd, vmaxd,
blendMode);
}
}
示例10: Clone
public object Clone()
{
TransformMatrix matrix = new TransformMatrix();
matrix.assign(this);
return matrix;
}
示例11: multiply
public TransformMatrix multiply(TransformMatrix right)
{
TransformMatrix result = new TransformMatrix();
result.m[0, 0] = m[0, 0] * right.m[0, 0] + m[0, 1] * right.m[1, 0] + m[0, 2] * right.m[2, 0];
result.m[0, 1] = m[0, 0] * right.m[0, 1] + m[0, 1] * right.m[1, 1] + m[0, 2] * right.m[2, 1];
result.m[0, 2] = m[0, 0] * right.m[0, 2] + m[0, 1] * right.m[1, 2] + m[0, 2] * right.m[2, 2];
result.m[0, 3] = m[0, 0] * right.m[0, 3] + m[0, 1] * right.m[1, 3] + m[0, 2] * right.m[2, 3] + m[0, 3];
result.m[1, 0] = m[1, 0] * right.m[0, 0] + m[1, 1] * right.m[1, 0] + m[1, 2] * right.m[2, 0];
result.m[1, 1] = m[1, 0] * right.m[0, 1] + m[1, 1] * right.m[1, 1] + m[1, 2] * right.m[2, 1];
result.m[1, 2] = m[1, 0] * right.m[0, 2] + m[1, 1] * right.m[1, 2] + m[1, 2] * right.m[2, 2];
result.m[1, 3] = m[1, 0] * right.m[0, 3] + m[1, 1] * right.m[1, 3] + m[1, 2] * right.m[2, 3] + m[1, 3];
result.m[2, 0] = m[2, 0] * right.m[0, 0] + m[2, 1] * right.m[1, 0] + m[2, 2] * right.m[2, 0];
result.m[2, 1] = m[2, 0] * right.m[0, 1] + m[2, 1] * right.m[1, 1] + m[2, 2] * right.m[2, 1];
result.m[2, 2] = m[2, 0] * right.m[0, 2] + m[2, 1] * right.m[1, 2] + m[2, 2] * right.m[2, 2];
result.m[2, 3] = m[2, 0] * right.m[0, 3] + m[2, 1] * right.m[1, 3] + m[2, 2] * right.m[2, 3] + m[2, 3];
result.alpha = alpha * right.alpha;
return result;
}
示例12: multiplyAssign
// multiplication operators
public TransformMatrix multiplyAssign(TransformMatrix right)
{
float t00 = m[0, 0] * right.m[0, 0] + m[0, 1] * right.m[1, 0] + m[0, 2] * right.m[2, 0];
float t01 = m[0, 0] * right.m[0, 1] + m[0, 1] * right.m[1, 1] + m[0, 2] * right.m[2, 1];
float t02 = m[0, 0] * right.m[0, 2] + m[0, 1] * right.m[1, 2] + m[0, 2] * right.m[2, 2];
m[0, 3] = m[0, 0] * right.m[0, 3] + m[0, 1] * right.m[1, 3] + m[0, 2] * right.m[2, 3] + m[0, 3];
m[0, 0] = t00;
m[0, 1] = t01;
m[0, 2] = t02;
t00 = m[1, 0] * right.m[0, 0] + m[1, 1] * right.m[1, 0] + m[1, 2] * right.m[2, 0];
t01 = m[1, 0] * right.m[0, 1] + m[1, 1] * right.m[1, 1] + m[1, 2] * right.m[2, 1];
t02 = m[1, 0] * right.m[0, 2] + m[1, 1] * right.m[1, 2] + m[1, 2] * right.m[2, 2];
m[1, 3] = m[1, 0] * right.m[0, 3] + m[1, 1] * right.m[1, 3] + m[1, 2] * right.m[2, 3] + m[1, 3];
m[1, 0] = t00;
m[1, 1] = t01;
m[1, 2] = t02;
t00 = m[2, 0] * right.m[0, 0] + m[2, 1] * right.m[1, 0] + m[2, 2] * right.m[2, 0];
t01 = m[2, 0] * right.m[0, 1] + m[2, 1] * right.m[1, 1] + m[2, 2] * right.m[2, 1];
t02 = m[2, 0] * right.m[0, 2] + m[2, 1] * right.m[1, 2] + m[2, 2] * right.m[2, 2];
m[2, 3] = m[2, 0] * right.m[0, 3] + m[2, 1] * right.m[1, 3] + m[2, 2] * right.m[2, 3] + m[2, 3];
m[2, 0] = t00;
m[2, 1] = t01;
m[2, 2] = t02;
alpha *= right.alpha;
return this;
}
示例13: assign
// assignment operator
public TransformMatrix assign(TransformMatrix right)
{
m[0, 0] = right.m[0, 0];
m[0, 1] = right.m[0, 1];
m[0, 2] = right.m[0, 2];
m[0, 3] = right.m[0, 3];
m[1, 0] = right.m[1, 0];
m[1, 1] = right.m[1, 1];
m[1, 2] = right.m[1, 2];
m[1, 3] = right.m[1, 3];
m[2, 0] = right.m[2, 0];
m[2, 1] = right.m[2, 1];
m[2, 2] = right.m[2, 2];
m[2, 3] = right.m[2, 3];
alpha = right.alpha;
return this;
}
示例14: SetWindowTransform
/// <summary>
///
/// </summary>
/// <param name="matrix"></param>
public static void SetWindowTransform(TransformMatrix matrix)
{
// reset the group transform stack
GroupTransforms.Clear();
GroupTransforms.Add(_guiTransform.multiply(matrix));
_bypassUICalibration = 0;
UpdateFinalTransform(GroupTransforms[0]);
}
示例15: Draw
public void Draw(float x, float y, float nw, float nh, float zrot, float uoff, float voff, float umax, float vmax,
int color)
{
if (_textureNumber >= 0)
{
// Rotate around the x,y point of the specified rectangle; maintain aspect ratio (1.0f)
TransformMatrix localTransform = new TransformMatrix();
localTransform.SetZRotation(zrot, x, y, 1.0f);
TransformMatrix finalTransform = GUIGraphicsContext.GetFinalTransform();
localTransform = finalTransform.multiply(localTransform);
FontEngineDrawTexture(_textureNumber, x, y, nw, nh, uoff, voff, umax, vmax, color, localTransform.Matrix);
}
else
{
if (logTextures)
{
Log.Info("fontengine:Draw() ERROR. Texture is disposed:{0} {1}", _textureNumber.ToString(), _imageName);
}
}
}