switch to glm
This commit is contained in:
parent
80cae7618c
commit
6c6ee96be1
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 2493989c5e830bd954c326772b4410580e975c8d
|
Subproject commit e469041733b2446bad783c5176a1480622f78a0e
|
@ -1 +1 @@
|
|||||||
Subproject commit 2dc2e3ef9587a69eb29216411f9de322c65860a6
|
Subproject commit c8141fd275ce2ac9f4087c446eb04ba1be3a93b3
|
@ -5,6 +5,7 @@
|
|||||||
#include<hgl/math/Vector.h>
|
#include<hgl/math/Vector.h>
|
||||||
#include<hgl/type/RectScope.h>
|
#include<hgl/type/RectScope.h>
|
||||||
#include<hgl/type/Color4f.h>
|
#include<hgl/type/Color4f.h>
|
||||||
|
#include<hgl/graph/AABB.h>
|
||||||
namespace hgl
|
namespace hgl
|
||||||
{
|
{
|
||||||
namespace graph
|
namespace graph
|
||||||
@ -82,7 +83,8 @@ namespace hgl
|
|||||||
|
|
||||||
PlaneCreateInfo()
|
PlaneCreateInfo()
|
||||||
{
|
{
|
||||||
tile.Set(1,1);
|
tile.x=1.0f;
|
||||||
|
tile.y=1.0f;
|
||||||
}
|
}
|
||||||
};//struct PlaneCreateInfo
|
};//struct PlaneCreateInfo
|
||||||
|
|
||||||
@ -101,18 +103,18 @@ namespace hgl
|
|||||||
Vector4f color;
|
Vector4f color;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void Set(const AABB &box)
|
void Set(const AABB &box)
|
||||||
{
|
{
|
||||||
center=box.CenterPoint().xyz();
|
center=box.center;
|
||||||
size=box.Size().xyz();
|
size=box.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
CubeCreateInfo()
|
CubeCreateInfo()
|
||||||
{
|
{
|
||||||
center.Set(0,0,0);
|
center=Vector3f(0,0,0);
|
||||||
size.Set(1,1,1);
|
size=Vector3f(1,1,1);
|
||||||
tile.Set(1,1);
|
tile=Vector2f(1,1);
|
||||||
|
|
||||||
has_color=false;
|
has_color=false;
|
||||||
}
|
}
|
||||||
@ -120,8 +122,8 @@ namespace hgl
|
|||||||
CubeCreateInfo(const AABB &box)
|
CubeCreateInfo(const AABB &box)
|
||||||
{
|
{
|
||||||
Set(box);
|
Set(box);
|
||||||
tile.Set(1,1);
|
tile=Vector2f(1,1);
|
||||||
|
|
||||||
has_color=false;
|
has_color=false;
|
||||||
}
|
}
|
||||||
};//struct CubeCreateInfo
|
};//struct CubeCreateInfo
|
||||||
@ -130,12 +132,12 @@ namespace hgl
|
|||||||
* 创建一个立方体(三角形)
|
* 创建一个立方体(三角形)
|
||||||
*/
|
*/
|
||||||
Renderable *CreateRenderableCube(RenderResource *db,Material *mtl,const CubeCreateInfo *cci);
|
Renderable *CreateRenderableCube(RenderResource *db,Material *mtl,const CubeCreateInfo *cci);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个绑定盒(线条)
|
* 创建一个绑定盒(线条)
|
||||||
*/
|
*/
|
||||||
Renderable *CreateRenderableBoundingBox(RenderResource *db,Material *mtl,const CubeCreateInfo *cci);
|
Renderable *CreateRenderableBoundingBox(RenderResource *db,Material *mtl,const CubeCreateInfo *cci);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个球心坐标为0,0,0,半径为1的球体(三角形)
|
* 创建一个球心坐标为0,0,0,半径为1的球体(三角形)
|
||||||
*/
|
*/
|
||||||
@ -162,7 +164,7 @@ namespace hgl
|
|||||||
|
|
||||||
Vector2f uv_scale={1.0,1.0};
|
Vector2f uv_scale={1.0,1.0};
|
||||||
};//struct TorusCreateInfo
|
};//struct TorusCreateInfo
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个圆环(三角形)
|
* 创建一个圆环(三角形)
|
||||||
*/
|
*/
|
||||||
@ -192,7 +194,7 @@ namespace hgl
|
|||||||
* 创建一个圆锥(三角形)
|
* 创建一个圆锥(三角形)
|
||||||
*/
|
*/
|
||||||
Renderable *CreateRenderableCone(RenderResource *db,Material *mtl,const ConeCreateInfo *cci);
|
Renderable *CreateRenderableCone(RenderResource *db,Material *mtl,const ConeCreateInfo *cci);
|
||||||
|
|
||||||
struct AxisCreateInfo
|
struct AxisCreateInfo
|
||||||
{
|
{
|
||||||
float size;
|
float size;
|
||||||
|
@ -23,10 +23,10 @@ namespace hgl
|
|||||||
void Set(const Matrix4f &w,const Matrix4f &vp)
|
void Set(const Matrix4f &w,const Matrix4f &vp)
|
||||||
{
|
{
|
||||||
l2w=w;
|
l2w=w;
|
||||||
inverse_l2w=l2w.Inverted();
|
inverse_l2w=inverse(l2w);
|
||||||
|
|
||||||
mvp=vp*l2w;
|
mvp=vp*l2w;
|
||||||
inverse_mvp=mvp.Inverted();
|
inverse_mvp=inverse(mvp);
|
||||||
}
|
}
|
||||||
|
|
||||||
CompOperatorMemcmp(const MVPMatrix &);
|
CompOperatorMemcmp(const MVPMatrix &);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include<hgl/type/List.h>
|
#include<hgl/type/List.h>
|
||||||
#include<hgl/graph/SceneOrient.h>
|
#include<hgl/graph/SceneOrient.h>
|
||||||
#include<hgl/graph/VK.h>
|
#include<hgl/graph/VK.h>
|
||||||
|
#include<hgl/graph/AABB.h>
|
||||||
namespace hgl
|
namespace hgl
|
||||||
{
|
{
|
||||||
namespace graph
|
namespace graph
|
||||||
@ -24,7 +25,7 @@ namespace hgl
|
|||||||
Vector4f Center; ///<中心点
|
Vector4f Center; ///<中心点
|
||||||
Vector4f LocalCenter; ///<本地坐标中心点
|
Vector4f LocalCenter; ///<本地坐标中心点
|
||||||
Vector4f WorldCenter; ///<世界坐标中心点
|
Vector4f WorldCenter; ///<世界坐标中心点
|
||||||
|
|
||||||
RenderableInstance *render_obj=nullptr; ///<可渲染实例
|
RenderableInstance *render_obj=nullptr; ///<可渲染实例
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include<hgl/type/Map.h>
|
#include<hgl/type/Map.h>
|
||||||
#include<hgl/type/String.h>
|
#include<hgl/type/String.h>
|
||||||
#include<hgl/math/Math.h>
|
#include<hgl/math/Math.h>
|
||||||
|
#include<hgl/graph/AABB.h>
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
/**
|
/**
|
||||||
* 可渲染数据对象<br>
|
* 可渲染数据对象<br>
|
||||||
@ -24,7 +25,7 @@ class Renderable
|
|||||||
};
|
};
|
||||||
|
|
||||||
Map<UTF8String,VABData> buffer_list;
|
Map<UTF8String,VABData> buffer_list;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
uint32_t draw_count;
|
uint32_t draw_count;
|
||||||
|
@ -15,8 +15,8 @@ namespace hgl
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BoundingBox.minPoint=vec::zero;
|
BoundingBox.minPoint=Vector3f(0,0,0);
|
||||||
BoundingBox.maxPoint=vec::zero;
|
BoundingBox.maxPoint=Vector3f(0,0,0);
|
||||||
|
|
||||||
WorldBoundingBox=LocalBoundingBox=BoundingBox;
|
WorldBoundingBox=LocalBoundingBox=BoundingBox;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user