2021-04-03
+ Added Field to DrawingBasis to enfore PrimitiveTypes + LastObject to context for Debugging + AppendRenderbuffer to Framebuffer ~ Added a depthbuffer to RenderPipeline.CreateWindowFramebuffer ~ Proper ZIndices over Z-Translation and DepthBuffer ~ Made "ShaderArguments["LineWidth"]" set the LineWidth even if the object isn't maked as LineMesh ~ Made that the SM2D.PolygonVertex can translate OpenTK.Vector2 by itself. ~ Made the SM2D.Transformation.ZIndex a CVector1 instead a float
This commit is contained in:
parent
a7c71e7ea1
commit
c6bf5c75bc
16 changed files with 114 additions and 26 deletions
|
|
@ -27,15 +27,17 @@ namespace SM2D.Types
|
|||
|
||||
public bool VerticalFlip { get; set; } = false;
|
||||
|
||||
public int ZIndex { get; set; }
|
||||
public CVector1 ZIndex { get; set; } = new CVector1(0);
|
||||
|
||||
protected override Matrix4 RequestMatrix()
|
||||
{
|
||||
float z = 1 / (float) ZIndexPercision * ZIndex;
|
||||
|
||||
return Matrix4.CreateScale(Size.X, Size.Y, 1) *
|
||||
Matrix4.CreateRotationX(MathHelper.DegreesToRadians(HorizontalFlip ? 180 : 0)) *
|
||||
Matrix4.CreateRotationY(MathHelper.DegreesToRadians(VerticalFlip ? 180 : 0)) *
|
||||
Matrix4.CreateRotationZ(MathHelper.DegreesToRadians(Rotation)) *
|
||||
Matrix4.CreateTranslation(Position.X, Position.Y, -(1 / (float)ZIndexPercision * ZIndex));
|
||||
Matrix4.CreateTranslation(Position.X, Position.Y, z);
|
||||
}
|
||||
|
||||
public void TurnTo(Vector2 v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue