added ReserveDirection
This commit is contained in:
parent
ae88a65315
commit
a5830e18cb
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 460dc1c5ecfba0f0cef93026be5d25a4f86605b1
|
Subproject commit 03443255541b4dde822f147fb7b817b3811cd8b9
|
@ -92,6 +92,8 @@ private:
|
|||||||
camera_control->SetTarget(Vector3f(0,0,0));
|
camera_control->SetTarget(Vector3f(0,0,0));
|
||||||
camera_control->Refresh();
|
camera_control->Refresh();
|
||||||
|
|
||||||
|
cmc->SetReserveDirection(true,true); //反转x,y
|
||||||
|
|
||||||
render_root.RefreshMatrix();
|
render_root.RefreshMatrix();
|
||||||
render_list->Expend(&render_root);
|
render_list->Expend(&render_root);
|
||||||
|
|
||||||
|
@ -378,6 +378,8 @@ class CameraMouseControl:public MouseEvent
|
|||||||
Vector2f mouse_pos;
|
Vector2f mouse_pos;
|
||||||
Vector2f mouse_last_pos;
|
Vector2f mouse_last_pos;
|
||||||
|
|
||||||
|
Vector2f ReverseDirection;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool OnPressed(int x,int y,MouseButton) override
|
bool OnPressed(int x,int y,MouseButton) override
|
||||||
@ -410,6 +412,8 @@ protected:
|
|||||||
Vector2f pos(x,y);
|
Vector2f pos(x,y);
|
||||||
Vector2f gap=pos-mouse_last_pos;
|
Vector2f gap=pos-mouse_last_pos;
|
||||||
|
|
||||||
|
gap*=ReverseDirection;
|
||||||
|
|
||||||
if(left)
|
if(left)
|
||||||
{
|
{
|
||||||
gap/=-5.0f;
|
gap/=-5.0f;
|
||||||
@ -436,6 +440,15 @@ public:
|
|||||||
{
|
{
|
||||||
camera=wc;
|
camera=wc;
|
||||||
cur_time=0;
|
cur_time=0;
|
||||||
|
|
||||||
|
ReverseDirection.x=1;
|
||||||
|
ReverseDirection.y=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetReserveDirection(bool x,bool y)
|
||||||
|
{
|
||||||
|
ReverseDirection.x=x?-1:1;
|
||||||
|
ReverseDirection.y=y?-1:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vector2f &GetMouseCoord()const{return mouse_pos;}
|
const Vector2f &GetMouseCoord()const{return mouse_pos;}
|
||||||
@ -448,7 +461,6 @@ public:
|
|||||||
|
|
||||||
class CameraAppFramework:public VulkanApplicationFramework
|
class CameraAppFramework:public VulkanApplicationFramework
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Camera * camera =nullptr;
|
Camera * camera =nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user