leocad/common/lc_viewsphere.h

42 lines
856 B
C
Raw Normal View History

2018-08-20 05:27:58 +02:00
#pragma once
#include "lc_math.h"
#include "lc_context.h"
2018-08-20 05:27:58 +02:00
#include <bitset>
class View;
2018-10-29 01:59:01 +01:00
class lcViewSphere
2018-08-20 05:27:58 +02:00
{
public:
2018-10-29 01:59:01 +01:00
lcViewSphere(View* View);
2018-08-20 05:27:58 +02:00
void Draw();
bool OnMouseMove();
bool OnLeftButtonUp();
bool OnLeftButtonDown();
bool IsDragging() const;
2018-08-20 05:27:58 +02:00
static void CreateResources(lcContext* Context);
static void DestroyResources(lcContext* Context);
2018-10-29 01:59:01 +01:00
2018-08-20 05:27:58 +02:00
protected:
lcMatrix44 GetViewMatrix() const;
lcMatrix44 GetProjectionMatrix() const;
std::bitset<6> GetIntersectionFlags(lcVector3& Intersection) const;
2018-08-20 05:27:58 +02:00
View* mView;
lcVector3 mIntersection;
std::bitset<6> mIntersectionFlags;
int mMouseDownX;
int mMouseDownY;
bool mMouseDown;
2018-10-29 01:59:01 +01:00
static lcTexture* mTexture;
static lcVertexBuffer mVertexBuffer;
static lcIndexBuffer mIndexBuffer;
static const float mRadius;
2019-01-20 05:04:08 +01:00
static const float mHighlightRadius;
static const int mSubdivisions;
2018-08-20 05:27:58 +02:00
};