Add THREE.Vector3 and THREE.Ququaternion from three.js

master
Jeremy Hu 2019-07-26 14:15:33 +09:30
parent af792a9bdc
commit 9261b7ca5e
6 changed files with 1521 additions and 0 deletions

View File

@ -1170,3 +1170,28 @@ https://www.reddit.com/r/gamedev/comments/5iuf3h/i_am_writting_a_3d_monster_mode
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
</pre>
<h1>three.js</h1>
<pre>
The MIT License
Copyright © 2010-2019 three.js authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</pre>

View File

@ -25,6 +25,7 @@
<file>shaders/default.core.frag</file>
<file>shaders/pbr-qt.frag</file>
<file>shaders/pbr-joey.frag</file>
<file>thirdparty/three.js/dust3d.three.js</file>
<file>languages/dust3d_zh_CN.qm</file>
<file>ACKNOWLEDGEMENTS.html</file>
<file>AUTHORS</file>

View File

@ -1,6 +1,7 @@
#include <QDebug>
#include <QElapsedTimer>
#include <QUuid>
#include <QFile>
#include "scriptrunner.h"
#include "util.h"
@ -580,8 +581,25 @@ void ScriptRunner::run()
JS_SetPropertyStr(context,
console, "log",
JS_NewCFunction(context, js_print, "log", 1));
JS_SetPropertyStr(context,
console, "warn",
JS_NewCFunction(context, js_print, "warn", 1));
JS_SetPropertyStr(context,
console, "error",
JS_NewCFunction(context, js_print, "error", 1));
JS_SetPropertyStr(context, globalObject, "console", console);
QFile file(":/thirdparty/three.js/dust3d.three.js");
if (file.open(QIODevice::ReadOnly)) {
QByteArray fileContent = file.readAll();
JSValue three = JS_NewObject(context);
JS_SetPropertyStr(context, globalObject, "THREE", three);
JSValue object = JS_Eval(context, (char *)fileContent.constData(), fileContent.size(), "<thirdparty/three.js/dust3d.three.js>",
JS_EVAL_TYPE_GLOBAL);
JS_FreeValue(context, object);
file.close();
}
JS_FreeValue(context, globalObject);
JSValue object = JS_Eval(context, buffer.constData(), buffer.size(), "<input>",

21
thirdparty/three.js/LICENSE vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License
Copyright © 2010-2019 three.js authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

1
thirdparty/three.js/README.md vendored Normal file
View File

@ -0,0 +1 @@
This is a modified version, which only includes limited 3D Math libraries for Dust3D, please check [three.js](https://threejs.org/) for full version.

1455
thirdparty/three.js/dust3d.three.js vendored Normal file

File diff suppressed because it is too large Load Diff