2018-08-19 20:27:58 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "lc_math.h"
|
2018-11-03 17:54:32 -07:00
|
|
|
#include "lc_context.h"
|
2018-08-19 20:27:58 -07:00
|
|
|
#include <bitset>
|
|
|
|
|
|
|
|
class View;
|
|
|
|
|
2018-10-28 17:59:01 -07:00
|
|
|
class lcViewSphere
|
2018-08-19 20:27:58 -07:00
|
|
|
{
|
|
|
|
public:
|
2018-10-28 17:59:01 -07:00
|
|
|
lcViewSphere(View* View);
|
2018-08-19 20:27:58 -07:00
|
|
|
|
|
|
|
void Draw();
|
|
|
|
bool OnMouseMove();
|
|
|
|
bool OnLeftButtonUp();
|
2018-09-11 13:34:59 -07:00
|
|
|
bool OnLeftButtonDown();
|
2018-09-19 12:56:45 -07:00
|
|
|
bool IsDragging() const;
|
2018-08-19 20:27:58 -07:00
|
|
|
|
2018-11-03 17:54:32 -07:00
|
|
|
static void CreateResources(lcContext* Context);
|
|
|
|
static void DestroyResources(lcContext* Context);
|
2018-10-28 17:59:01 -07:00
|
|
|
|
2018-08-19 20:27:58 -07:00
|
|
|
protected:
|
|
|
|
lcMatrix44 GetViewMatrix() const;
|
|
|
|
lcMatrix44 GetProjectionMatrix() const;
|
2018-09-19 13:19:01 -07:00
|
|
|
std::bitset<6> GetIntersectionFlags(lcVector3& Intersection) const;
|
2018-08-19 20:27:58 -07:00
|
|
|
|
|
|
|
View* mView;
|
|
|
|
lcVector3 mIntersection;
|
|
|
|
std::bitset<6> mIntersectionFlags;
|
2018-09-11 13:34:59 -07:00
|
|
|
int mMouseDownX;
|
|
|
|
int mMouseDownY;
|
|
|
|
bool mMouseDown;
|
2018-10-28 17:59:01 -07:00
|
|
|
|
|
|
|
static lcTexture* mTexture;
|
2018-11-03 17:54:32 -07:00
|
|
|
static lcVertexBuffer mVertexBuffer;
|
|
|
|
static lcIndexBuffer mIndexBuffer;
|
|
|
|
static const float mRadius;
|
2019-01-19 20:04:08 -08:00
|
|
|
static const float mHighlightRadius;
|
2018-11-03 17:54:32 -07:00
|
|
|
static const int mSubdivisions;
|
2018-08-19 20:27:58 -07:00
|
|
|
};
|