Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PointCloud
Glm
提交
0c7dadef
G
Glm
项目概览
PointCloud
/
Glm
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Glm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c7dadef
编写于
9月 18, 2011
作者:
C
Christophe Riccio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed length function for half vec* types
上级
38837a88
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
109 addition
and
0 deletion
+109
-0
glm/gtc/half_float.hpp
glm/gtc/half_float.hpp
+3
-0
glm/gtc/half_float.inl
glm/gtc/half_float.inl
+16
-0
test/gtc/gtc_half_float.cpp
test/gtc/gtc_half_float.cpp
+90
-0
未找到文件。
glm/gtc/half_float.hpp
浏览文件 @
0c7dadef
...
...
@@ -28,6 +28,7 @@ namespace detail
typedef
thalf
value_type
;
typedef
std
::
size_t
size_type
;
static
size_type
value_size
();
GLM_FUNC_DECL
size_type
length
()
const
;
typedef
tvec2
<
thalf
>
type
;
typedef
tvec2
<
bool
>
bool_type
;
...
...
@@ -120,6 +121,7 @@ namespace detail
typedef
thalf
value_type
;
typedef
std
::
size_t
size_type
;
static
size_type
value_size
();
GLM_FUNC_DECL
size_type
length
()
const
;
typedef
tvec3
<
thalf
>
type
;
typedef
tvec3
<
bool
>
bool_type
;
...
...
@@ -216,6 +218,7 @@ namespace detail
typedef
thalf
value_type
;
typedef
std
::
size_t
size_type
;
static
size_type
value_size
();
GLM_FUNC_DECL
size_type
length
()
const
;
typedef
tvec4
<
thalf
>
type
;
typedef
tvec4
<
bool
>
bool_type
;
...
...
glm/gtc/half_float.inl
浏览文件 @
0c7dadef
...
...
@@ -20,6 +20,11 @@ GLM_FUNC_QUALIFIER tvec2<thalf>::size_type tvec2<thalf>::value_size()
return 2;
}
GLM_FUNC_QUALIFIER typename tvec2<thalf>::size_type tvec2<thalf>::length() const
{
return 2;
}
//////////////////////////////////////
// Accesses
...
...
@@ -288,6 +293,11 @@ GLM_FUNC_QUALIFIER tvec3<thalf>::size_type tvec3<thalf>::value_size()
return 3;
}
GLM_FUNC_QUALIFIER typename tvec3<thalf>::size_type tvec3<thalf>::length() const
{
return 3;
}
//////////////////////////////////////
// Accesses
...
...
@@ -600,6 +610,12 @@ GLM_FUNC_QUALIFIER tvec4<thalf>::size_type tvec4<thalf>::value_size()
return 4;
}
GLM_FUNC_QUALIFIER typename tvec4<thalf>::size_type tvec4<thalf>::length() const
{
return 4;
}
//////////////////////////////////////
// Accesses
...
...
test/gtc/gtc_half_float.cpp
浏览文件 @
0c7dadef
...
...
@@ -168,18 +168,108 @@ int test_half_ctor_vec2()
int
test_half_ctor_vec3
()
{
int
Error
=
0
;
{
glm
::
hvec3
A
(
1
,
2
,
3
);
glm
::
hvec3
B
(
A
);
glm
::
vec3
C
(
1
,
2
,
3
);
glm
::
hvec3
D
(
C
);
glm
::
dvec3
E
(
1
,
2
,
3
);
glm
::
hvec3
F
(
E
);
glm
::
hvec3
G
(
1
,
2.0
,
3
);
glm
::
hvec3
H
;
H
=
A
;
Error
+=
A
==
B
?
0
:
1
;
//Error += C == D ? 0 : 1;
//Error += E == F ? 0 : 1;
Error
+=
A
==
G
?
0
:
1
;
Error
+=
A
==
H
?
0
:
1
;
}
{
glm
::
hvec3
A
(
1
);
glm
::
vec3
B
(
1
);
//Error += A == B ? 0 : 1;
}
return
Error
;
}
int
test_half_ctor_vec4
()
{
int
Error
=
0
;
{
glm
::
hvec4
A
(
1
,
2
,
3
,
4
);
glm
::
hvec4
B
(
A
);
glm
::
vec4
C
(
1
,
2
,
3
,
4
);
glm
::
hvec4
D
(
C
);
glm
::
dvec4
E
(
1
,
2
,
3
,
4
);
glm
::
hvec4
F
(
E
);
glm
::
hvec4
G
(
1
,
2.0
,
3
,
4
);
glm
::
hvec4
H
;
H
=
A
;
Error
+=
A
==
B
?
0
:
1
;
//Error += C == D ? 0 : 1;
//Error += E == F ? 0 : 1;
Error
+=
A
==
G
?
0
:
1
;
Error
+=
A
==
H
?
0
:
1
;
}
{
glm
::
hvec4
A
(
1
);
glm
::
vec4
B
(
1
);
//Error += A == B ? 0 : 1;
}
return
Error
;
}
int
test_hvec2_size
()
{
int
Error
=
0
;
Error
+=
sizeof
(
glm
::
hvec2
)
<=
sizeof
(
glm
::
lowp_vec2
)
?
0
:
1
;
Error
+=
4
==
sizeof
(
glm
::
hvec2
)
?
0
:
1
;
Error
+=
glm
::
hvec2
().
length
()
==
2
?
0
:
1
;
return
Error
;
}
int
test_hvec3_size
()
{
int
Error
=
0
;
Error
+=
sizeof
(
glm
::
hvec3
)
<=
sizeof
(
glm
::
lowp_vec3
)
?
0
:
1
;
Error
+=
6
<=
sizeof
(
glm
::
hvec3
)
?
0
:
1
;
Error
+=
glm
::
hvec3
().
length
()
==
3
?
0
:
1
;
return
Error
;
}
int
test_hvec4_size
()
{
int
Error
=
0
;
Error
+=
sizeof
(
glm
::
hvec4
)
<=
sizeof
(
glm
::
lowp_vec4
)
?
0
:
1
;
Error
+=
8
<=
sizeof
(
glm
::
hvec4
)
?
0
:
1
;
Error
+=
glm
::
hvec4
().
length
()
==
4
?
0
:
1
;
return
Error
;
}
int
main
()
{
int
Error
=
0
;
Error
+=
test_hvec2_size
();
Error
+=
test_hvec3_size
();
Error
+=
test_hvec4_size
();
Error
+=
test_half_ctor_vec2
();
Error
+=
test_half_ctor_vec3
();
Error
+=
test_half_ctor_vec4
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录