Compare commits

..

No commits in common. "main" and "dev-wuyize" have entirely different histories.

662 changed files with 28811 additions and 56749 deletions

2
.gitignore vendored
View File

@ -362,5 +362,3 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/UnitTest/Qt.x64.runsettings
/ArchitectureColoredPainting/ClassDiagram.cd
/ArchitectureColoredPainting/res/Shaders/Fxaa3_11.glsl

493
4_L0.json Normal file
View File

@ -0,0 +1,493 @@
{
"background-color": "#ae9f86",
"elements": [
{
"data": {
"include": "/svg/2.svg"
},
"name": "ababa",
"type": "svg-file"
},
{
"data": {
"include": "/svg/0.svg"
},
"name": "ababa2",
"type": "svg-file"
},
{
"data": {
"include": "/svg/4_L0.svg"
},
"name": "4_L0.svg",
"type": "svg-file"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "图源工",
"type": "group"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "图源万",
"type": "group"
}
],
"height": 1080,
"project-name": "样例1",
"root-layer": {
"children": [
{
"children": [
{
"children": [
{
"element": 2,
"is-folder": false,
"name": "4_L0",
"styles": [
{
"material": "AH8A/1JOff8=",
"type": "fill"
},
{
"enableEachSideIndependent": true,
"left": "AAAAQAEAJJwAf///9c19/w==",
"right": "AADgQAAACpw=",
"type": "stroke"
}
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "工",
"referenced-by": 3,
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "1",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 103,
"y": -1
},
"rotation": 90,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "2",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 104,
"y": 100
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "3",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 3,
"y": 102
},
"rotation": 90,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "子图层-1",
"referenced-by": 4,
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-2",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 204,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-3",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 3,
"y": 205
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-4",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 207,
"y": 203
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-5",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 407,
"y": -2
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-6",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 411,
"y": 201
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-7",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 6,
"y": 408
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-8",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 210,
"y": 408
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-9",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 414,
"y": 405
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-10",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 610,
"y": -3
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-11",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 614,
"y": 200
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-12",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 617,
"y": 405
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-13",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": -3,
"y": -202
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-14",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 200,
"y": -203
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-15",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 402,
"y": -205
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-16",
"styles": [
],
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 606,
"y": -206
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "root",
"referenced-by": null,
"transform": {
"filpX": false,
"filpY": false,
"offset": {
"x": 116,
"y": 288
},
"rotation": 60,
"scale": {
"x": 1.85202,
"y": 1.85202
}
}
},
"width": 1080
}

View File

@ -32,12 +32,12 @@
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
<QtInstall>5.15.2_msvc2019_64</QtInstall>
<QtModules>core;xml;gui;svg;widgets;concurrent;core-private;gui-private;widgets-private</QtModules>
<QtModules>core;xml;gui;svg;widgets;core-private;gui-private;widgets-private</QtModules>
<QtBuildConfig>debug</QtBuildConfig>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
<QtInstall>5.15.2_msvc2019_64</QtInstall>
<QtModules>core;xml;gui;svg;widgets;concurrent;core-private;gui-private;widgets-private</QtModules>
<QtModules>core;gui;widgets</QtModules>
<QtBuildConfig>release</QtBuildConfig>
</PropertyGroup>
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
@ -61,14 +61,9 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(SolutionDir)ArchitectureColoredPainting\src\Editor\RightBar;$(SolutionDir)ArchitectureColoredPainting\src\Editor\;$(SolutionDir)FramelessHelper\include;$(SolutionDir)FramelessHelper\qmake\inc\core;$(SolutionDir)FramelessHelper\include\FramelessHelper\Core;$(SolutionDir)qt-material-widgets\components;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>FRAMELESSHELPER_WIDGETS_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(SolutionDir)QGoodWindow;%(AdditionalIncludeDirectories);$(Qt_INCLUDEPATH_)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@ -110,12 +105,6 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\Editor\Properties\MaterialReplaceDialog.cpp" />
<ClCompile Include="src\Editor\util\JsonMerger.cpp" />
<ClCompile Include="src\Editor\Properties\ProjectPropertyWidget.cpp" />
<ClCompile Include="src\Editor\Properties\ProjectPropertyDialog.cpp" />
<ClCompile Include="src\Editor\Properties\CanvasPropertyWidget.cpp" />
<ClCompile Include="src\Editor\Properties\PropertyWidget.cpp" />
<ClCompile Include="src\Editor\EditorWidgetComponent\LayerContainerListWidget.cpp" />
<ClCompile Include="src\Editor\DataManager\ProjectDataManager.cpp" />
<ClCompile Include="src\Editor\EditorWidgetComponent\FillStyleWidget.cpp" />
@ -140,11 +129,9 @@
<ClCompile Include="src\Editor\util\PainterPathUtil.cpp" />
<ClCompile Include="src\Editor\util\PaintingUtil.cpp" />
<ClCompile Include="src\Editor\util\SvgFileLoader.cpp" />
<ClCompile Include="src\FlowLayout.cpp" />
<ClCompile Include="src\FluentMenu.cpp" />
<ClCompile Include="src\FluentMenuButton.cpp" />
<ClCompile Include="src\gl.c" />
<ClCompile Include="src\Library\LibraryWidget.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\MainWindow.cpp" />
<ClCompile Include="src\NavigationBarWidget.cpp" />
@ -166,13 +153,10 @@
<ClCompile Include="src\Renderer\Painting\Painting.cpp" />
<ClCompile Include="src\Renderer\PaintingMesh.cpp" />
<ClCompile Include="src\Renderer\Preview\ElementRenderer.cpp" />
<ClCompile Include="src\Renderer\Preview\PaintingRenderer.cpp" />
<ClCompile Include="src\Renderer\RendererGLWidget.cpp" />
<ClCompile Include="src\Renderer\RendererWidget.cpp" />
<ClCompile Include="src\Renderer\Painting\ShortCutTree.cpp" />
<ClCompile Include="src\Renderer\Painting\StraightLine.cpp" />
<ClCompile Include="src\Renderer\RenderPass.cpp" />
<ClCompile Include="src\Renderer\Shader.cpp" />
<ClCompile Include="src\Renderer\VirtualTextureManager.cpp" />
<ClCompile Include="src\SvgParser.cpp" />
<ClCompile Include="src\Editor\EditorWidgetComponent\StrokeStyleWidget.cpp" />
@ -180,9 +164,7 @@
<QtUic Include="EditorSettingWidget.ui" />
<QtUic Include="EditorWidget.ui" />
<QtUic Include="EditorWidgetItem.ui" />
<QtUic Include="LibraryWidget.ui" />
<QtUic Include="MainWindow.ui" />
<QtUic Include="PaintingItem.ui" />
<QtUic Include="RendererWidget.ui" />
<QtUic Include="src\Editor\EditorWidgetComponent\LayerCreateWidget.ui" />
</ItemGroup>
@ -207,16 +189,12 @@
<None Include="res\Shaders\painting.comp" />
<None Include="res\Shaders\painting.frag" />
<None Include="res\Shaders\painting.vert" />
<None Include="res\Shaders\painting_shadow.frag" />
<None Include="res\Shaders\shader.frag" />
<None Include="res\Shaders\shader.vert" />
<None Include="res\Shaders\shadow_mapping.comp" />
<None Include="res\Shaders\skybox.frag" />
<None Include="res\Shaders\skybox.vert" />
<None Include="res\Shaders\ssao.comp" />
<None Include="res\Shaders\ssao_blur.comp" />
<None Include="res\Shaders\ssgi.comp" />
<None Include="res\Shaders\tone_mapping.comp" />
</ItemGroup>
<ItemGroup>
<QtMoc Include="src\Editor\EditorWidgetComponent\StrokeStyleWidget.h" />
@ -230,13 +208,6 @@
<QtMoc Include="src\Editor\RightBar\EditorSettingWidget.h" />
<QtMoc Include="src\Editor\EditorWidgetComponent\FillStyleWidget.h" />
<QtMoc Include="src\Editor\EditorWidgetComponent\LayerContainerListWidget.h" />
<QtMoc Include="src\Editor\Properties\CanvasPropertyWidget.h" />
<QtMoc Include="src\Editor\Properties\ProjectPropertyDialog.h" />
<QtMoc Include="src\Editor\Properties\ProjectPropertyWidget.h" />
<QtMoc Include="src\Editor\Properties\MaterialReplaceDialog.h" />
<ClInclude Include="src\Editor\util\JsonMerger.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="src\Editor\Properties\PropertyWidget.h" />
<ClInclude Include="src\Editor\DataManager\ProjectDataManager.h" />
<ClInclude Include="src\ColorHelper.hpp" />
<ClInclude Include="src\Editor\LayerWrapper.h" />
@ -257,9 +228,7 @@
<ClInclude Include="src\Editor\util\PaintingUtil.h" />
<ClInclude Include="src\Editor\util\SvgFileLoader.h" />
<QtMoc Include="src\FluentMenu.h" />
<ClInclude Include="src\FlowLayout.h" />
<ClInclude Include="src\FluentMenuButton.h" />
<QtMoc Include="src\Library\LibraryWidget.h" />
<ClInclude Include="src\Renderer\IblUtils.h" />
<ClInclude Include="src\Renderer\Painting\BaseStyle.h" />
<ClInclude Include="src\Renderer\Painting\CubicBezierSignedDistance.h" />
@ -270,9 +239,6 @@
<ClInclude Include="src\Renderer\Painting\MaterialStyleStroke.h" />
<ClInclude Include="src\Renderer\Painting\Painting.h" />
<ClInclude Include="src\Renderer\Preview\ElementRenderer.h" />
<ClInclude Include="src\Renderer\Preview\PaintingRenderer.h" />
<ClInclude Include="src\Renderer\RenderPass.h" />
<ClInclude Include="src\Renderer\Shader.h" />
<ClInclude Include="src\Renderer\VirtualTextureManager.h" />
<ClInclude Include="src\SvgParser.h" />
<QtMoc Include="src\NavigationBarWidget.h" />
@ -302,12 +268,6 @@
<Project>{8f360763-a045-3808-87a9-3fae38e69819}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="res\images\icon.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />

View File

@ -100,12 +100,6 @@
<QtUic Include="EditorLayerInfoWidget.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="LibraryWidget.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="PaintingItem.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Editor\EditorWidgetItem.cpp">
@ -276,39 +270,6 @@
<ClCompile Include="src\Editor\EditorWidgetComponent\LayerContainerListWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Editor\Properties\PropertyWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Editor\Properties\CanvasPropertyWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Editor\Properties\ProjectPropertyDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Editor\Properties\ProjectPropertyWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Renderer\Preview\PaintingRenderer.cpp">
<Filter>Source Files\Renderer\Preview</Filter>
</ClCompile>
<ClCompile Include="src\Editor\util\JsonMerger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Editor\Properties\MaterialReplaceDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Library\LibraryWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\FlowLayout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Renderer\RenderPass.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Renderer\Shader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="src\Renderer\RendererGLWidget.h">
@ -371,21 +332,6 @@
<QtMoc Include="src\Editor\ElementManager.h">
<Filter>Header Files\Editor\Element</Filter>
</QtMoc>
<QtMoc Include="src\Editor\Properties\CanvasPropertyWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="src\Editor\Properties\ProjectPropertyDialog.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="src\Editor\Properties\ProjectPropertyWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="src\Editor\Properties\MaterialReplaceDialog.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="src\Library\LibraryWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<None Include="..\data.json" />
@ -464,10 +410,6 @@
<None Include="res\Shaders\pageId_downsample.comp">
<Filter>Resource Files\Shaders</Filter>
</None>
<None Include="res\Shaders\tone_mapping.comp" />
<None Include="res\Shaders\painting_shadow.frag" />
<None Include="res\Shaders\ssao.comp" />
<None Include="res\Shaders\ssao_blur.comp" />
</ItemGroup>
<ItemGroup>
<QtUic Include="EditorWidgetItem.ui">
@ -601,37 +543,10 @@
<ClInclude Include="src\FluentMenuButton.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Editor\Properties\PropertyWidget.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Renderer\Preview\PaintingRenderer.h">
<Filter>Header Files\Renderer\Preview</Filter>
</ClInclude>
<ClInclude Include="src\Editor\util\JsonMerger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\FlowLayout.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Renderer\RenderPass.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Renderer\Shader.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<QtRcc Include="res\MainWindow.qrc">
<Filter>Resource Files</Filter>
</QtRcc>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="res\images\icon.ico" />
</ItemGroup>
</Project>

View File

@ -54,19 +54,6 @@
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QPushButton" name="resizeButton">
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>设置画布尺寸</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@ -70,9 +70,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>0</width>
<height>0</height>
<y>-17</y>
<width>1024</width>
<height>1024</height>
</rect>
</property>
<property name="sizePolicy">
@ -83,14 +83,14 @@
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
<width>1024</width>
<height>1024</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
<width>1024</width>
<height>1024</height>
</size>
</property>
</widget>
@ -98,7 +98,7 @@
</item>
<item>
<widget class="QWidget" name="RightBar" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,3,2">
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="3,2">
<property name="spacing">
<number>20</number>
</property>
@ -115,23 +115,27 @@
<number>11</number>
</property>
<item>
<widget class="QLabel" name="LayerDisplayLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QTabWidget" name="DisplayTab">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="InfoDisplayWidget" name="LayerDisplay">
<attribute name="title">
<string>图层信息</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</attribute>
</widget>
<widget class="EditorSettingWidget" name="EditorSetting">
<attribute name="title">
<string>设置</string>
</attribute>
</widget>
</widget>
</item>
<item>
<widget class="InfoDisplayWidget" name="LayerDisplay" native="true"/>
</item>
<item>
<widget class="LayerTreeWidget" name="LayerTree">
@ -229,6 +233,12 @@
<header>ElementPoolWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>EditorSettingWidget</class>
<extends>QWidget</extends>
<header location="global">EditorSettingWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LibraryWidgetClass</class>
<widget class="QWidget" name="LibraryWidgetClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1124</width>
<height>695</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="classComboBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="amountLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="flowWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1106</width>
<height>639</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -43,7 +43,6 @@
<item row="0" column="0">
<widget class="QStackedWidget" name="stackedWidget">
<widget class="EditorWidget" name="editorWidget"/>
<widget class="Library::LibraryWidget" name="libraryWidget"/>
<widget class="Renderer::RendererWidget" name="rendererWidget"/>
</widget>
</item>
@ -63,12 +62,6 @@
<extends>QWidget</extends>
<header>Editor/EditorWidget.h</header>
</customwidget>
<customwidget>
<class>Library::LibraryWidget</class>
<extends>QWidget</extends>
<header>Library/LibraryWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -1,2 +1,2 @@
17876391417123941155.jpg paintings/4_L0/4_L0.json 0 0 1 1
11474523244911310074.jpg paintings/4/4.json 0 0 1 1
17876391417123941155.jpg 0.json 0 0 1 1
11474523244911310074.jpg 1.json 0 0 1 1

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38.66 57"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M.81,0C.12,12.47.64,23.24,1.87,29.9c1.85,10,3.32,18,10.21,22.72,5.59,3.83,15.45,6,21.45.77,2.53-2.22,4.92-5.91,4.6-10a9.27,9.27,0,0,0-2-5.55,1.84,1.84,0,0,0-2.16-.51c-.67.36-1.39,1.08-1.11,1.79s1.81,1,2.85.59"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 468 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132.41 212.39"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M913.32,439.45c-11.51,0-22-31.5-26.41-54.39-3.31-17.24-7.69-41.49.51-71.48,2.17-7.9,9.92-33.44,30.57-56.46,9.91-11.05,29.52-29,29.52-29a125.61,125.61,0,0,1,26.42,18.12,123.6,123.6,0,0,1,27.45,35.23c9,17.55,11.23,32.73,12.43,41.44,3.34,24.16-.39,42.85-2.59,53.35-2.88,13.77-8.8,26-20.64,50.48-2.24,4.62-6.58,13.33-13,13.75-3.28.21-4.53-1.88-9.84-4.66a48.86,48.86,0,0,0-24.34-5.18c-7.72.26-13.85,2.44-18.65,4.14C916.41,437.74,916,439.45,913.32,439.45Z" transform="translate(-882.73 -228.12)"/></svg>

Before

Width:  |  Height:  |  Size: 669 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150.07 140.14"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M814.91,563.25a68.61,68.61,0,0,0-17.1,14.51,75,75,0,0,0-9.32,14.5c-3.6,7-5.36,12.57-7.77,20.2-.79,2.49-2.08,7.36-4.66,17.09-3.59,13.53-4.16,16.2-4.66,19.69s.06.85-1,14.5c-.48,6-.69,7.7.52,8.81,2.26,2.07,6-1.19,14.5-2.08,3.59-.37,7.57.1,15.54,1,9.28,1.09,8.87,1.62,14,2.07,8.71.78,15.42-.26,23.82-1.55,7.65-1.18,11.47-1.77,16.58-3.63A61.4,61.4,0,0,0,873.44,658c1.77-1.47,8.2-7,16.57-21.75,5.28-9.29,4.16-9.62,11.92-26.42,5.12-11.09,9.43-22.55,14.5-33.67,2.38-5.21,5.16-11.14,2.59-15.54-1.78-3-5-3.39-8.8-5.18-10.3-4.79-10.91-13.35-16.58-18.13C877.88,524.07,835.51,550.43,814.91,563.25Z" transform="translate(-769.98 -533.71)"/></svg>

Before

Width:  |  Height:  |  Size: 804 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 125.59 140.06"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M946,430.61a63.41,63.41,0,0,0-18,3.05,52.54,52.54,0,0,0-20.86,12c-5.59,5.4-8.16,10.56-11.92,18.13-2.87,5.8-6.93,14.12-8.8,25.9a78.11,78.11,0,0,0,.78,29.25,66.55,66.55,0,0,0,13.91,28.78A63.83,63.83,0,0,0,970.3,567.4c5.76-1.81,15.86-5.12,24.87-14.51s11.83-19.42,13.46-25.38c4.2-15.3,1.86-27.85,0-37.81s-4-21.77-13-34.19c-3.54-4.94-10.09-13.87-22.27-19.68C961.83,430.3,951.22,430.46,946,430.61Z" transform="translate(-885.39 -430.56)"/></svg>

Before

Width:  |  Height:  |  Size: 611 B

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 387.48 240.17"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M148.59,482.78c15.46,22.43,45,58.45,93.24,84.61a256.52,256.52,0,0,0,77.7,27.28,239.38,239.38,0,0,0,57.66,2.76c17.92-1.35,40.71-3.08,66.65-15.19A163,163,0,0,0,507.38,528c7-10.06,26.87-39.53,28.66-81.5,0,0,1.41-32.95-15.19-66.64-3.31-6.72-8.08-14.77-17.27-19-2.46-1.13-12.29-5.66-22.1-.69-7.14,3.63-13.6,12-12.08,18.65,1.85,8.17,15.89,15.08,34.18,11.05" transform="translate(-148.59 -357.91)"/></svg>

Before

Width:  |  Height:  |  Size: 570 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 369 292.11"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M749,200c4.43-17.3,22.4-78.56,81-114,36-21.8,71.16-24,92-25,25.62-1.28,75.88-3.79,123,29,71.9,50,73,138.09,73,143-.08,19.3-.29,71.77-39,101-19.94,15.05-41.15,17.37-48,18-41.13,3.78-96.62-14.85-114-62-13.32-36.14,2.58-70.23,7-79" transform="translate(-749 -60.37)"/></svg>

Before

Width:  |  Height:  |  Size: 440 B

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230.86 225.05"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M1111.83,280.35c6.17,16.23,20.24,45.83,50.77,68.89,11.93,9,29.94,22.26,57,25.38,33,3.8,57.82-9.95,65.78-14.5A115.33,115.33,0,0,0,1332,309.35c2.73-5.88,23.6-53-1.56-100.49-17-32.16-53.06-60.62-94.27-58.53-20.46,1-36.19,9.31-45.06,15" transform="translate(-1111.83 -150.22)"/></svg>

Before

Width:  |  Height:  |  Size: 452 B

View File

@ -1 +0,0 @@
<svg id="图层_4" data-name="图层 4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 82.97 81.32"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M1031,55c3.85,12.26,9.48,17.33,14,19.69,4.23,2.2,7.34,1.94,13.47,5.69,4.43,2.71,7.32,5.7,10.88,9.33,4,4.07,4.84,5.69,10.88,11.91,4.16,4.3,5.31,5.12,6.21,5.7,4,2.58,6.41,2.33,11.92,4.14,5.73,1.89,10.25,3.37,13,6.74,4.52,5.65,2.21,14.5,1,18.13" transform="translate(-1031.03 -55.02)"/></svg>

Before

Width:  |  Height:  |  Size: 459 B

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38.66 57"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M.81,0C.12,12.47.64,23.24,1.87,29.9c1.85,10,3.32,18,10.21,22.72,5.59,3.83,15.45,6,21.45.77,2.53-2.22,4.92-5.91,4.6-10a9.27,9.27,0,0,0-2-5.55,1.84,1.84,0,0,0-2.16-.51c-.67.36-1.39,1.08-1.11,1.79s1.81,1,2.85.59"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 468 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2486.79 1894.11">
<title>biankuang</title>
<rect x="0.5" y="0.5" width="2485.79" height="1893.11" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 213 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 292.05 208.4">
<title>changJ</title>
<path d="M158.18-81.15C139.41-27.59,70.72,31.33,27.87,45.84c-70.12,23.74-154,.87-160.12-71.22-4.42-52.46,13.8-92.76,53.56-116,27.89-16.27,70.05-15.29,91.4,6.07,21.54,21.53,8.16,52.76-.85,61.84C3.74-65.24-9.26-64.64-14.4-67.09A11.69,11.69,0,0,1-20.33-80.5c1.37-5.43,7-9.65,14.28-6.74A5.44,5.44,0,0,1-2.6-80.8" transform="translate(133.4 153.03)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 497 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 114.87 185.42">
<title>duanJ</title>
<path d="M-186.33-16.19c-70.52,9.38-121.87,65.84-113.39,123,6.54,44.07,52.94,71.66,78.22,57.91,25.72-14,23.58-42.55,3.22-52.55-5.69-2.8-14.54-3.61-20.72-1.43s-8.93,8.57-6.89,12.51c1.82,3.52,4.45,5.31,8,5.48,5.62.27,6.7-4.06,6.7-4.06" transform="translate(301.14 16.69)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 422 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 155.8 283.83">
<title>houbanJ</title>
<path d="M-225.88,282.68c81-31.64,138.8-91.31,153.49-177,8.7-50.8-18.78-88.12-50.26-105.92" transform="translate(226.06 0.68)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 280 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 84.26 18.74">
<title>hu</title>
<path d="M257.42,90.62c15.49,22.88,67.94,25,83.43,0" transform="translate(-257.01 -90.34)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 238 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78.67 94.24">
<title>huaban</title>
<path d="M306.77-206.23c-15.21,0-32.25-23-38.66-41.61-10-29,11.5-34,19.91-34.82a4,4,0,0,0,3.56-3.3c3.3-18.19,23.44-17.7,27.49-.38a4.38,4.38,0,0,0,4,3.32c7.48.54,25.11,3.49,18.82,30.06C339.32-242.22,321.71-206.21,306.77-206.23Z" transform="translate(-265.02 299.96)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 417 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456.05 403.05">
<title>tuoyuan</title>
<path d="M300.18,183c144.72-.06,230.41,77.65,230.61,191C531,494.57,446.73,585,305.1,585,172.6,585,75.67,501,75.75,377.61,75.81,265.34,158.13,183.05,300.18,183Z" transform="translate(-75.25 -182.48)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 353 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31.28 179.75">
<title>yezi</title>
<path d="M-789.16,247c-63.35-70.42,2.48-107.35,2.75-131.39.21-18.15-4-30.2-14.14-47.77" transform="translate(817.18 -67.58)" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 275 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100.45 1"><defs><style>.cls-1{fill:none;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><line class="cls-1" y1="0.5" x2="100.45" y2="0.5"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 288 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 168.53 311.11"><defs><style>.cls-1{fill:#fff;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><rect class="cls-1" x="0.5" y="0.5" width="167.53" height="310.11"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 310 B

View File

@ -1,548 +0,0 @@
{
"background-color": "#bd8e24",
"elements": [
{
"data": {
"include": "/svg/2.svg"
},
"name": "ababa",
"type": "svg-file"
},
{
"data": {
"include": "/svg/0.svg"
},
"name": "ababa2",
"type": "svg-file"
},
{
"data": {
"include": "/svg/4_L0.svg"
},
"name": "4_L0.svg",
"type": "svg-file"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "图源工",
"type": "group"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "图源万",
"type": "group"
},
{
"data": {
"include": "/svg/正方形.svg"
},
"name": "正方形.svg",
"type": "svg-file"
}
],
"height": 1080,
"metallic": 1,
"project-name": "样例1",
"root-layer": {
"children": [
{
"element": 5,
"is-folder": false,
"name": "边框",
"styles": [
{
"enableEachSideIndependent": true,
"left": "AADgQAAAAAADACScAH9mZuZUOf8Af8zM64dX/wB////vv3b/",
"right": "AADgQAAAAAAAAAqc",
"type": "stroke"
}
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 480,
"y": 482
},
"rotation": 0,
"scale": {
"x": 9.40621,
"y": 9.40621
}
}
},
{
"children": [
{
"children": [
{
"children": [
{
"element": 2,
"is-folder": false,
"name": "4_L0",
"styles": [
{
"material": "AH8A/1JOff8=",
"type": "fill"
},
{
"enableEachSideIndependent": true,
"left": "AAAAQAAAAAABACScAH////XNff8=",
"right": "AADgQAAAAAAAAAqc",
"type": "stroke"
}
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "工",
"referenced-by": 3,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "1",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 103,
"y": -1
},
"rotation": 90,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "2",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 104,
"y": 100
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "3",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 3,
"y": 102
},
"rotation": 90,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "子图层-1",
"referenced-by": 4,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-2",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 204,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-3",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 3,
"y": 205
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-4",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 207,
"y": 203
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-5",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 407,
"y": -2
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-6",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 411,
"y": 201
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-7",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 6,
"y": 408
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-8",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 210,
"y": 408
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-9",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 414,
"y": 405
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-10",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 610,
"y": -3
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-11",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 614,
"y": 200
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-12",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 617,
"y": 405
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-13",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": -3,
"y": -202
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-14",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 200,
"y": -203
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-15",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 402,
"y": -205
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 4,
"is-folder": false,
"name": "子图层-16",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 606,
"y": -206
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "content",
"referenced-by": null,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 116,
"y": 288
},
"rotation": 60,
"scale": {
"x": 1.85202,
"y": 1.85202
}
}
}
],
"is-folder": true,
"name": "root",
"referenced-by": null,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
"roughness": 0.10000000149011612,
"width": 1080
}

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 106.93 99.81"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>0</title><g id="图层_2" data-name="图层 2"><polyline class="cls-1" points="27.24 16.75 27.24 2.15 7.2 2.15 7.2 22.78 46.7 22.78"/></g><g id="图层_3" data-name="图层 3"><polyline class="cls-1" points="27.24 30.37 27.24 44.97 0 44.97"/></g><g id="图层_4" data-name="图层 4"><path class="cls-1" d="M292.82,107.78s0,0,0,0,0,3.59,0,7.62c0,3.85,0,5.78.06,6.43a19.94,19.94,0,0,0,2.87,7.58,15.85,15.85,0,0,0,6.61,6.23A14.75,14.75,0,0,0,310,137a11.69,11.69,0,0,0,7.59-2.92,11,11,0,0,0,3.2-6.84c.15-1.27.58-4.84-1.79-7.64a8.54,8.54,0,0,0-3.56-2.44c-1.32-.52-3.32-1.31-5.06-.33a5.41,5.41,0,0,0-2.14,3,3.48,3.48,0,0,0-.16,2.71c.78,1.86,3.36,2.14,3.47,2.15" transform="translate(-287.18 -56.2)"/></g><g id="图层_5" data-name="图层 5"><path class="cls-1" d="M339.72,85.41V58.75a69.07,69.07,0,0,1,14.79,0c5.9.63,9.31,1,12.84,3.5,1.76,1.22,6.37,4.43,6.68,9.92.25,4.38-2.27,9.26-6.72,11-3.5,1.39-8.46,1-10.71-2.06-.14-.18-2-2.82-.92-5.46.63-1.51,2.34-3.23,4.28-2.92a3.76,3.76,0,0,1,2.33,1.55" transform="translate(-287.18 -56.2)"/></g><g id="图层_6" data-name="图层 6"><path class="cls-1" d="M301.38,145.93a8.21,8.21,0,0,1-.77,5.83c-.26.44-2.5,4.23-5.84,3.7a5,5,0,0,1-3.89-3.5c-.1-.35-1-3,.58-4.09a3.28,3.28,0,0,1,3.89.58" transform="translate(-287.18 -56.2)"/><path class="cls-1" d="M323.18,115.76a7.37,7.37,0,0,1,7.39-8.17c.49,0,4.07.12,5.65,2.92.19.34,1.52,2.7.19,4.67a4.33,4.33,0,0,1-4.67,1.56" transform="translate(-287.18 -56.2)"/></g><g id="图层_7" data-name="图层 7"><path class="cls-1" d="M352.17,86.57a14.23,14.23,0,0,0-4.67,2.73c-1.59,1.4-3.37,3-3.5,5.45a6.45,6.45,0,0,0,2.14,4.86c1.28,1.1,3.68,2.22,5.84,1.17,1.64-.8,3.31-3,2.53-4.67a3.6,3.6,0,0,0-3.31-1.75" transform="translate(-287.18 -56.2)"/><path class="cls-1" d="M382.34,66.53a17.27,17.27,0,0,0,3.89.39c2.16,0,3.53,0,4.86-1a6.15,6.15,0,0,0,2.34-3.89c.17-1,.53-2.93-.78-4.29a4.32,4.32,0,0,0-4.48-.77A3.62,3.62,0,0,0,386,58.75a3.75,3.75,0,0,0,.2,3.31" transform="translate(-287.18 -56.2)"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27.74 15.09"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>2</title><polyline class="cls-1" points="27.24 0 27.24 14.6 0 14.6"/></svg>

Before

Width:  |  Height:  |  Size: 265 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 116.45 116.45"><defs><style>.cls-1{fill:#fff;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><rect class="cls-1" x="0.5" y="0.5" width="115.45" height="115.45"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 310 B

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38.66 57"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M.81,0C.12,12.47.64,23.24,1.87,29.9c1.85,10,3.32,18,10.21,22.72,5.59,3.83,15.45,6,21.45.77,2.53-2.22,4.92-5.91,4.6-10a9.27,9.27,0,0,0-2-5.55,1.84,1.84,0,0,0-2.16-.51c-.67.36-1.39,1.08-1.11,1.79s1.81,1,2.85.59"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 468 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 59.76 69.52"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M620.61,223.54a75.28,75.28,0,0,0-2.42,19.34,64.83,64.83,0,0,0,3.11,20.72c1.56,4.75,3.72,11.19,9.33,17.61,2.74,3.14,6.67,7.65,13.61,10.16a28.09,28.09,0,0,0,14.7,1.23,21.35,21.35,0,0,0,18.3-18c.53-2.47,1.72-8.13-1-14.16-.59-1.29-4.1-9-10.71-9.67-2.55-.26-6.79.4-8,3.33a5,5,0,0,0,1.76,6c2.09,1.27,5.26.52,6.9-2.07" transform="translate(-618.19 -223.54)"/></svg>

Before

Width:  |  Height:  |  Size: 528 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.97 47.91"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M671.72,302.62a78.23,78.23,0,0,1,12.78,1.73c4.86,1.06,8.45,1.84,12.77,4.14A36,36,0,0,1,708,317.12c2,2.43,5.68,7,6.56,13.82a18.18,18.18,0,0,1-1.73,10.35,16.13,16.13,0,0,1-7.94,7.95c-1.14.49-6.79,2.83-11.74-.35a11.67,11.67,0,0,1-4.84-7.25c-.39-1.72-1.06-4.64.7-6.22,1.39-1.25,4.3-1.65,5.63.08a4,4,0,0,1-1.15,5.45" transform="translate(-671.72 -302.62)"/></svg>

Before

Width:  |  Height:  |  Size: 528 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64.46 48.66"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M706.94,231.14a47.13,47.13,0,0,1,.69-13.13,34.05,34.05,0,0,1,4.43-12.38,30.82,30.82,0,0,1,10.42-10.06A35.84,35.84,0,0,1,747,191.08a30.08,30.08,0,0,1,15.64,7.53,25.72,25.72,0,0,1,8.19,14.57,22.41,22.41,0,0,1-2.07,14.5c-5.47,10.17-17.13,11.3-18.31,11.4-2.36.19-6.84.55-10.89-2.31-.79-.56-5.83-4.12-5.34-9.43.24-2.51,1.74-5.78,4.84-6.91,3.4-1.24,7.82.43,8,2.33.23,2.08-4.61,4.11-4.91,4.23" transform="translate(-706.76 -190.54)"/></svg>

Before

Width:  |  Height:  |  Size: 603 B

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 137.06 95.62"><defs><style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;}</style></defs><polyline class="cls-1" points="0.5 22.6 0.5 95.12 136.56 95.12 136.56 0.5 21.57 0.5 21.57 69.56 100.3 69.56 100.8 24.23 39.42 23.6"/></svg>

Before

Width:  |  Height:  |  Size: 321 B

View File

@ -1 +0,0 @@
<svg id="图层_4" data-name="图层 4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21.96 65.56"><defs><style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;}</style></defs><path class="cls-1" d="M677.25,145.44c4.22-4.24,7.48-7.5,9.36-9.36,6.33-6.29,7.87-7.75,9.36-10.8,1-2.06,3.2-6.55,2.08-11.56-.8-3.55-2.48-3.86-6.4-9.67s-7.09-10.49-6.12-15.48c.29-1.53,1.3-4.72,5.76-7.92" transform="translate(-676.89 -80.24)"/></svg>

Before

Width:  |  Height:  |  Size: 428 B

View File

@ -1 +0,0 @@
<svg id="图层_5" data-name="图层 5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.87 57.01"><defs><style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;}</style></defs><path class="cls-1" d="M797.48,319.31a41.11,41.11,0,0,0,10.8,19.8A39.13,39.13,0,0,0,831,350.63c3.82.49,17.95,2.28,28.08-7.92,8.67-8.73,8.43-20.25,8.28-23-.17-3.09-.67-10.33-6.12-16.56-1.39-1.58-8.41-9.16-17.64-7.92-1.44.2-6.14.83-9,4.68-3.9,5.25-2.45,13.86,2.52,17.64.23.18,4,2.88,8.28,1.8.85-.21,4.37-1.09,4.68-3.6a4.07,4.07,0,0,0-3.6-4.32,4,4,0,0,0-3.6,2.16" transform="translate(-796.99 -294.56)"/></svg>

Before

Width:  |  Height:  |  Size: 587 B

View File

@ -1 +0,0 @@
<svg id="图层_6" data-name="图层 6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20.42 57.45"><defs><style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;}</style></defs><path class="cls-1" d="M818.36,343.43a28.43,28.43,0,0,1-15.48-11.52c-6.3-9.79-3.85-20.09-3.24-22.68,3.53-14.85,16.79-21.4,18.72-22.32" transform="translate(-798.16 -286.46)"/></svg>

Before

Width:  |  Height:  |  Size: 361 B

View File

@ -1 +0,0 @@
<svg id="图层_7" data-name="图层 7" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451 684.5"><defs><style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;}</style></defs><rect class="cls-1" x="0.5" y="0.5" width="450" height="683.5"/></svg>

Before

Width:  |  Height:  |  Size: 248 B

View File

@ -1 +0,0 @@
<svg id="图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 125.59 140.06"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M946,430.61a63.41,63.41,0,0,0-18,3.05,52.54,52.54,0,0,0-20.86,12c-5.59,5.4-8.16,10.56-11.92,18.13-2.87,5.8-6.93,14.12-8.8,25.9a78.11,78.11,0,0,0,.78,29.25,66.55,66.55,0,0,0,13.91,28.78A63.83,63.83,0,0,0,970.3,567.4c5.76-1.81,15.86-5.12,24.87-14.51s11.83-19.42,13.46-25.38c4.2-15.3,1.86-27.85,0-37.81s-4-21.77-13-34.19c-3.54-4.94-10.09-13.87-22.27-19.68C961.83,430.3,951.22,430.46,946,430.61Z" transform="translate(-885.39 -430.56)"/></svg>

Before

Width:  |  Height:  |  Size: 611 B

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 387.48 240.17"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M148.59,482.78c15.46,22.43,45,58.45,93.24,84.61a256.52,256.52,0,0,0,77.7,27.28,239.38,239.38,0,0,0,57.66,2.76c17.92-1.35,40.71-3.08,66.65-15.19A163,163,0,0,0,507.38,528c7-10.06,26.87-39.53,28.66-81.5,0,0,1.41-32.95-15.19-66.64-3.31-6.72-8.08-14.77-17.27-19-2.46-1.13-12.29-5.66-22.1-.69-7.14,3.63-13.6,12-12.08,18.65,1.85,8.17,15.89,15.08,34.18,11.05" transform="translate(-148.59 -357.91)"/></svg>

Before

Width:  |  Height:  |  Size: 570 B

View File

@ -1 +0,0 @@
<svg id="图层_4" data-name="图层 4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 82.97 81.32"><defs><style>.cls-1{fill:none;}</style></defs><path class="cls-1" d="M1031,55c3.85,12.26,9.48,17.33,14,19.69,4.23,2.2,7.34,1.94,13.47,5.69,4.43,2.71,7.32,5.7,10.88,9.33,4,4.07,4.84,5.69,10.88,11.91,4.16,4.3,5.31,5.12,6.21,5.7,4,2.58,6.41,2.33,11.92,4.14,5.73,1.89,10.25,3.37,13,6.74,4.52,5.65,2.21,14.5,1,18.13" transform="translate(-1031.03 -55.02)"/></svg>

Before

Width:  |  Height:  |  Size: 459 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100.45 1"><defs><style>.cls-1{fill:none;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><line class="cls-1" y1="0.5" x2="100.45" y2="0.5"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 288 B

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_2_1_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 40 21.6" style="enable-background:new 0 0 40 21.6;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#00FF1C;stroke-miterlimit:10;}
</style>
<polyline class="st0" points="20.5,15.1 20.5,0.5 0.5,0.5 0.5,21.1 29.6,21.1 "/>
</svg>

Before

Width:  |  Height:  |  Size: 527 B

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27.74 15.09"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>2</title><polyline class="cls-1" points="27.24 0 27.24 14.6 0 14.6"/></svg>

Before

Width:  |  Height:  |  Size: 265 B

View File

@ -1 +0,0 @@
<svg id="图层_4" data-name="图层 4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.07 30.28"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>3</title><path class="cls-1" d="M292.82,107.78s0,0,0,0,0,3.59,0,7.62c0,3.85,0,5.78.06,6.43a19.94,19.94,0,0,0,2.87,7.58,15.85,15.85,0,0,0,6.61,6.23A14.75,14.75,0,0,0,310,137a11.69,11.69,0,0,0,7.59-2.92,11,11,0,0,0,3.2-6.84c.15-1.27.58-4.84-1.79-7.64a8.54,8.54,0,0,0-3.56-2.44c-1.32-.52-3.32-1.31-5.06-.33a5.41,5.41,0,0,0-2.14,3,3.48,3.48,0,0,0-.16,2.71c.78,1.86,3.36,2.14,3.47,2.15" transform="translate(-292.3 -107.25)"/></svg>

Before

Width:  |  Height:  |  Size: 617 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38.66 57"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M.81,0C.12,12.47.64,23.24,1.87,29.9c1.85,10,3.32,18,10.21,22.72,5.59,3.83,15.45,6,21.45.77,2.53-2.22,4.92-5.91,4.6-10a9.27,9.27,0,0,0-2-5.55,1.84,1.84,0,0,0-2.16-.51c-.67.36-1.39,1.08-1.11,1.79s1.81,1,2.85.59"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 468 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28.63 21.43"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_5" data-name="图层 5"><path class="cls-1" d="M.5,19.21V.52c2.81-.05,6.84,0,9.38,0,3.71.09,9.65.46,11.89,1.9,1.76,1.22,6,3.85,6.34,9.34.25,4.38-1.66,6.63-6.11,8.37-3.5,1.39-8.46,1-10.71-2.06-.14-.18-2-2.82-.92-5.46.63-1.51,2.34-3.23,4.28-2.92A3.78,3.78,0,0,1,17,11.27"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 485 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.86 10.32"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_6" data-name="图层 6"><path class="cls-1" d="M.54,8.67A7.38,7.38,0,0,1,7.07.54a8.38,8.38,0,0,1,.86,0c.49,0,4.07.12,5.65,2.92.19.34,1.52,2.7.19,4.67A4.33,4.33,0,0,1,9.1,9.65"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 391 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12.07 10.2"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_6" data-name="图层 6"><path class="cls-1" d="M11.35.12A8.27,8.27,0,0,1,10.58,6c-.26.44-2.5,4.23-5.84,3.7A5,5,0,0,1,.85,6.15c-.1-.35-1-3,.58-4.09a3.26,3.26,0,0,1,3.89.58"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 386 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11.87 11.27"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_7" data-name="图层 7"><path class="cls-1" d="M.11,10.37A16.9,16.9,0,0,0,4,10.76c2.16,0,3.53,0,4.86-1A6.19,6.19,0,0,0,11.2,5.87c.17-1,.53-2.93-.78-4.29A4.34,4.34,0,0,0,5.94.81,3.6,3.6,0,0,0,3.77,2.59,3.71,3.71,0,0,0,4,5.9"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 439 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11.71 15.6"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_7" data-name="图层 7"><path class="cls-1" d="M8.67.47A14.17,14.17,0,0,0,4,3.2C2.41,4.6.63,6.2.5,8.65a6.44,6.44,0,0,0,2.14,4.86c1.28,1.1,3.68,2.22,5.84,1.17,1.64-.8,3.31-3,2.53-4.67A3.62,3.62,0,0,0,7.7,8.26"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 423 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.55 65.27"><defs><style>.cls-1{fill:none;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M.5,65.27a64.78,64.78,0,0,1,129.55,0"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 303 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100.45 1"><defs><style>.cls-1{fill:none;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><line class="cls-1" y1="0.5" x2="100.45" y2="0.5"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 288 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 168.53 311.11"><defs><style>.cls-1{fill:#fff;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><rect class="cls-1" x="0.5" y="0.5" width="167.53" height="310.11"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 310 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50.52 15.81"><defs><style>.cls-1{fill:#fff;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><polygon class="cls-1" points="0.5 0.5 50.02 0.5 50.02 4.2 27.23 4.2 27.23 15.31 23.29 15.31 23.29 4.2 0.5 4.2 0.5 0.5"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 361 B

View File

@ -1,262 +0,0 @@
{
"background-color": "#f9edba",
"elements": [
{
"data": {
"include": "/svg/T.svg"
},
"name": "T.svg",
"type": "svg-file"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "T",
"type": "group"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "图源T丄",
"type": "group"
},
{
"data": {
"reference-layer": "0.0"
},
"name": "图源3",
"type": "group"
}
],
"height": 16,
"metallic": 0,
"project-name": "样例1",
"root-layer": {
"children": [
{
"children": [
{
"children": [
{
"children": [
{
"element": 0,
"is-folder": false,
"name": "子图层-1",
"styles": [
{
"material": "AH8A/341HP8=",
"type": "fill"
}
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "子图层-1",
"referenced-by": 1,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 275,
"y": 26
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 1,
"is-folder": false,
"name": "子图层-2",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 31,
"y": -4
},
"rotation": 180,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "T丄",
"referenced-by": 2,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": -175,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 2,
"is-folder": false,
"name": "子图层-2",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 62,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 2,
"is-folder": false,
"name": "子图层-3",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 124,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "子图层",
"referenced-by": 3,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 0,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "子图层-2",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 186,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "子图层-3",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 372,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
{
"element": 3,
"is-folder": false,
"name": "子图层-4",
"styles": [
],
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": 558,
"y": 0
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
}
],
"is-folder": true,
"name": "root",
"referenced-by": null,
"transform": {
"flipX": false,
"flipY": false,
"offset": {
"x": -155,
"y": -24
},
"rotation": 0,
"scale": {
"x": 1,
"y": 1
}
}
},
"roughness": 0.5,
"width": 450
}

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout"/>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -81,87 +81,27 @@
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="ssaoCheckBox">
<property name="text">
<string>SSAO</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fxaaCheckBox">
<property name="text">
<string>FXAA</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<widget class="QListWidget" name="textureListWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Expanding">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>260</width>
<width>0</width>
<height>16777215</height>
</size>
</property>
<property name="tabPosition">
<enum>QTabWidget::West</enum>
</property>
<widget class="QWidget" name="textureTab">
<attribute name="title">
<string>纹理</string>
</attribute>
<layout class="QVBoxLayout" name="vboxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
</item>
<item>
<widget class="QListWidget" name="textureListWidget">
<property name="styleSheet">
<string notr="true">QListWidget{
border: 0
}</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
@ -185,19 +125,6 @@
<property name="rightMargin">
<number>12</number>
</property>
<item>
<widget class="QSlider" name="lightRadianceSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>600</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="horizontalSlider">
<property name="sizePolicy">

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 106.93 99.81"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>0</title><g id="图层_2" data-name="图层 2"><polyline class="cls-1" points="27.24 16.75 27.24 2.15 7.2 2.15 7.2 22.78 46.7 22.78"/></g><g id="图层_3" data-name="图层 3"><polyline class="cls-1" points="27.24 30.37 27.24 44.97 0 44.97"/></g><g id="图层_4" data-name="图层 4"><path class="cls-1" d="M292.82,107.78s0,0,0,0,0,3.59,0,7.62c0,3.85,0,5.78.06,6.43a19.94,19.94,0,0,0,2.87,7.58,15.85,15.85,0,0,0,6.61,6.23A14.75,14.75,0,0,0,310,137a11.69,11.69,0,0,0,7.59-2.92,11,11,0,0,0,3.2-6.84c.15-1.27.58-4.84-1.79-7.64a8.54,8.54,0,0,0-3.56-2.44c-1.32-.52-3.32-1.31-5.06-.33a5.41,5.41,0,0,0-2.14,3,3.48,3.48,0,0,0-.16,2.71c.78,1.86,3.36,2.14,3.47,2.15" transform="translate(-287.18 -56.2)"/></g><g id="图层_5" data-name="图层 5"><path class="cls-1" d="M339.72,85.41V58.75a69.07,69.07,0,0,1,14.79,0c5.9.63,9.31,1,12.84,3.5,1.76,1.22,6.37,4.43,6.68,9.92.25,4.38-2.27,9.26-6.72,11-3.5,1.39-8.46,1-10.71-2.06-.14-.18-2-2.82-.92-5.46.63-1.51,2.34-3.23,4.28-2.92a3.76,3.76,0,0,1,2.33,1.55" transform="translate(-287.18 -56.2)"/></g><g id="图层_6" data-name="图层 6"><path class="cls-1" d="M301.38,145.93a8.21,8.21,0,0,1-.77,5.83c-.26.44-2.5,4.23-5.84,3.7a5,5,0,0,1-3.89-3.5c-.1-.35-1-3,.58-4.09a3.28,3.28,0,0,1,3.89.58" transform="translate(-287.18 -56.2)"/><path class="cls-1" d="M323.18,115.76a7.37,7.37,0,0,1,7.39-8.17c.49,0,4.07.12,5.65,2.92.19.34,1.52,2.7.19,4.67a4.33,4.33,0,0,1-4.67,1.56" transform="translate(-287.18 -56.2)"/></g><g id="图层_7" data-name="图层 7"><path class="cls-1" d="M352.17,86.57a14.23,14.23,0,0,0-4.67,2.73c-1.59,1.4-3.37,3-3.5,5.45a6.45,6.45,0,0,0,2.14,4.86c1.28,1.1,3.68,2.22,5.84,1.17,1.64-.8,3.31-3,2.53-4.67a3.6,3.6,0,0,0-3.31-1.75" transform="translate(-287.18 -56.2)"/><path class="cls-1" d="M382.34,66.53a17.27,17.27,0,0,0,3.89.39c2.16,0,3.53,0,4.86-1a6.15,6.15,0,0,0,2.34-3.89c.17-1,.53-2.93-.78-4.29a4.32,4.32,0,0,0-4.48-.77A3.62,3.62,0,0,0,386,58.75a3.75,3.75,0,0,0,.2,3.31" transform="translate(-287.18 -56.2)"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1 +0,0 @@
<svg id="图层_3" data-name="图层 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27.74 15.09"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>2</title><polyline class="cls-1" points="27.24 0 27.24 14.6 0 14.6"/></svg>

Before

Width:  |  Height:  |  Size: 265 B

View File

@ -1 +0,0 @@
<svg id="图层_4" data-name="图层 4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.07 30.28"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>3</title><path class="cls-1" d="M292.82,107.78s0,0,0,0,0,3.59,0,7.62c0,3.85,0,5.78.06,6.43a19.94,19.94,0,0,0,2.87,7.58,15.85,15.85,0,0,0,6.61,6.23A14.75,14.75,0,0,0,310,137a11.69,11.69,0,0,0,7.59-2.92,11,11,0,0,0,3.2-6.84c.15-1.27.58-4.84-1.79-7.64a8.54,8.54,0,0,0-3.56-2.44c-1.32-.52-3.32-1.31-5.06-.33a5.41,5.41,0,0,0-2.14,3,3.48,3.48,0,0,0-.16,2.71c.78,1.86,3.36,2.14,3.47,2.15" transform="translate(-292.3 -107.25)"/></svg>

Before

Width:  |  Height:  |  Size: 617 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38.66 57"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M.81,0C.12,12.47.64,23.24,1.87,29.9c1.85,10,3.32,18,10.21,22.72,5.59,3.83,15.45,6,21.45.77,2.53-2.22,4.92-5.91,4.6-10a9.27,9.27,0,0,0-2-5.55,1.84,1.84,0,0,0-2.16-.51c-.67.36-1.39,1.08-1.11,1.79s1.81,1,2.85.59"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 468 B

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 141 171" style="enable-background:new 0 0 141 171;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-miterlimit:10;}
</style>
<polygon class="st0" points="0.5,0.5 140.5,0.5 140.5,10.5 115.5,10.5 115.5,31.5 105.5,31.5 105.5,10.5 75.5,10.5 75.5,165.8
105.5,165.8 105.5,144.7 115.5,144.7 115.5,165.8 140.5,165.8 140.5,175.8 0.5,175.8 0.5,165.8 25.5,165.8 25.5,144.7 35.5,144.7
35.5,165.8 65.5,165.8 65.5,10.5 35.5,10.5 35.5,31.5 25.5,31.5 25.5,10.5 0.5,10.5 "/>
</svg>

Before

Width:  |  Height:  |  Size: 781 B

View File

@ -1 +0,0 @@
<svg id="图层_6" data-name="图层 6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 47.45 48.92"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>5</title><path class="cls-1" d="M301.38,145.93a8.21,8.21,0,0,1-.77,5.83c-.26.44-2.5,4.23-5.84,3.7a5,5,0,0,1-3.89-3.5c-.1-.35-1-3,.58-4.09a3.28,3.28,0,0,1,3.89.58" transform="translate(-290.04 -107.09)"/><path class="cls-1" d="M323.18,115.76a7.37,7.37,0,0,1,7.39-8.17c.49,0,4.07.12,5.65,2.92.19.34,1.52,2.7.19,4.67a4.33,4.33,0,0,1-4.67,1.56" transform="translate(-290.04 -107.09)"/></svg>

Before

Width:  |  Height:  |  Size: 577 B

View File

@ -1 +0,0 @@
<svg id="图层_7" data-name="图层 7" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50.62 45.5"><defs><style>.cls-1{fill:none;stroke:#00ff1c;stroke-miterlimit:10;}</style></defs><title>6</title><path class="cls-1" d="M352.17,86.57a14.23,14.23,0,0,0-4.67,2.73c-1.59,1.4-3.37,3-3.5,5.45a6.45,6.45,0,0,0,2.14,4.86c1.28,1.1,3.68,2.22,5.84,1.17,1.64-.8,3.31-3,2.53-4.67a3.6,3.6,0,0,0-3.31-1.75" transform="translate(-343.49 -56.2)"/><path class="cls-1" d="M382.34,66.53a17.27,17.27,0,0,0,3.89.39c2.16,0,3.53,0,4.86-1a6.15,6.15,0,0,0,2.34-3.89c.17-1,.53-2.93-.78-4.29a4.32,4.32,0,0,0-4.48-.77A3.62,3.62,0,0,0,386,58.75a3.75,3.75,0,0,0,.2,3.31" transform="translate(-343.49 -56.2)"/></svg>

Before

Width:  |  Height:  |  Size: 686 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50.52 15.81"><defs><style>.cls-1{fill:#fff;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><polygon class="cls-1" points="0.5 0.5 50.02 0.5 50.02 4.2 27.23 4.2 27.23 15.31 23.29 15.31 23.29 4.2 0.5 4.2 0.5 0.5"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 361 B

View File

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2486.79 1894.11">
<title>biankuang</title>
<rect x="0.5" y="0.5" width="2485.79" height="1893.11" fill="none" stroke="#000" stroke-miterlimit="10"/>
</svg>

Before

Width:  |  Height:  |  Size: 213 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 116.45 116.45"><defs><style>.cls-1{fill:#fff;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><rect class="cls-1" x="0.5" y="0.5" width="115.45" height="115.45"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 310 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100.45 1"><defs><style>.cls-1{fill:none;stroke:#231815;stroke-miterlimit:10;}</style></defs><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><line class="cls-1" y1="0.5" x2="100.45" y2="0.5"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 288 B

View File

@ -0,0 +1,67 @@
file(GLOB ROOT_SOURCE *.cpp)
file(GLOB ROOT_INLINE *.inl)
file(GLOB ROOT_HEADER *.hpp)
file(GLOB ROOT_TEXT ../*.txt)
file(GLOB ROOT_MD ../*.md)
file(GLOB ROOT_NAT ../util/glm.natvis)
file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp)
file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl)
file(GLOB_RECURSE SIMD_HEADER ./simd/*.h)
source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD})
source_group("Core Files" FILES ${CORE_SOURCE})
source_group("Core Files" FILES ${CORE_INLINE})
source_group("Core Files" FILES ${CORE_HEADER})
source_group("GTC Files" FILES ${GTC_SOURCE})
source_group("GTC Files" FILES ${GTC_INLINE})
source_group("GTC Files" FILES ${GTC_HEADER})
source_group("GTX Files" FILES ${GTX_SOURCE})
source_group("GTX Files" FILES ${GTX_INLINE})
source_group("GTX Files" FILES ${GTX_HEADER})
source_group("SIMD Files" FILES ${SIMD_SOURCE})
source_group("SIMD Files" FILES ${SIMD_INLINE})
source_group("SIMD Files" FILES ${SIMD_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
if(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
if(GLM_STATIC_LIBRARY_ENABLE)
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
endif(GLM_STATIC_LIBRARY_ENABLE)
if(GLM_DYNAMIC_LIBRARY_ENABLE)
add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
endif(GLM_DYNAMIC_LIBRARY_ENABLE)
else(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
add_executable(glm_dummy ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
endif(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)

View File

@ -1,539 +1,6 @@
/// @ref core
/// @file glm/common.hpp
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
///
/// @defgroup core_func_common Common functions
/// @ingroup core
///
/// Provides GLSL common functions
///
/// These all operate component-wise. The description is per component.
///
/// Include <glm/common.hpp> to use these core features.
#pragma once
#include "detail/qualifier.hpp"
#include "detail/_fixes.hpp"
namespace glm
{
/// @addtogroup core_func_common
/// @{
/// Returns x if x >= 0; otherwise, it returns -x.
///
/// @tparam genType floating-point or signed integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x);
/// Returns x if x >= 0; otherwise, it returns -x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or signed integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> abs(vec<L, T, Q> const& x);
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer that is less then or equal to x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> floor(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> trunc(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
/// implementation, presumably the direction that is fastest.
/// This includes the possibility that round(x) returns the
/// same value as roundEven(x) for all values of x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> round(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even
/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> roundEven(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer
/// that is greater than or equal to x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ceil(vec<L, T, Q> const& x);
/// Return x - floor(x).
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType fract(genType x);
/// Return x - floor(x).
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> fract(vec<L, T, Q> const& x);
template<typename genType>
GLM_FUNC_DECL genType mod(genType x, genType y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types, include glm/gtc/integer for integer scalar types support
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the fractional part of x and sets i to the integer
/// part (as a whole number floating point value). Both the
/// return value and the output parameter will have the same
/// sign as x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType modf(genType x, genType& i);
/// Returns y if y < x; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y);
/// Returns y if y < x; otherwise, it returns x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, T y);
/// Returns y if y < x; otherwise, it returns x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns y if x < y; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y);
/// Returns y if x < y; otherwise, it returns x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, T y);
/// Returns y if x < y; otherwise, it returns x.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal);
/// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
/// x and y using the floating-point value a.
/// The value for a is not restricted to the range [0, 1].
///
/// If genTypeU is a boolean scalar or vector:
/// Selects which vector each returned component comes
/// from. For a component of 'a' that is false, the
/// corresponding component of 'x' is returned. For a
/// component of 'a' that is true, the corresponding
/// component of 'y' is returned. Components of 'x' and 'y' that
/// are not selected are allowed to be invalid floating point
/// values and will have no effect on the results. Thus, this
/// provides different functionality than
/// genType mix(genType x, genType y, genType(a))
/// where a is a Boolean vector.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
///
/// @param[in] x Value to interpolate.
/// @param[in] y Value to interpolate.
/// @param[in] a Interpolant.
///
/// @tparam genTypeT Floating point scalar or vector.
/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
///
/// @code
/// #include <glm/glm.hpp>
/// ...
/// float a;
/// bool b;
/// glm::dvec3 e;
/// glm::dvec3 f;
/// glm::vec4 g;
/// glm::vec4 h;
/// ...
/// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
/// glm::vec4 s = glm::mix(g, h, b); // Returns g or h;
/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode
template<typename genTypeT, typename genTypeU>
GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType step(genType edge, genType x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> step(T edge, vec<L, T, Q> const& x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> step(vec<L, T, Q> const& edge, vec<L, T, Q> const& x);
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
/// performs smooth Hermite interpolation between 0 and 1
/// when edge0 < x < edge1. This is useful in cases where
/// you would want a threshold function with a smooth
/// transition. This is equivalent to:
/// genType t;
/// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
/// return t * t * (3 - 2 * t);
/// Results are undefined if edge0 >= edge1.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> smoothstep(T edge0, T edge1, vec<L, T, Q> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> smoothstep(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
/// floating point representations. Returns false otherwise,
/// including for implementations with no NaN
/// representations.
///
/// /!\ When using compiler fast math, this function may fail.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isnan(vec<L, T, Q> const& x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
/// set of floating point representations. Returns false
/// otherwise, including for implementations with no infinity
/// representations.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isinf(vec<L, T, Q> const& x);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floating-point
/// value's bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL int floatBitsToInt(float v);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, int, Q> floatBitsToInt(vec<L, float, Q> const& v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL uint floatBitsToUint(float v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, uint, Q> floatBitsToUint(vec<L, float, Q> const& v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL float intBitsToFloat(int v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, float, Q> intBitsToFloat(vec<L, int, Q> const& v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL float uintBitsToFloat(uint v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam Q Value from qualifier enum
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, float, Q> uintBitsToFloat(vec<L, uint, Q> const& v);
/// Computes and returns a * b + c.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c);
/// Splits x into a floating-point significand in the range
/// [0.5, 1.0) and an integral exponent of two, such that:
/// x = significand * exp(2, exponent)
///
/// The significand is returned by the function and the
/// exponent is returned in the parameter exp. For a
/// floating-point value of zero, the significant and exponent
/// are both zero. For a floating-point value that is an
/// infinity or is not a number, the results are undefined.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType frexp(genType x, int& exp);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> frexp(vec<L, T, Q> const& v, vec<L, int, Q>& exp);
/// Builds a floating-point number from x and the
/// corresponding integral exponent of two in exp, returning:
/// significand * exp(2, exponent)
///
/// If this product is too large to be represented in the
/// floating-point type, the result is undefined.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<typename genType>
GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ldexp(vec<L, T, Q> const& v, vec<L, int, Q> const& exp);
/// @}
}//namespace glm
#include "detail/func_common.inl"
#include "detail/func_common.hpp"

View File

@ -1,3 +1,6 @@
/// @ref core
/// @file glm/detail/_features.hpp
#pragma once
// #define GLM_CXX98_EXCEPTIONS
@ -248,7 +251,9 @@
#if(GLM_COMPILER & GLM_COMPILER_GCC)
# if(GLM_COMPILER >= GLM_COMPILER_GCC43)
# define GLM_CXX11_STATIC_ASSERT
# endif
#elif(GLM_COMPILER & GLM_COMPILER_CLANG)
# if(__has_feature(cxx_exceptions))

View File

@ -1,3 +1,6 @@
/// @ref core
/// @file glm/detail/_fixes.hpp
#include <cmath>
//! Workaround for compatibility with other libraries

View File

@ -1,5 +1,11 @@
/// @ref core
/// @file glm/detail/_noise.hpp
#pragma once
#include "../vec2.hpp"
#include "../vec3.hpp"
#include "../vec4.hpp"
#include "../common.hpp"
namespace glm{
@ -8,7 +14,7 @@ namespace detail
template <typename T>
GLM_FUNC_QUALIFIER T mod289(T const & x)
{
return x - floor(x * (static_cast<T>(1.0) / static_cast<T>(289.0))) * static_cast<T>(289.0);
return x - floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) * static_cast<T>(289.0);
}
template <typename T>
@ -17,65 +23,85 @@ namespace detail
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P> const & x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P> const & x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P> const & x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
/*
template <typename T, precision P, template<typename> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> permute(vecType<T, P> const & x)
{
return mod289(((x * T(34)) + T(1)) * x);
}
*/
template <typename T>
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> taylorInvSqrt(tvec2<T, P> const & r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> taylorInvSqrt(tvec3<T, P> const & r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> taylorInvSqrt(tvec4<T, P> const & r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
return T(1.79284291400159) - T(0.85373472095314) * r;
}
/*
template <typename T, precision P, template<typename> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> taylorInvSqrt(vecType<T, P> const & r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
*/
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> fade(tvec2<T, P> const & t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> fade(tvec3<T, P> const & t)
{
return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10));
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> fade(tvec4<T, P> const & t)
{
return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10));
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t)
/*
template <typename T, precision P, template <typename> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> fade(vecType<T, P> const & t)
{
return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10));
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
*/
}//namespace detail
}//namespace glm

File diff suppressed because it is too large Load Diff

View File

@ -1,161 +1,130 @@
/// @ref core
/// @file glm/detail/_vectorize.hpp
#pragma once
#include "type_vec1.hpp"
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_vec4.hpp"
namespace glm{
namespace detail
{
template<template<length_t L, typename T, qualifier Q> class vec, length_t L, typename R, typename T, qualifier Q>
template <typename R, typename T, precision P, template <typename, precision> class vecType>
struct functor1{};
template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q>
struct functor1<vec, 1, R, T, Q>
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec1>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v)
GLM_FUNC_QUALIFIER static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P> const & v)
{
return vec<1, R, Q>(Func(v.x));
return tvec1<R, P>(Func(v.x));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q>
struct functor1<vec, 2, R, T, Q>
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec2>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v)
GLM_FUNC_QUALIFIER static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P> const & v)
{
return vec<2, R, Q>(Func(v.x), Func(v.y));
return tvec2<R, P>(Func(v.x), Func(v.y));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q>
struct functor1<vec, 3, R, T, Q>
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec3>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v)
GLM_FUNC_QUALIFIER static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P> const & v)
{
return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z));
return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q>
struct functor1<vec, 4, R, T, Q>
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec4>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P> const & v)
{
return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, length_t L, typename T, qualifier Q>
template <typename T, precision P, template <typename, precision> class vecType>
struct functor2{};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2<vec, 1, T, Q>
template <typename T, precision P>
struct functor2<T, P, tvec1>
{
GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b)
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, tvec1<T, P> const & b)
{
return vec<1, T, Q>(Func(a.x, b.x));
return tvec1<T, P>(Func(a.x, b.x));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2<vec, 2, T, Q>
template <typename T, precision P>
struct functor2<T, P, tvec2>
{
GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b)
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, tvec2<T, P> const & b)
{
return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y));
return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2<vec, 3, T, Q>
template <typename T, precision P>
struct functor2<T, P, tvec3>
{
GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b)
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, tvec3<T, P> const & b)
{
return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2<vec, 4, T, Q>
template <typename T, precision P>
struct functor2<T, P, tvec4>
{
GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b)
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, tvec4<T, P> const & b)
{
return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, length_t L, typename T, qualifier Q>
template <typename T, precision P, template <typename, precision> class vecType>
struct functor2_vec_sca{};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2_vec_sca<vec, 1, T, Q>
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec1>
{
GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b)
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, T b)
{
return vec<1, T, Q>(Func(a.x, b));
return tvec1<T, P>(Func(a.x, b));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2_vec_sca<vec, 2, T, Q>
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec2>
{
GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b)
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, T b)
{
return vec<2, T, Q>(Func(a.x, b), Func(a.y, b));
return tvec2<T, P>(Func(a.x, b), Func(a.y, b));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2_vec_sca<vec, 3, T, Q>
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec3>
{
GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b)
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, T b)
{
return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
}
};
template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q>
struct functor2_vec_sca<vec, 4, T, Q>
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec4>
{
GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b)
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, T b)
{
return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
}
};
template<length_t L, typename T, qualifier Q>
struct functor2_vec_int {};
template<typename T, qualifier Q>
struct functor2_vec_int<1, T, Q>
{
GLM_FUNC_QUALIFIER static vec<1, int, Q> call(int (*Func) (T x, int y), vec<1, T, Q> const& a, vec<1, int, Q> const& b)
{
return vec<1, int, Q>(Func(a.x, b.x));
}
};
template<typename T, qualifier Q>
struct functor2_vec_int<2, T, Q>
{
GLM_FUNC_QUALIFIER static vec<2, int, Q> call(int (*Func) (T x, int y), vec<2, T, Q> const& a, vec<2, int, Q> const& b)
{
return vec<2, int, Q>(Func(a.x, b.x), Func(a.y, b.y));
}
};
template<typename T, qualifier Q>
struct functor2_vec_int<3, T, Q>
{
GLM_FUNC_QUALIFIER static vec<3, int, Q> call(int (*Func) (T x, int y), vec<3, T, Q> const& a, vec<3, int, Q> const& b)
{
return vec<3, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
}
};
template<typename T, qualifier Q>
struct functor2_vec_int<4, T, Q>
{
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(int (*Func) (T x, int y), vec<4, T, Q> const& a, vec<4, int, Q> const& b)
{
return vec<4, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
}
};
}//namespace detail

View File

@ -1,50 +0,0 @@
#pragma once
#include "setup.hpp"
#include <limits>
namespace glm{
namespace detail
{
template<typename genFIType, bool /*signed*/>
struct compute_abs
{};
template<typename genFIType>
struct compute_abs<genFIType, true>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,
"'abs' only accept floating-point and integer scalar or vector inputs");
return x >= genFIType(0) ? x : -x;
// TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff;
}
};
#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
template<>
struct compute_abs<float, true>
{
GLM_FUNC_QUALIFIER static float call(float x)
{
return fabsf(x);
}
};
#endif
template<typename genFIType>
struct compute_abs<genFIType, false>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
{
GLM_STATIC_ASSERT(
(!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
"'abs' only accept floating-point and integer scalar or vector inputs");
return x;
}
};
}//namespace detail
}//namespace glm

View File

@ -1,30 +0,0 @@
#pragma once
//#include "compute_common.hpp"
#include "setup.hpp"
#include <limits>
namespace glm{
namespace detail
{
template <typename T, bool isFloat>
struct compute_equal
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b)
{
return a == b;
}
};
/*
template <typename T>
struct compute_equal<T, true>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b)
{
return detail::compute_abs<T, std::numeric_limits<T>::is_signed>::call(b - a) <= static_cast<T>(0);
//return std::memcmp(&a, &b, sizeof(T)) == 0;
}
};
*/
}//namespace detail
}//namespace glm

View File

@ -0,0 +1,207 @@
/// @ref core
/// @file glm/core/dummy.cpp
///
/// GLM is a header only library. There is nothing to compile.
/// dummy.cpp exist only a wordaround for CMake file.
/*
#define GLM_MESSAGES
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <limits>
struct material
{
glm::vec4 emission; // Ecm
glm::vec4 ambient; // Acm
glm::vec4 diffuse; // Dcm
glm::vec4 specular; // Scm
float shininess; // Srm
};
struct light
{
glm::vec4 ambient; // Acli
glm::vec4 diffuse; // Dcli
glm::vec4 specular; // Scli
glm::vec4 position; // Ppli
glm::vec4 halfVector; // Derived: Hi
glm::vec3 spotDirection; // Sdli
float spotExponent; // Srli
float spotCutoff; // Crli
// (range: [0.0,90.0], 180.0)
float spotCosCutoff; // Derived: cos(Crli)
// (range: [1.0,0.0],-1.0)
float constantAttenuation; // K0
float linearAttenuation; // K1
float quadraticAttenuation;// K2
};
// Sample 1
#include <glm/vec3.hpp>// glm::vec3
#include <glm/geometric.hpp>// glm::cross, glm::normalize
glm::vec3 computeNormal
(
glm::vec3 const & a,
glm::vec3 const & b,
glm::vec3 const & c
)
{
return glm::normalize(glm::cross(c - a, b - a));
}
typedef unsigned int GLuint;
#define GL_FALSE 0
void glUniformMatrix4fv(GLuint, int, int, float*){}
// Sample 2
#include <glm/vec3.hpp> // glm::vec3
#include <glm/vec4.hpp> // glm::vec4, glm::ivec4
#include <glm/mat4x4.hpp> // glm::mat4
#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
#include <glm/gtc/type_ptr.hpp> // glm::value_ptr
void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate)
{
glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f);
glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
glm::mat4 MVP = Projection * View * Model;
glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP));
}
// Sample 3
#include <glm/vec2.hpp>// glm::vec2
#include <glm/packing.hpp>// glm::packUnorm2x16
#include <glm/integer.hpp>// glm::uint
#include <glm/gtc/type_precision.hpp>// glm::i8vec2, glm::i32vec2
std::size_t const VertexCount = 4;
// Float quad geometry
std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2);
glm::vec2 const PositionDataF32[VertexCount] =
{
glm::vec2(-1.0f,-1.0f),
glm::vec2( 1.0f,-1.0f),
glm::vec2( 1.0f, 1.0f),
glm::vec2(-1.0f, 1.0f)
};
// Half-float quad geometry
std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint);
glm::uint const PositionDataF16[VertexCount] =
{
glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))),
glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))),
glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))),
glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f)))
};
// 8 bits signed integer quad geometry
std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2);
glm::i8vec2 const PositionDataI8[VertexCount] =
{
glm::i8vec2(-1,-1),
glm::i8vec2( 1,-1),
glm::i8vec2( 1, 1),
glm::i8vec2(-1, 1)
};
// 32 bits signed integer quad geometry
std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2);
glm::i32vec2 const PositionDataI32[VertexCount] =
{
glm::i32vec2 (-1,-1),
glm::i32vec2 ( 1,-1),
glm::i32vec2 ( 1, 1),
glm::i32vec2 (-1, 1)
};
struct intersection
{
glm::vec4 position;
glm::vec3 normal;
};
*/
/*
// Sample 4
#include <glm/vec3.hpp>// glm::vec3
#include <glm/geometric.hpp>// glm::normalize, glm::dot, glm::reflect
#include <glm/exponential.hpp>// glm::pow
#include <glm/gtc/random.hpp>// glm::vecRand3
glm::vec3 lighting
(
intersection const & Intersection,
material const & Material,
light const & Light,
glm::vec3 const & View
)
{
glm::vec3 Color(0.0f);
glm::vec3 LightVertor(glm::normalize(
Light.position - Intersection.position +
glm::vecRand3(0.0f, Light.inaccuracy));
if(!shadow(Intersection.position, Light.position, LightVertor))
{
float Diffuse = glm::dot(Intersection.normal, LightVector);
if(Diffuse <= 0.0f)
return Color;
if(Material.isDiffuse())
Color += Light.color() * Material.diffuse * Diffuse;
if(Material.isSpecular())
{
glm::vec3 Reflect(glm::reflect(
glm::normalize(-LightVector),
glm::normalize(Intersection.normal)));
float Dot = glm::dot(Reflect, View);
float Base = Dot > 0.0f ? Dot : 0.0f;
float Specular = glm::pow(Base, Material.exponent);
Color += Material.specular * Specular;
}
}
return Color;
}
*/
/*
template <typename T, glm::precision P, template<typename, glm::precision> class vecType>
T normalizeDotA(vecType<T, P> const & x, vecType<T, P> const & y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template<typename, glm::precision> class
template <GLM_TEMPLATE_GENTYPE vecType>
T normalizeDotB(vecType<T, P> const & x, vecType<T, P> const & y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
template <typename vecType>
typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b)
{
return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b));
}
*/
int main()
{
/*
glm::vec1 o(1);
glm::vec2 a(1);
glm::vec3 b(1);
glm::vec4 c(1);
glm::quat q;
glm::dualquat p;
glm::mat4 m(1);
float a0 = normalizeDotA(a, a);
float b0 = normalizeDotB(b, b);
float c0 = normalizeDotC(c, c);
*/
return 0;
}

View File

@ -0,0 +1,427 @@
/// @ref core
/// @file glm/detail/func_common.hpp
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
///
/// @defgroup core_func_common Common functions
/// @ingroup core
///
/// These all operate component-wise. The description is per component.
#pragma once
#include "setup.hpp"
#include "precision.hpp"
#include "type_int.hpp"
#include "_fixes.hpp"
namespace glm
{
/// @addtogroup core_func_common
/// @{
/// Returns x if x >= 0; otherwise, it returns -x.
///
/// @tparam genType floating-point or signed integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType abs(genType x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x);
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
///
/// @tparam genType Floating-point or signed integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer that is less then or equal to x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
/// implementation, presumably the direction that is fastest.
/// This includes the possibility that round(x) returns the
/// same value as roundEven(x) for all values of x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even
/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer
/// that is greater than or equal to x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x);
/// Return x - floor(x).
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType fract(genType x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType mod(genType x, genType y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y);
/// Returns the fractional part of x and sets i to the integer
/// part (as a whole number floating point value). Both the
/// return value and the output parameter will have the same
/// sign as x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType modf(genType x, genType & i);
/// Returns y if y < x; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType min(genType x, genType y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, T y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, vecType<T, P> const & y);
/// Returns y if x < y; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType max(genType x, genType y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, T y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, vecType<T, P> const & y);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal);
/// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
/// x and y using the floating-point value a.
/// The value for a is not restricted to the range [0, 1].
///
/// If genTypeU is a boolean scalar or vector:
/// Selects which vector each returned component comes
/// from. For a component of <a> that is false, the
/// corresponding component of x is returned. For a
/// component of a that is true, the corresponding
/// component of y is returned. Components of x and y that
/// are not selected are allowed to be invalid floating point
/// values and will have no effect on the results. Thus, this
/// provides different functionality than
/// genType mix(genType x, genType y, genType(a))
/// where a is a Boolean vector.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
///
/// @param[in] x Value to interpolate.
/// @param[in] y Value to interpolate.
/// @param[in] a Interpolant.
///
/// @tparam genTypeT Floating point scalar or vector.
/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
///
/// @code
/// #include <glm/glm.hpp>
/// ...
/// float a;
/// bool b;
/// glm::dvec3 e;
/// glm::dvec3 f;
/// glm::vec4 g;
/// glm::vec4 h;
/// ...
/// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
/// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h;
/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode
template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a);
template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a);
template <typename genTypeT, typename genTypeU>
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType step(genType edge, genType x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_DECL vecType<T, P> step(T edge, vecType<T, P> const & x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_DECL vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x);
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
/// performs smooth Hermite interpolation between 0 and 1
/// when edge0 < x < edge1. This is useful in cases where
/// you would want a threshold function with a smooth
/// transition. This is equivalent to:
/// genType t;
/// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
/// return t * t * (3 - 2 * t);
/// Results are undefined if edge0 >= edge1.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
/// floating point representations. Returns false otherwise,
/// including for implementations with no NaN
/// representations.
///
/// /!\ When using compiler fast math, this function may fail.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isnan(vecType<T, P> const & x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
/// set of floating point representations. Returns false
/// otherwise, including for implementations with no infinity
/// representations.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isinf(vecType<T, P> const & x);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floating-point
/// value's bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL int floatBitsToInt(float const & v);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<int, P> floatBitsToInt(vecType<float, P> const & v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL uint floatBitsToUint(float const & v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<uint, P> floatBitsToUint(vecType<float, P> const & v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL float intBitsToFloat(int const & v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<float, P> intBitsToFloat(vecType<int, P> const & v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL float uintBitsToFloat(uint const & v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
/// If an inf or NaN is passed in, it will not signal, and the
/// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v);
/// Computes and returns a * b + c.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c);
/// Splits x into a floating-point significand in the range
/// [0.5, 1.0) and an integral exponent of two, such that:
/// x = significand * exp(2, exponent)
///
/// The significand is returned by the function and the
/// exponent is returned in the parameter exp. For a
/// floating-point value of zero, the significant and exponent
/// are both zero. For a floating-point value that is an
/// infinity or is not a number, the results are undefined.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType>
GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp);
/// Builds a floating-point number from x and the
/// corresponding integral exponent of two in exp, returning:
/// significand * exp(2, exponent)
///
/// If this product is too large to be represented in the
/// floating-point type, the result is undefined.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType>
GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp);
/// @}
}//namespace glm
#include "func_common.inl"

View File

@ -10,191 +10,191 @@
namespace glm{
namespace detail
{
template<qualifier Q>
struct compute_abs_vector<4, float, Q, true>
template <precision P>
struct compute_abs_vector<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_abs(v.data);
return result;
}
};
template<qualifier Q>
struct compute_abs_vector<4, int, Q, true>
template <precision P>
struct compute_abs_vector<int, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & v)
{
vec<4, int, Q> result;
tvec4<int, P> result(uninitialize);
result.data = glm_ivec4_abs(v.data);
return result;
}
};
template<qualifier Q>
struct compute_floor<4, float, Q, true>
template <precision P>
struct compute_floor<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_floor(v.data);
return result;
}
};
template<qualifier Q>
struct compute_ceil<4, float, Q, true>
template <precision P>
struct compute_ceil<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_ceil(v.data);
return result;
}
};
template<qualifier Q>
struct compute_fract<4, float, Q, true>
template <precision P>
struct compute_fract<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_fract(v.data);
return result;
}
};
template<qualifier Q>
struct compute_round<4, float, Q, true>
template <precision P>
struct compute_round<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_round(v.data);
return result;
}
};
template<qualifier Q>
struct compute_mod<4, float, Q, true>
template <precision P>
struct compute_mod<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_mod(x.data, y.data);
return result;
}
};
template<qualifier Q>
struct compute_min_vector<4, float, Q, true>
template <precision P>
struct compute_min_vector<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = _mm_min_ps(v1.data, v2.data);
return result;
}
};
template<qualifier Q>
struct compute_min_vector<4, int, Q, true>
template <precision P>
struct compute_min_vector<int32, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2)
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
{
vec<4, int, Q> result;
tvec4<int32, P> result(uninitialize);
result.data = _mm_min_epi32(v1.data, v2.data);
return result;
}
};
template<qualifier Q>
struct compute_min_vector<4, uint, Q, true>
template <precision P>
struct compute_min_vector<uint32, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2)
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
{
vec<4, uint, Q> result;
tvec4<uint32, P> result(uninitialize);
result.data = _mm_min_epu32(v1.data, v2.data);
return result;
}
};
template<qualifier Q>
struct compute_max_vector<4, float, Q, true>
template <precision P>
struct compute_max_vector<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = _mm_max_ps(v1.data, v2.data);
return result;
}
};
template<qualifier Q>
struct compute_max_vector<4, int, Q, true>
template <precision P>
struct compute_max_vector<int32, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2)
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
{
vec<4, int, Q> result;
tvec4<int32, P> result(uninitialize);
result.data = _mm_max_epi32(v1.data, v2.data);
return result;
}
};
template<qualifier Q>
struct compute_max_vector<4, uint, Q, true>
template <precision P>
struct compute_max_vector<uint32, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2)
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
{
vec<4, uint, Q> result;
tvec4<uint32, P> result(uninitialize);
result.data = _mm_max_epu32(v1.data, v2.data);
return result;
}
};
template<qualifier Q>
struct compute_clamp_vector<4, float, Q, true>
template <precision P>
struct compute_clamp_vector<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & minVal, tvec4<float, P> const & maxVal)
{
vec<4, float, Q> result;
tvec4<float, P> result(uninitialize);
result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
return result;
}
};
template<qualifier Q>
struct compute_clamp_vector<4, int, Q, true>
template <precision P>
struct compute_clamp_vector<int32, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& x, vec<4, int, Q> const& minVal, vec<4, int, Q> const& maxVal)
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & x, tvec4<int32, P> const & minVal, tvec4<int32, P> const & maxVal)
{
vec<4, int, Q> result;
tvec4<int32, P> result(uninitialize);
result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
return result;
}
};
template<qualifier Q>
struct compute_clamp_vector<4, uint, Q, true>
template <precision P>
struct compute_clamp_vector<uint32, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& x, vec<4, uint, Q> const& minVal, vec<4, uint, Q> const& maxVal)
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & x, tvec4<uint32, P> const & minVal, tvec4<uint32, P> const & maxVal)
{
vec<4, uint, Q> result;
tvec4<uint32, P> result(uninitialize);
result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
return result;
}
};
template<qualifier Q>
struct compute_mix_vector<4, float, bool, Q, true>
template <precision P>
struct compute_mix_vector<float, bool, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y, tvec4<bool, P> const & a)
{
__m128i const Load = _mm_set_epi32(-static_cast<int>(a.w), -static_cast<int>(a.z), -static_cast<int>(a.y), -static_cast<int>(a.x));
__m128i const Load = _mm_set_epi32(-(int)a.w, -(int)a.z, -(int)a.y, -(int)a.x);
__m128 const Mask = _mm_castsi128_ps(Load);
vec<4, float, Q> Result;
tvec4<float, P> Result(uninitialize);
# if 0 && GLM_ARCH & GLM_ARCH_AVX
Result.data = _mm_blendv_ps(x.data, y.data, Mask);
# else
@ -204,25 +204,25 @@ namespace detail
}
};
/* FIXME
template<qualifier Q>
struct compute_step_vector<float, Q, tvec4>
template <precision P>
struct compute_step_vector<float, P, tvec4>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge, tvec4<float, P> const& x)
{
vec<4, float, Q> Result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_step(edge.data, x.data);
return result;
}
};
*/
template<qualifier Q>
struct compute_smoothstep_vector<4, float, Q, true>
template <precision P>
struct compute_smoothstep_vector<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge0, tvec4<float, P> const& edge1, tvec4<float, P> const& x)
{
vec<4, float, Q> Result;
Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);
return Result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);
return result;
}
};
}//namespace detail

View File

@ -0,0 +1,103 @@
/// @ref core
/// @file glm/detail/func_exponential.hpp
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
///
/// @defgroup core_func_exponential Exponential functions
/// @ingroup core
///
/// These all operate component-wise. The description is per component.
#pragma once
#include "type_vec1.hpp"
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#include <cmath>
namespace glm
{
/// @addtogroup core_func_exponential
/// @{
/// Returns 'base' raised to the power 'exponent'.
///
/// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type precision.
/// @param exponent Floating point value representing the 'exponent'.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent);
/// Returns the natural exponentiation of x, i.e., e^x.
///
/// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> exp(vecType<T, P> const & v);
/// Returns the natural logarithm of v, i.e.,
/// returns the value y which satisfies the equation x = e^y.
/// Results are undefined if v <= 0.
///
/// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> log(vecType<T, P> const & v);
/// Returns 2 raised to the v power.
///
/// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> exp2(vecType<T, P> const & v);
/// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y.
///
/// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> log2(vecType<T, P> const & v);
/// Returns the positive square root of v.
///
/// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
//template <typename genType>
//GLM_FUNC_DECL genType sqrt(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & v);
/// Returns the reciprocal of the positive square root of v.
///
/// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> inversesqrt(vecType<T, P> const & v);
/// @}
}//namespace glm
#include "func_exponential.inl"

View File

@ -1,7 +1,7 @@
/// @ref core
/// @file glm/detail/func_exponential.inl
#include "../vector_relational.hpp"
#include "func_vector_relational.hpp"
#include "_vectorize.hpp"
#include <limits>
#include <cmath>
@ -20,45 +20,43 @@ namespace detail
}
# endif
template<length_t L, typename T, qualifier Q, bool isFloat, bool Aligned>
template <typename T, precision P, template <class, precision> class vecType, bool isFloat, bool Aligned>
struct compute_log2
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'log2' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
return detail::functor1<vec, L, T, T, Q>::call(log2, v);
return detail::functor1<T, T, P, vecType>::call(log2, vec);
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <template <class, precision> class vecType, typename T, precision P, bool Aligned>
struct compute_sqrt
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
{
return detail::functor1<vec, L, T, T, Q>::call(std::sqrt, x);
return detail::functor1<T, T, P, vecType>::call(std::sqrt, x);
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <template <class, precision> class vecType, typename T, precision P, bool Aligned>
struct compute_inversesqrt
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
{
return static_cast<T>(1) / sqrt(x);
}
};
template<length_t L, bool Aligned>
struct compute_inversesqrt<L, float, lowp, Aligned>
template <template <class, precision> class vecType, bool Aligned>
struct compute_inversesqrt<vecType, float, lowp, Aligned>
{
GLM_FUNC_QUALIFIER static vec<L, float, lowp> call(vec<L, float, lowp> const& x)
GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x)
{
vec<L, float, lowp> tmp(x);
vec<L, float, lowp> xhalf(tmp * 0.5f);
vec<L, uint, lowp>* p = reinterpret_cast<vec<L, uint, lowp>*>(const_cast<vec<L, float, lowp>*>(&x));
vec<L, uint, lowp> i = vec<L, uint, lowp>(0x5f375a86) - (*p >> vec<L, uint, lowp>(1));
vec<L, float, lowp>* ptmp = reinterpret_cast<vec<L, float, lowp>*>(&i);
vecType<float, lowp> tmp(x);
vecType<float, lowp> xhalf(tmp * 0.5f);
vecType<uint, lowp>* p = reinterpret_cast<vecType<uint, lowp>*>(const_cast<vecType<float, lowp>*>(&x));
vecType<uint, lowp> i = vecType<uint, lowp>(0x5f375a86) - (*p >> vecType<uint, lowp>(1));
vecType<float, lowp>* ptmp = reinterpret_cast<vecType<float, lowp>*>(&i);
tmp = *ptmp;
tmp = tmp * (1.5f - xhalf * tmp * tmp);
return tmp;
@ -68,67 +66,63 @@ namespace detail
// pow
using std::pow;
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> pow(vec<L, T, Q> const& base, vec<L, T, Q> const& exponent)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent)
{
return detail::functor2<vec, L, T, Q>::call(pow, base, exponent);
return detail::functor2<T, P, vecType>::call(pow, base, exponent);
}
// exp
using std::exp;
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> exp(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> exp(vecType<T, P> const & x)
{
return detail::functor1<vec, L, T, T, Q>::call(exp, x);
return detail::functor1<T, T, P, vecType>::call(exp, x);
}
// log
using std::log;
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> log(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> log(vecType<T, P> const & x)
{
return detail::functor1<vec, L, T, T, Q>::call(log, x);
return detail::functor1<T, T, P, vecType>::call(log, x);
}
# if GLM_HAS_CXX11_STL
using std::exp2;
# else
//exp2, ln2 = 0.69314718055994530941723212145818f
template <typename genType>
GLM_FUNC_QUALIFIER genType exp2(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'exp2' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs");
return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x);
}
# endif
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> exp2(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> exp2(vecType<T, P> const & x)
{
return detail::functor1<vec, L, T, T, Q>::call(exp2, x);
return detail::functor1<T, T, P, vecType>::call(exp2, x);
}
// log2, ln2 = 0.69314718055994530941723212145818f
template <typename genType>
GLM_FUNC_QUALIFIER genType log2(genType x)
{
return log2(vec<1, genType>(x)).x;
return log2(tvec1<genType>(x)).x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> log2(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> log2(vecType<T, P> const & x)
{
return detail::compute_log2<L, T, Q, std::numeric_limits<T>::is_iec559, detail::is_aligned<Q>::value>::call(x);
return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
}
// sqrt
using std::sqrt;
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sqrt(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sqrt' only accept floating-point inputs");
return detail::compute_sqrt<L, T, Q, detail::is_aligned<Q>::value>::call(x);
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
return detail::compute_sqrt<vecType, T, P, detail::is_aligned<P>::value>::call(x);
}
// inversesqrt
@ -138,15 +132,15 @@ namespace detail
return static_cast<genType>(1) / sqrt(x);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> inversesqrt(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'inversesqrt' only accept floating-point inputs");
return detail::compute_inversesqrt<L, T, Q, detail::is_aligned<Q>::value>::call(x);
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
return detail::compute_inversesqrt<vecType, T, P, detail::is_aligned<P>::value>::call(x);
}
}//namespace glm
#if GLM_CONFIG_SIMD == GLM_ENABLE
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
# include "func_exponential_simd.inl"
#endif

View File

@ -8,29 +8,27 @@
namespace glm{
namespace detail
{
template<qualifier Q>
struct compute_sqrt<4, float, Q, true>
template <precision P>
struct compute_sqrt<tvec4, float, P, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> Result;
Result.data = _mm_sqrt_ps(v.data);
return Result;
tvec4<float, P> result(uninitialize);
result.data = _mm_sqrt_ps(v.data);
return result;
}
};
# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
template <>
struct compute_sqrt<4, float, aligned_lowp, true>
struct compute_sqrt<tvec4, float, aligned_lowp, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & v)
{
vec<4, float, aligned_lowp> Result;
Result.data = glm_vec4_sqrt_lowp(v.data);
return Result;
tvec4<float, aligned_lowp> result(uninitialize);
result.data = glm_vec4_sqrt_lowp(v.data);
return result;
}
};
# endif
}//namespace detail
}//namespace glm

View File

@ -0,0 +1,113 @@
/// @ref core
/// @file glm/detail/func_geometric.hpp
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
///
/// @defgroup core_func_geometric Geometric functions
/// @ingroup core
///
/// These operate on vectors as vectors, not component-wise.
#pragma once
#include "type_vec3.hpp"
namespace glm
{
/// @addtogroup core_func_geometric
/// @{
/// Returns the length of x, i.e., sqrt(x * x).
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T length(
vecType<T, P> const & x);
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T distance(
vecType<T, P> const & p0,
vecType<T, P> const & p1);
/// Returns the dot product of x and y, i.e., result = x * y.
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T dot(
vecType<T, P> const & x,
vecType<T, P> const & y);
/// Returns the cross product of x and y.
///
/// @tparam valType Floating-point scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> cross(
tvec3<T, P> const & x,
tvec3<T, P> const & y);
/// Returns a vector in the same direction as x but with length of 1.
/// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> normalize(
vecType<T, P> const & x);
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> faceforward(
vecType<T, P> const & N,
vecType<T, P> const & I,
vecType<T, P> const & Nref);
/// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
GLM_FUNC_DECL genType reflect(
genType const & I,
genType const & N);
/// For the incident vector I and surface normal N,
/// and the ratio of indices of refraction eta,
/// return the refraction vector.
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> refract(
vecType<T, P> const & I,
vecType<T, P> const & N,
T eta);
/// @}
}//namespace glm
#include "func_geometric.inl"

View File

@ -1,87 +1,93 @@
#include "../exponential.hpp"
#include "../common.hpp"
/// @ref core
/// @file glm/detail/func_geometric.inl
#include "func_exponential.hpp"
#include "func_common.hpp"
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "type_float.hpp"
namespace glm{
namespace detail
{
template<length_t L, typename T, qualifier Q, bool Aligned>
template <template <typename, precision> class vecType, typename T, precision P, bool Aligned>
struct compute_length
{
GLM_FUNC_QUALIFIER static T call(vec<L, T, Q> const& v)
GLM_FUNC_QUALIFIER static T call(vecType<T, P> const & v)
{
return sqrt(dot(v, v));
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <template <typename, precision> class vecType, typename T, precision P, bool Aligned>
struct compute_distance
{
GLM_FUNC_QUALIFIER static T call(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1)
GLM_FUNC_QUALIFIER static T call(vecType<T, P> const & p0, vecType<T, P> const & p1)
{
return length(p1 - p0);
}
};
template<typename V, typename T, bool Aligned>
template <template <class, precision> class vecType, typename T, precision P, bool Aligned>
struct compute_dot{};
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<1, T, Q>, T, Aligned>
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec1, T, P, Aligned>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b)
GLM_FUNC_QUALIFIER static T call(tvec1<T, P> const & a, tvec1<T, P> const & b)
{
return a.x * b.x;
}
};
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<2, T, Q>, T, Aligned>
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec2, T, P, Aligned>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b)
GLM_FUNC_QUALIFIER static T call(tvec2<T, P> const & x, tvec2<T, P> const & y)
{
vec<2, T, Q> tmp(a * b);
tvec2<T, P> tmp(x * y);
return tmp.x + tmp.y;
}
};
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<3, T, Q>, T, Aligned>
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec3, T, P, Aligned>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b)
GLM_FUNC_QUALIFIER static T call(tvec3<T, P> const & x, tvec3<T, P> const & y)
{
vec<3, T, Q> tmp(a * b);
tvec3<T, P> tmp(x * y);
return tmp.x + tmp.y + tmp.z;
}
};
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<4, T, Q>, T, Aligned>
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec4, T, P, Aligned>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
GLM_FUNC_QUALIFIER static T call(tvec4<T, P> const & x, tvec4<T, P> const & y)
{
vec<4, T, Q> tmp(a * b);
tvec4<T, P> tmp(x * y);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
template<typename T, qualifier Q, bool Aligned>
template <typename T, precision P, bool Aligned>
struct compute_cross
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y)
GLM_FUNC_QUALIFIER static tvec3<T, P> call(tvec3<T, P> const & x, tvec3<T, P> const & y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
return vec<3, T, Q>(
return tvec3<T, P>(
x.y * y.z - y.y * x.z,
x.z * y.x - y.z * x.x,
x.x * y.y - y.x * x.y);
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
struct compute_normalize
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
@ -89,10 +95,10 @@ namespace detail
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
struct compute_faceforward
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& N, vec<L, T, Q> const& I, vec<L, T, Q> const& Nref)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
@ -100,25 +106,23 @@ namespace detail
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
struct compute_reflect
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& I, vec<L, T, Q> const& N)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & I, vecType<T, P> const & N)
{
return I - N * dot(N, I) * static_cast<T>(2);
}
};
template<length_t L, typename T, qualifier Q, bool Aligned>
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
struct compute_refract
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& I, vec<L, T, Q> const& N, T eta)
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & I, vecType<T, P> const & N, T eta)
{
T const dotValue(dot(N, I));
T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue));
vec<L, T, Q> const Result =
(k >= static_cast<T>(0)) ? (eta * I - (eta * dotValue + std::sqrt(k)) * N) : vec<L, T, Q>(0);
return Result;
return (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast<T>(k >= static_cast<T>(0));
}
};
}//namespace detail
@ -132,12 +136,12 @@ namespace detail
return abs(x);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T length(vec<L, T, Q> const& v)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
return detail::compute_length<L, T, Q, detail::is_aligned<Q>::value>::call(v);
return detail::compute_length<vecType, T, P, detail::is_aligned<P>::value>::call(v);
}
// distance
@ -149,34 +153,34 @@ namespace detail
return length(p1 - p0);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T distance(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T distance(vecType<T, P> const & p0, vecType<T, P> const & p1)
{
return detail::compute_distance<L, T, Q, detail::is_aligned<Q>::value>::call(p0, p1);
return detail::compute_distance<vecType, T, P, detail::is_aligned<P>::value>::call(p0, p1);
}
// dot
template <typename T>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(T x, T y)
GLM_FUNC_QUALIFIER T dot(T x, T y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return x * y;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return detail::compute_dot<vec<L, T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
return detail::compute_dot<vecType, T, P, detail::is_aligned<P>::value>::call(x, y);
}
// cross
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y)
{
return detail::compute_cross<T, Q, detail::is_aligned<Q>::value>::call(x, y);
return detail::compute_cross<T, P, detail::is_aligned<P>::value>::call(x, y);
}
/*
// normalize
template <typename genType>
GLM_FUNC_QUALIFIER genType normalize(genType const & x)
@ -185,13 +189,13 @@ namespace detail
return x < genType(0) ? genType(-1) : genType(1);
}
*/
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> normalize(vec<L, T, Q> const& x)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
return detail::compute_normalize<L, T, Q, detail::is_aligned<Q>::value>::call(x);
return detail::compute_normalize<T, P, vecType, detail::is_aligned<P>::value>::call(x);
}
// faceforward
@ -201,10 +205,10 @@ namespace detail
return dot(Nref, I) < static_cast<genType>(0) ? N : -N;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> faceforward(vec<L, T, Q> const& N, vec<L, T, Q> const& I, vec<L, T, Q> const& Nref)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> faceforward(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref)
{
return detail::compute_faceforward<L, T, Q, detail::is_aligned<Q>::value>::call(N, I, Nref);
return detail::compute_faceforward<T, P, vecType, detail::is_aligned<P>::value>::call(N, I, Nref);
}
// reflect
@ -214,10 +218,10 @@ namespace detail
return I - N * dot(N, I) * genType(2);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> reflect(vec<L, T, Q> const& I, vec<L, T, Q> const& N)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> reflect(vecType<T, P> const & I, vecType<T, P> const & N)
{
return detail::compute_reflect<L, T, Q, detail::is_aligned<Q>::value>::call(I, N);
return detail::compute_reflect<T, P, vecType, detail::is_aligned<P>::value>::call(I, N);
}
// refract
@ -230,14 +234,14 @@ namespace detail
return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0));
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> refract(vec<L, T, Q> const& I, vec<L, T, Q> const& N, T eta)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
return detail::compute_refract<L, T, Q, detail::is_aligned<Q>::value>::call(I, N, eta);
return detail::compute_refract<T, P, vecType, detail::is_aligned<P>::value>::call(I, N, eta);
}
}//namespace glm
#if GLM_CONFIG_SIMD == GLM_ENABLE
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
# include "func_geometric_simd.inl"
#endif

View File

@ -8,153 +8,89 @@
namespace glm{
namespace detail
{
template<qualifier Q>
struct compute_length<4, float, Q, true>
template <precision P>
struct compute_length<tvec4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & v)
{
return _mm_cvtss_f32(glm_vec4_length(v.data));
}
};
template<qualifier Q>
struct compute_distance<4, float, Q, true>
template <precision P>
struct compute_distance<tvec4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1)
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & p0, tvec4<float, P> const & p1)
{
return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data));
}
};
template<qualifier Q>
struct compute_dot<vec<4, float, Q>, float, true>
template <precision P>
struct compute_dot<tvec4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y)
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const& x, tvec4<float, P> const& y)
{
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
}
};
template<qualifier Q>
struct compute_cross<float, Q, true>
template <precision P>
struct compute_cross<float, P, true>
{
GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b)
GLM_FUNC_QUALIFIER static tvec3<float, P> call(tvec3<float, P> const & a, tvec3<float, P> const & b)
{
__m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x);
__m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x);
__m128 const xpd0 = glm_vec4_cross(set0, set1);
vec<4, float, Q> Result;
Result.data = xpd0;
return vec<3, float, Q>(Result);
tvec4<float, P> result(uninitialize);
result.data = xpd0;
return tvec3<float, P>(result);
}
};
template<qualifier Q>
struct compute_normalize<4, float, Q, true>
template <precision P>
struct compute_normalize<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
vec<4, float, Q> Result;
Result.data = glm_vec4_normalize(v.data);
return Result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_normalize(v.data);
return result;
}
};
template<qualifier Q>
struct compute_faceforward<4, float, Q, true>
template <precision P>
struct compute_faceforward<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& N, vec<4, float, Q> const& I, vec<4, float, Q> const& Nref)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& N, tvec4<float, P> const& I, tvec4<float, P> const& Nref)
{
vec<4, float, Q> Result;
Result.data = glm_vec4_faceforward(N.data, I.data, Nref.data);
return Result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_faceforward(N.data, I.data, Nref.data);
return result;
}
};
template<qualifier Q>
struct compute_reflect<4, float, Q, true>
template <precision P>
struct compute_reflect<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N)
{
vec<4, float, Q> Result;
Result.data = glm_vec4_reflect(I.data, N.data);
return Result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_reflect(I.data, N.data);
return result;
}
};
template<qualifier Q>
struct compute_refract<4, float, Q, true>
template <precision P>
struct compute_refract<float, P, tvec4, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N, float eta)
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N, float eta)
{
vec<4, float, Q> Result;
Result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta));
return Result;
}
};
}//namespace detail
}//namespace glm
#elif GLM_ARCH & GLM_ARCH_NEON_BIT
namespace glm{
namespace detail
{
template<qualifier Q>
struct compute_length<4, float, Q, true>
{
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v)
{
return sqrt(compute_dot<vec<4, float, Q>, float, true>::call(v, v));
}
};
template<qualifier Q>
struct compute_distance<4, float, Q, true>
{
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1)
{
return compute_length<4, float, Q, true>::call(p1 - p0);
}
};
template<qualifier Q>
struct compute_dot<vec<4, float, Q>, float, true>
{
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y)
{
#if GLM_ARCH & GLM_ARCH_ARMV8_BIT
float32x4_t v = vmulq_f32(x.data, y.data);
return vaddvq_f32(v);
#else // Armv7a with Neon
float32x4_t p = vmulq_f32(x.data, y.data);
float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p));
v = vpadd_f32(v, v);
return vget_lane_f32(v, 0);
#endif
}
};
template<qualifier Q>
struct compute_normalize<4, float, Q, true>
{
GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
{
float32x4_t p = vmulq_f32(v.data, v.data);
#if GLM_ARCH & GLM_ARCH_ARMV8_BIT
p = vpaddq_f32(p, p);
p = vpaddq_f32(p, p);
#else
float32x2_t t = vpadd_f32(vget_low_f32(p), vget_high_f32(p));
t = vpadd_f32(t, t);
p = vcombine_f32(t, t);
#endif
float32x4_t vd = vrsqrteq_f32(p);
vec<4, float, Q> Result;
Result.data = vmulq_f32(v.data, vd);
return Result;
tvec4<float, P> result(uninitialize);
result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta));
return result;
}
};
}//namespace detail

View File

@ -0,0 +1,203 @@
/// @ref core
/// @file glm/detail/func_integer.hpp
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
///
/// @defgroup core_func_integer Integer functions
/// @ingroup core
///
/// These all operate component-wise. The description is per component.
/// The notation [a, b] means the set of bits from bit-number a through bit-number
/// b, inclusive. The lowest-order bit is bit 0.
#pragma once
#include "setup.hpp"
#include "precision.hpp"
#include "func_common.hpp"
#include "func_vector_relational.hpp"
namespace glm
{
/// @addtogroup core_func_integer
/// @{
/// Adds 32-bit unsigned integer x and y, returning the sum
/// modulo pow(2, 32). The value carry is set to 0 if the sum was
/// less than pow(2, 32), or to 1 otherwise.
///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<uint, P> uaddCarry(
vecType<uint, P> const & x,
vecType<uint, P> const & y,
vecType<uint, P> & carry);
/// Subtracts the 32-bit unsigned integer y from x, returning
/// the difference if non-negative, or pow(2, 32) plus the difference
/// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<uint, P> usubBorrow(
vecType<uint, P> const & x,
vecType<uint, P> const & y,
vecType<uint, P> & borrow);
/// Multiplies 32-bit integers x and y, producing a 64-bit
/// result. The 32 least-significant bits are returned in lsb.
/// The 32 most-significant bits are returned in msb.
///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL void umulExtended(
vecType<uint, P> const & x,
vecType<uint, P> const & y,
vecType<uint, P> & msb,
vecType<uint, P> & lsb);
/// Multiplies 32-bit integers x and y, producing a 64-bit
/// result. The 32 least-significant bits are returned in lsb.
/// The 32 most-significant bits are returned in msb.
///
/// @tparam genIType Signed integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL void imulExtended(
vecType<int, P> const & x,
vecType<int, P> const & y,
vecType<int, P> & msb,
vecType<int, P> & lsb);
/// Extracts bits [offset, offset + bits - 1] from value,
/// returning them in the least significant bits of the result.
/// For unsigned data types, the most significant bits of the
/// result will be set to zero. For signed data types, the
/// most significant bits will be set to the value of bit offset + base - 1.
///
/// If bits is zero, the result will be zero. The result will be
/// undefined if offset or bits is negative, or if the sum of
/// offset and bits is greater than the number of bits used
/// to store the operand.
///
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldExtract(
vecType<T, P> const & Value,
int Offset,
int Bits);
/// Returns the insertion the bits least-significant bits of insert into base.
///
/// The result will have bits [offset, offset + bits - 1] taken
/// from bits [0, bits - 1] of insert, and all other bits taken
/// directly from the corresponding bits of base. If bits is
/// zero, the result will simply be base. The result will be
/// undefined if offset or bits is negative, or if the sum of
/// offset and bits is greater than the number of bits used to
/// store the operand.
///
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldInsert(
vecType<T, P> const & Base,
vecType<T, P> const & Insert,
int Offset,
int Bits);
/// Returns the reversal of the bits of value.
/// The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
/// where bits is the total number of bits used to represent value.
///
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldReverse(vecType<T, P> const & v);
/// Returns the number of bits set to 1 in the binary representation of value.
///
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genType>
GLM_FUNC_DECL int bitCount(genType v);
/// Returns the number of bits set to 1 in the binary representation of value.
///
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<int, P> bitCount(vecType<T, P> const & v);
/// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value.
/// If value is zero, -1 will be returned.
///
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL int findLSB(genIUType x);
/// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value.
/// If value is zero, -1 will be returned.
///
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<int, P> findLSB(vecType<T, P> const & v);
/// Returns the bit number of the most significant bit in the binary representation of value.
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
/// For negative integers, the result will be the bit number of the most significant
/// bit set to 0. For a value of zero or negative one, -1 will be returned.
///
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL int findMSB(genIUType x);
/// Returns the bit number of the most significant bit in the binary representation of value.
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
/// For negative integers, the result will be the bit number of the most significant
/// bit set to 0. For a value of zero or negative one, -1 will be returned.
///
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<int, P> findMSB(vecType<T, P> const & v);
/// @}
}//namespace glm
#include "func_integer.inl"

Some files were not shown because too many files have changed in this diff Show More