mirror of
https://github.com/aap/librw.git
synced 2025-12-19 00:49:50 +00:00
fixed view matrix; im2d UV
This commit is contained in:
@@ -207,6 +207,12 @@ cameraSync(ObjectWithFrame *obj)
|
||||
Camera *cam = (Camera*)obj;
|
||||
Matrix inv, proj;
|
||||
Matrix::invertOrthonormal(&inv, cam->getFrame()->getLTM());
|
||||
|
||||
inv.right.x = -inv.right.x;
|
||||
inv.up.x = -inv.up.x;
|
||||
inv.at.x = -inv.at.x;
|
||||
inv.pos.x = -inv.pos.x;
|
||||
|
||||
float32 xscl = 1.0f/(2.0f*cam->viewWindow.x);
|
||||
float32 yscl = 1.0f/(2.0f*cam->viewWindow.y);
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ struct Im2DVertex
|
||||
void setCameraZ(float32 z) { }
|
||||
void setRecipCameraZ(float32 recipz) { this->w = recipz; }
|
||||
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) { this->color = D3DCOLOR_ARGB(a, r, g, b); }
|
||||
void setU(float32 u) { this->u = u; }
|
||||
void setV(float32 v) { this->v = v; }
|
||||
void setU(float32 u, float recipZ) { this->u = u; }
|
||||
void setV(float32 v, float recipZ) { this->v = v; }
|
||||
};
|
||||
|
||||
void setD3dMaterial(D3DMATERIAL9 *mat9);
|
||||
|
||||
@@ -114,8 +114,8 @@ struct Im2DVertex
|
||||
void setRecipCameraZ(float32 recipz) { }
|
||||
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) {
|
||||
this->r = r; this->g = g; this->b = b; this->a = a; }
|
||||
void setU(float32 u) { this->u = u; }
|
||||
void setV(float32 v) { this->v = v; }
|
||||
void setU(float32 u, float recipz) { this->u = u; }
|
||||
void setV(float32 v, float recipz) { this->v = v; }
|
||||
};
|
||||
|
||||
void setAttribPointers(AttribDesc *attribDescs, int32 numAttribs);
|
||||
|
||||
Reference in New Issue
Block a user