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