From aa709267b4ad0e6d2ef38fee207ba81336c57f31 Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Wed, 27 Apr 2016 19:54:03 +0800 Subject: [PATCH 1/9] fixed jsb DrawNode (#46) Fixed jsb DrawNode --- .../cocos/scripting/js-bindings/script/jsb_cocos2d.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js b/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js index d2e04ecddd..c4bf0ac310 100644 --- a/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js +++ b/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js @@ -1896,11 +1896,19 @@ cc.DrawNode = cc._DrawNode.extend({ }, drawPoly:function (verts, fillColor, borderWidth, borderColor) { + borderWidth = borderWidth || this._lineWidth; borderColor = borderColor || this._drawColor; if (fillColor) cc._DrawNode.prototype.drawPoly.call(this, verts, fillColor, borderWidth, borderColor); else { - verts.push(verts[0]); + var first = verts[0]; + var last = verts[verts.length - 1]; + + if (first.x !== last.x || first.y !== last.y) { + verts = verts.slice(0, verts.length); + verts.push(verts[0]); + } + var drawSeg = cc._DrawNode.prototype.drawSegment; for (var i = 0, len = verts.length; i < len - 1; i++) drawSeg.call(this, verts[i], verts[i + 1], borderWidth, borderColor); From a2d4e7e633806026f0bb8e2fa80bc98be11e4a69 Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Mon, 9 May 2016 16:50:36 +0800 Subject: [PATCH 2/9] Perfect CCMotionStreak --- native/cocos/2d/CCMotionStreak.cpp | 44 ++++++++++++++++++++---------- native/cocos/2d/CCMotionStreak.h | 20 ++++++++++++++ 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/native/cocos/2d/CCMotionStreak.cpp b/native/cocos/2d/CCMotionStreak.cpp index 1ec9f77961..e5c4d77302 100644 --- a/native/cocos/2d/CCMotionStreak.cpp +++ b/native/cocos/2d/CCMotionStreak.cpp @@ -107,20 +107,10 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Co _positionR.setZero(); _fastMode = true; - _minSeg = (minSeg == -1.0f) ? stroke/5.0f : minSeg; - _minSeg *= _minSeg; - _stroke = stroke; - _fadeDelta = 1.0f/fade; - _maxPoints = (int)(fade*60.0f)+2; - _nuPoints = 0; - _pointState = (float *)malloc(sizeof(float) * _maxPoints); - _pointVertexes = (Vec2*)malloc(sizeof(Vec2) * _maxPoints); - - _vertices = (Vec2*)malloc(sizeof(Vec2) * _maxPoints * 2); - _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2); - _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); + setMinSeg(minSeg); + setFadeTime(fade); // Set blend mode _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; @@ -220,6 +210,31 @@ void MotionStreak::setTexture(Texture2D *texture) } } +float MotionStreak::getFadeTime() +{ + return 1.0f / _fadeDelta; +} + +void MotionStreak::setFadeTime(float fade) +{ + _fadeDelta = 1.0f/fade; + + _maxPoints = (int)(fade*60.0f)+2; + _nuPoints = 0; + _pointState = (float *)malloc(sizeof(float) * _maxPoints); + _pointVertexes = (Vec2*)malloc(sizeof(Vec2) * _maxPoints); + + _vertices = (Vec2*)malloc(sizeof(Vec2) * _maxPoints * 2); + _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2); + _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); +} + +void MotionStreak::setMinSeg(float minSeg) +{ + _minSeg = (minSeg == -1.0f) ? _stroke / 5.0f : minSeg; + _minSeg *= _minSeg; +} + void MotionStreak::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; @@ -232,12 +247,12 @@ const BlendFunc& MotionStreak::getBlendFunc() const void MotionStreak::setOpacity(GLubyte opacity) { - CCASSERT(false, "Set opacity no supported"); + CCLOG("Set opacity no supported"); } GLubyte MotionStreak::getOpacity() const { - CCASSERT(false, "Opacity no supported"); + CCLOG("Opacity no supported"); return 0; } @@ -404,4 +419,3 @@ void MotionStreak::draw(Renderer *renderer, const Mat4 &transform, uint32_t flag } NS_CC_END - diff --git a/native/cocos/2d/CCMotionStreak.h b/native/cocos/2d/CCMotionStreak.h index 27c4dbfd02..0dbe387ab7 100644 --- a/native/cocos/2d/CCMotionStreak.h +++ b/native/cocos/2d/CCMotionStreak.h @@ -76,6 +76,26 @@ public: */ void reset(); + /** Get trail fragment fade time, in seconds. + * + * @return float fadeTime. + */ + float getFadeTime(); + /** Sets trail fragment fade time, in seconds. + * + * @param fade. + */ + void setFadeTime(float fade); + /** Get minimum segment size. + * + * @return float minSeg. + */ + inline float getMinSeg() const { return _minSeg; } + /** Sets minimum segment size. + * + * @param minSeg. + */ + void setMinSeg(float minSeg); /** When fast mode is enabled, new points are added faster but with lower precision. * * @return True if fast mode is enabled. From ec9f849fb498930483aca16772ae9b560461df92 Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Wed, 11 May 2016 14:28:17 +0800 Subject: [PATCH 3/9] fix CCMotionStreak code memory leak --- native/cocos/2d/CCMotionStreak.cpp | 17 +++++++++-------- native/cocos/2d/CCMotionStreak.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/native/cocos/2d/CCMotionStreak.cpp b/native/cocos/2d/CCMotionStreak.cpp index e5c4d77302..97f442340e 100644 --- a/native/cocos/2d/CCMotionStreak.cpp +++ b/native/cocos/2d/CCMotionStreak.cpp @@ -210,23 +210,24 @@ void MotionStreak::setTexture(Texture2D *texture) } } -float MotionStreak::getFadeTime() -{ - return 1.0f / _fadeDelta; -} - void MotionStreak::setFadeTime(float fade) { - _fadeDelta = 1.0f/fade; + CC_SAFE_FREE(_pointState); + CC_SAFE_FREE(_pointVertexes); + CC_SAFE_FREE(_vertices); + CC_SAFE_FREE(_colorPointer); + CC_SAFE_FREE(_texCoords); - _maxPoints = (int)(fade*60.0f)+2; + _fadeDelta = 1.0f / fade; + + _maxPoints = (int)(fade * 60.0f) + 2; _nuPoints = 0; _pointState = (float *)malloc(sizeof(float) * _maxPoints); _pointVertexes = (Vec2*)malloc(sizeof(Vec2) * _maxPoints); _vertices = (Vec2*)malloc(sizeof(Vec2) * _maxPoints * 2); _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2); - _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); + _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); } void MotionStreak::setMinSeg(float minSeg) diff --git a/native/cocos/2d/CCMotionStreak.h b/native/cocos/2d/CCMotionStreak.h index 0dbe387ab7..bd8a9bbb34 100644 --- a/native/cocos/2d/CCMotionStreak.h +++ b/native/cocos/2d/CCMotionStreak.h @@ -80,7 +80,7 @@ public: * * @return float fadeTime. */ - float getFadeTime(); + inline float getFadeTime() const { return 1.0 / _fadeDelta; } /** Sets trail fragment fade time, in seconds. * * @param fade. From 866c396761cbb3b90a560c46a922b915d2ca30d3 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Tue, 10 May 2016 14:17:32 +0800 Subject: [PATCH 4/9] update js bindings --- .../auto/api/jsb_cocos2dx_auto_api.js | 20 +++++------ .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 33 ++++++++----------- .../js-bindings/auto/jsb_cocos2dx_auto.hpp | 2 +- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index a288e07768..56905a9bf5 100644 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -2385,16 +2385,6 @@ pause : function ( { }, -/** - * @method isPurgeDirectorInNextLoop - * @return {bool} - */ -isPurgeDirectorInNextLoop : function ( -) -{ - return false; -}, - /** * @method setEventDispatcher * @param {cc.EventDispatcher} arg0 @@ -3005,6 +2995,16 @@ getActionManager : function ( return cc.ActionManager; }, +/** + * @method isPurgeDirectorInNextLoop + * @return {bool} + */ +isPurgeDirectorInNextLoop : function ( +) +{ + return false; +}, + /** * @method getInstance * @return {cc.Director} diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index e8fca71c23..6c57dea304 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -6076,24 +6076,6 @@ bool js_cocos2dx_Director_pause(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Director_pause : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_Director_isPurgeDirectorInNextLoop(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_isPurgeDirectorInNextLoop : Invalid Native Object"); - if (argc == 0) { - bool ret = cobj->isPurgeDirectorInNextLoop(); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Director_isPurgeDirectorInNextLoop : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} bool js_cocos2dx_Director_setEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -7371,6 +7353,19 @@ bool js_cocos2dx_Director_getActionManager(JSContext *cx, uint32_t argc, jsval * JS_ReportError(cx, "js_cocos2dx_Director_getActionManager : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Director_isPurgeDirectorInNextLoop(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (argc == 0) { + bool ret = cocos2d::Director::isPurgeDirectorInNextLoop(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Director_isPurgeDirectorInNextLoop : wrong number of arguments"); + return false; +} bool js_cocos2dx_Director_getInstance(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -7415,7 +7410,6 @@ void js_register_cocos2dx_Director(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec funcs[] = { JS_FN("pause", js_cocos2dx_Director_pause, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("isPurgeDirectorInNextLoop", js_cocos2dx_Director_isPurgeDirectorInNextLoop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setEventDispatcher", js_cocos2dx_Director_setEventDispatcher, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setContentScaleFactor", js_cocos2dx_Director_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getContentScaleFactor", js_cocos2dx_Director_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -7483,6 +7477,7 @@ void js_register_cocos2dx_Director(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec st_funcs[] = { + JS_FN("isPurgeDirectorInNextLoop", js_cocos2dx_Director_isPurgeDirectorInNextLoop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getInstance", js_cocos2dx_Director_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index 19c5ca51df..48b3cd6a9d 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -307,7 +307,6 @@ void js_cocos2dx_Director_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_Director(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_Director_pause(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Director_isPurgeDirectorInNextLoop(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); @@ -371,6 +370,7 @@ bool js_cocos2dx_Director_getEventDispatcher(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_Director_replaceScene(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getActionManager(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Director_isPurgeDirectorInNextLoop(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getInstance(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_Scheduler_class; From af8979aef200dbd85fc445a4cc57a0a423788353 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 11 May 2016 09:50:45 +0000 Subject: [PATCH 5/9] [ci skip][AUTO]: updating jsbinding automatically --- .../auto/api/jsb_cocos2dx_3d_auto_api.js | 1739 ----------- .../api/jsb_cocos2dx_3d_extension_auto_api.js | 510 ---- .../auto/api/jsb_cocos2dx_auto_api.js | 40 + .../auto/api/jsb_cocos2dx_navmesh_auto_api.js | 520 ---- .../api/jsb_cocos2dx_physics3d_auto_api.js | 2708 ----------------- .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 80 + .../js-bindings/auto/jsb_cocos2dx_auto.hpp | 4 + 7 files changed, 124 insertions(+), 5477 deletions(-) delete mode 100644 native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js delete mode 100644 native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_extension_auto_api.js delete mode 100644 native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_navmesh_auto_api.js delete mode 100644 native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js deleted file mode 100644 index 0ea1785146..0000000000 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js +++ /dev/null @@ -1,1739 +0,0 @@ -/** - * @module cocos2dx_3d - */ -var jsb = jsb || {}; - -/** - * @class Animation3D - */ -jsb.Animation3D = { - -/** - * @method initWithFile - * @param {String} arg0 - * @param {String} arg1 - * @return {bool} - */ -initWithFile : function ( -str, -str -) -{ - return false; -}, - -/** - * @method init - * @param {cc.Animation3DData} arg0 - * @return {bool} - */ -init : function ( -animation3ddata -) -{ - return false; -}, - -/** - * @method getBoneCurveByName - * @param {String} arg0 - * @return {cc.Animation3D::Curve} - */ -getBoneCurveByName : function ( -str -) -{ - return cc.Animation3D::Curve; -}, - -/** - * @method getDuration - * @return {float} - */ -getDuration : function ( -) -{ - return 0; -}, - -/** - * @method create - * @param {String} arg0 - * @param {String} arg1 - * @return {cc.Animation3D} - */ -create : function ( -str, -str -) -{ - return cc.Animation3D; -}, - -/** - * @method Animation3D - * @constructor - */ -Animation3D : function ( -) -{ -}, - -}; - -/** - * @class Animate3D - */ -jsb.Animate3D = { - -/** - * @method setKeyFrameUserInfo - * @param {int} arg0 - * @param {map_object} arg1 - */ -setKeyFrameUserInfo : function ( -int, -map -) -{ -}, - -/** - * @method getSpeed - * @return {float} - */ -getSpeed : function ( -) -{ - return 0; -}, - -/** - * @method setQuality - * @param {cc.Animate3DQuality} arg0 - */ -setQuality : function ( -animate3dquality -) -{ -}, - -/** - * @method setWeight - * @param {float} arg0 - */ -setWeight : function ( -float -) -{ -}, - -/** - * @method removeFromMap - */ -removeFromMap : function ( -) -{ -}, - -/** - * @method initWithFrames - * @param {cc.Animation3D} arg0 - * @param {int} arg1 - * @param {int} arg2 - * @param {float} arg3 - * @return {bool} - */ -initWithFrames : function ( -animation3d, -int, -int, -float -) -{ - return false; -}, - -/** - * @method getOriginInterval - * @return {float} - */ -getOriginInterval : function ( -) -{ - return 0; -}, - -/** - * @method setSpeed - * @param {float} arg0 - */ -setSpeed : function ( -float -) -{ -}, - -/** - * @method init -* @param {cc.Animation3D|cc.Animation3D} animation3d -* @param {float} float -* @param {float} float -* @return {bool|bool} -*/ -init : function( -animation3d, -float, -float -) -{ - return false; -}, - -/** - * @method setOriginInterval - * @param {float} arg0 - */ -setOriginInterval : function ( -float -) -{ -}, - -/** - * @method getWeight - * @return {float} - */ -getWeight : function ( -) -{ - return 0; -}, - -/** - * @method getQuality - * @return {cc.Animate3DQuality} - */ -getQuality : function ( -) -{ - return 0; -}, - -/** - * @method create -* @param {cc.Animation3D|cc.Animation3D} animation3d -* @param {float} float -* @param {float} float -* @return {cc.Animate3D|cc.Animate3D} -*/ -create : function( -animation3d, -float, -float -) -{ - return cc.Animate3D; -}, - -/** - * @method getTransitionTime - * @return {float} - */ -getTransitionTime : function ( -) -{ - return 0; -}, - -/** - * @method createWithFrames - * @param {cc.Animation3D} arg0 - * @param {int} arg1 - * @param {int} arg2 - * @param {float} arg3 - * @return {cc.Animate3D} - */ -createWithFrames : function ( -animation3d, -int, -int, -float -) -{ - return cc.Animate3D; -}, - -/** - * @method setTransitionTime - * @param {float} arg0 - */ -setTransitionTime : function ( -float -) -{ -}, - -/** - * @method Animate3D - * @constructor - */ -Animate3D : function ( -) -{ -}, - -}; - -/** - * @class TextureCube - */ -jsb.TextureCube = { - -/** - * @method reloadTexture - * @return {bool} - */ -reloadTexture : function ( -) -{ - return false; -}, - -/** - * @method create - * @param {String} arg0 - * @param {String} arg1 - * @param {String} arg2 - * @param {String} arg3 - * @param {String} arg4 - * @param {String} arg5 - * @return {cc.TextureCube} - */ -create : function ( -str, -str, -str, -str, -str, -str -) -{ - return cc.TextureCube; -}, - -/** - * @method TextureCube - * @constructor - */ -TextureCube : function ( -) -{ -}, - -}; - -/** - * @class AttachNode - */ -jsb.AttachNode = { - -/** - * @method create - * @param {cc.Bone3D} arg0 - * @return {cc.AttachNode} - */ -create : function ( -bone3d -) -{ - return cc.AttachNode; -}, - -/** - * @method AttachNode - * @constructor - */ -AttachNode : function ( -) -{ -}, - -}; - -/** - * @class BillBoard - */ -jsb.BillBoard = { - -/** - * @method getMode - * @return {cc.BillBoard::Mode} - */ -getMode : function ( -) -{ - return 0; -}, - -/** - * @method setMode - * @param {cc.BillBoard::Mode} arg0 - */ -setMode : function ( -mode -) -{ -}, - -/** - * @method create -* @param {String|cc.BillBoard::Mode|String} str -* @param {cc.BillBoard::Mode|rect_object} mode -* @param {cc.BillBoard::Mode} mode -* @return {cc.BillBoard|cc.BillBoard|cc.BillBoard} -*/ -create : function( -str, -rect, -mode -) -{ - return cc.BillBoard; -}, - -/** - * @method createWithTexture - * @param {cc.Texture2D} arg0 - * @param {cc.BillBoard::Mode} arg1 - * @return {cc.BillBoard} - */ -createWithTexture : function ( -texture2d, -mode -) -{ - return cc.BillBoard; -}, - -/** - * @method BillBoard - * @constructor - */ -BillBoard : function ( -) -{ -}, - -}; - -/** - * @class Mesh - */ -jsb.Mesh = { - -/** - * @method setTexture -* @param {cc.Texture2D|String} texture2d -*/ -setTexture : function( -str -) -{ -}, - -/** - * @method getTexture - * @return {cc.Texture2D} - */ -getTexture : function ( -) -{ - return cc.Texture2D; -}, - -/** - * @method getSkin - * @return {cc.MeshSkin} - */ -getSkin : function ( -) -{ - return cc.MeshSkin; -}, - -/** - * @method getMaterial - * @return {cc.Material} - */ -getMaterial : function ( -) -{ - return cc.Material; -}, - -/** - * @method getVertexSizeInBytes - * @return {int} - */ -getVertexSizeInBytes : function ( -) -{ - return 0; -}, - -/** - * @method setMaterial - * @param {cc.Material} arg0 - */ -setMaterial : function ( -material -) -{ -}, - -/** - * @method getName - * @return {String} - */ -getName : function ( -) -{ - return ; -}, - -/** - * @method getIndexFormat - * @return {unsigned int} - */ -getIndexFormat : function ( -) -{ - return 0; -}, - -/** - * @method getGLProgramState - * @return {cc.GLProgramState} - */ -getGLProgramState : function ( -) -{ - return cc.GLProgramState; -}, - -/** - * @method getVertexBuffer - * @return {unsigned int} - */ -getVertexBuffer : function ( -) -{ - return 0; -}, - -/** - * @method calculateAABB - */ -calculateAABB : function ( -) -{ -}, - -/** - * @method hasVertexAttrib - * @param {int} arg0 - * @return {bool} - */ -hasVertexAttrib : function ( -int -) -{ - return false; -}, - -/** - * @method getBlendFunc - * @return {cc.BlendFunc} - */ -getBlendFunc : function ( -) -{ - return cc.BlendFunc; -}, - -/** - * @method getMeshIndexData - * @return {cc.MeshIndexData} - */ -getMeshIndexData : function ( -) -{ - return cc.MeshIndexData; -}, - -/** - * @method setName - * @param {String} arg0 - */ -setName : function ( -str -) -{ -}, - -/** - * @method getIndexCount - * @return {int} - */ -getIndexCount : function ( -) -{ - return 0; -}, - -/** - * @method setMeshIndexData - * @param {cc.MeshIndexData} arg0 - */ -setMeshIndexData : function ( -meshindexdata -) -{ -}, - -/** - * @method getMeshVertexAttribCount - * @return {int} - */ -getMeshVertexAttribCount : function ( -) -{ - return 0; -}, - -/** - * @method setBlendFunc - * @param {cc.BlendFunc} arg0 - */ -setBlendFunc : function ( -blendfunc -) -{ -}, - -/** - * @method setForce2DQueue - * @param {bool} arg0 - */ -setForce2DQueue : function ( -bool -) -{ -}, - -/** - * @method getPrimitiveType - * @return {unsigned int} - */ -getPrimitiveType : function ( -) -{ - return 0; -}, - -/** - * @method setSkin - * @param {cc.MeshSkin} arg0 - */ -setSkin : function ( -meshskin -) -{ -}, - -/** - * @method isVisible - * @return {bool} - */ -isVisible : function ( -) -{ - return false; -}, - -/** - * @method getIndexBuffer - * @return {unsigned int} - */ -getIndexBuffer : function ( -) -{ - return 0; -}, - -/** - * @method setGLProgramState - * @param {cc.GLProgramState} arg0 - */ -setGLProgramState : function ( -glprogramstate -) -{ -}, - -/** - * @method setVisible - * @param {bool} arg0 - */ -setVisible : function ( -bool -) -{ -}, - -/** - * @method Mesh - * @constructor - */ -Mesh : function ( -) -{ -}, - -}; - -/** - * @class Skeleton3D - */ -jsb.Skeleton3D = { - -/** - * @method removeAllBones - */ -removeAllBones : function ( -) -{ -}, - -/** - * @method addBone - * @param {cc.Bone3D} arg0 - */ -addBone : function ( -bone3d -) -{ -}, - -/** - * @method getBoneByName - * @param {String} arg0 - * @return {cc.Bone3D} - */ -getBoneByName : function ( -str -) -{ - return cc.Bone3D; -}, - -/** - * @method getRootBone - * @param {int} arg0 - * @return {cc.Bone3D} - */ -getRootBone : function ( -int -) -{ - return cc.Bone3D; -}, - -/** - * @method updateBoneMatrix - */ -updateBoneMatrix : function ( -) -{ -}, - -/** - * @method getBoneByIndex - * @param {unsigned int} arg0 - * @return {cc.Bone3D} - */ -getBoneByIndex : function ( -int -) -{ - return cc.Bone3D; -}, - -/** - * @method getRootCount - * @return {int} - */ -getRootCount : function ( -) -{ - return 0; -}, - -/** - * @method getBoneIndex - * @param {cc.Bone3D} arg0 - * @return {int} - */ -getBoneIndex : function ( -bone3d -) -{ - return 0; -}, - -/** - * @method getBoneCount - * @return {int} - */ -getBoneCount : function ( -) -{ - return 0; -}, - -/** - * @method Skeleton3D - * @constructor - */ -Skeleton3D : function ( -) -{ -}, - -}; - -/** - * @class Skybox - */ -jsb.Skybox = { - -/** - * @method reload - */ -reload : function ( -) -{ -}, - -/** - * @method init - * @param {String} arg0 - * @param {String} arg1 - * @param {String} arg2 - * @param {String} arg3 - * @param {String} arg4 - * @param {String} arg5 - * @return {bool} - */ -init : function ( -str, -str, -str, -str, -str, -str -) -{ - return false; -}, - -/** - * @method setTexture - * @param {cc.TextureCube} arg0 - */ -setTexture : function ( -texturecube -) -{ -}, - -/** - * @method create -* @param {String} str -* @param {String} str -* @param {String} str -* @param {String} str -* @param {String} str -* @param {String} str -* @return {cc.Skybox|cc.Skybox} -*/ -create : function( -str, -str, -str, -str, -str, -str -) -{ - return cc.Skybox; -}, - -/** - * @method Skybox - * @constructor - */ -Skybox : function ( -) -{ -}, - -}; - -/** - * @class Sprite3D - */ -jsb.Sprite3D = { - -/** - * @method setCullFaceEnabled - * @param {bool} arg0 - */ -setCullFaceEnabled : function ( -bool -) -{ -}, - -/** - * @method setTexture -* @param {cc.Texture2D|String} texture2d -*/ -setTexture : function( -str -) -{ -}, - -/** - * @method getLightMask - * @return {unsigned int} - */ -getLightMask : function ( -) -{ - return 0; -}, - -/** - * @method createAttachSprite3DNode - * @param {cc.NodeData} arg0 - * @param {cc.MaterialDatas} arg1 - */ -createAttachSprite3DNode : function ( -nodedata, -materialdatas -) -{ -}, - -/** - * @method loadFromFile - * @param {String} arg0 - * @param {cc.NodeDatas} arg1 - * @param {cc.MeshDatas} arg2 - * @param {cc.MaterialDatas} arg3 - * @return {bool} - */ -loadFromFile : function ( -str, -nodedatas, -meshdatas, -materialdatas -) -{ - return false; -}, - -/** - * @method getMaterial - * @param {int} arg0 - * @return {cc.Material} - */ -getMaterial : function ( -int -) -{ - return cc.Material; -}, - -/** - * @method setCullFace - * @param {unsigned int} arg0 - */ -setCullFace : function ( -int -) -{ -}, - -/** - * @method addMesh - * @param {cc.Mesh} arg0 - */ -addMesh : function ( -mesh -) -{ -}, - -/** - * @method removeAllAttachNode - */ -removeAllAttachNode : function ( -) -{ -}, - -/** - * @method setMaterial -* @param {cc.Material|cc.Material} material -* @param {int} int -*/ -setMaterial : function( -material, -int -) -{ -}, - -/** - * @method getMesh - * @return {cc.Mesh} - */ -getMesh : function ( -) -{ - return cc.Mesh; -}, - -/** - * @method createSprite3DNode - * @param {cc.NodeData} arg0 - * @param {cc.ModelData} arg1 - * @param {cc.MaterialDatas} arg2 - * @return {cc.Sprite3D} - */ -createSprite3DNode : function ( -nodedata, -modeldata, -materialdatas -) -{ - return cc.Sprite3D; -}, - -/** - * @method getMeshCount - * @return {int} - */ -getMeshCount : function ( -) -{ - return 0; -}, - -/** - * @method onAABBDirty - */ -onAABBDirty : function ( -) -{ -}, - -/** - * @method getMeshByIndex - * @param {int} arg0 - * @return {cc.Mesh} - */ -getMeshByIndex : function ( -int -) -{ - return cc.Mesh; -}, - -/** - * @method createNode - * @param {cc.NodeData} arg0 - * @param {cc.Node} arg1 - * @param {cc.MaterialDatas} arg2 - * @param {bool} arg3 - */ -createNode : function ( -nodedata, -node, -materialdatas, -bool -) -{ -}, - -/** - * @method isForceDepthWrite - * @return {bool} - */ -isForceDepthWrite : function ( -) -{ - return false; -}, - -/** - * @method getBlendFunc - * @return {cc.BlendFunc} - */ -getBlendFunc : function ( -) -{ - return cc.BlendFunc; -}, - -/** - * @method getMeshIndexData - * @param {String} arg0 - * @return {cc.MeshIndexData} - */ -getMeshIndexData : function ( -str -) -{ - return cc.MeshIndexData; -}, - -/** - * @method setLightMask - * @param {unsigned int} arg0 - */ -setLightMask : function ( -int -) -{ -}, - -/** - * @method afterAsyncLoad - * @param {void} arg0 - */ -afterAsyncLoad : function ( -void -) -{ -}, - -/** - * @method loadFromCache - * @param {String} arg0 - * @return {bool} - */ -loadFromCache : function ( -str -) -{ - return false; -}, - -/** - * @method initFrom - * @param {cc.NodeDatas} arg0 - * @param {cc.MeshDatas} arg1 - * @param {cc.MaterialDatas} arg2 - * @return {bool} - */ -initFrom : function ( -nodedatas, -meshdatas, -materialdatas -) -{ - return false; -}, - -/** - * @method getAttachNode - * @param {String} arg0 - * @return {cc.AttachNode} - */ -getAttachNode : function ( -str -) -{ - return cc.AttachNode; -}, - -/** - * @method initWithFile - * @param {String} arg0 - * @return {bool} - */ -initWithFile : function ( -str -) -{ - return false; -}, - -/** - * @method setBlendFunc - * @param {cc.BlendFunc} arg0 - */ -setBlendFunc : function ( -blendfunc -) -{ -}, - -/** - * @method setForce2DQueue - * @param {bool} arg0 - */ -setForce2DQueue : function ( -bool -) -{ -}, - -/** - * @method genMaterial - */ -genMaterial : function ( -) -{ -}, - -/** - * @method removeAttachNode - * @param {String} arg0 - */ -removeAttachNode : function ( -str -) -{ -}, - -/** - * @method getSkeleton - * @return {cc.Skeleton3D} - */ -getSkeleton : function ( -) -{ - return cc.Skeleton3D; -}, - -/** - * @method setForceDepthWrite - * @param {bool} arg0 - */ -setForceDepthWrite : function ( -bool -) -{ -}, - -/** - * @method getMeshByName - * @param {String} arg0 - * @return {cc.Mesh} - */ -getMeshByName : function ( -str -) -{ - return cc.Mesh; -}, - -/** - * @method create -* @param {String|String} str -* @param {String} str -* @return {cc.Sprite3D|cc.Sprite3D|cc.Sprite3D} -*/ -create : function( -str, -str -) -{ - return cc.Sprite3D; -}, - -/** - * @method Sprite3D - * @constructor - */ -Sprite3D : function ( -) -{ -}, - -}; - -/** - * @class Sprite3DCache - */ -jsb.Sprite3DCache = { - -/** - * @method removeSprite3DData - * @param {String} arg0 - */ -removeSprite3DData : function ( -str -) -{ -}, - -/** - * @method removeAllSprite3DData - */ -removeAllSprite3DData : function ( -) -{ -}, - -/** - * @method destroyInstance - */ -destroyInstance : function ( -) -{ -}, - -/** - * @method getInstance - * @return {cc.Sprite3DCache} - */ -getInstance : function ( -) -{ - return cc.Sprite3DCache; -}, - -}; - -/** - * @class Terrain - */ -jsb.Terrain = { - -/** - * @method initHeightMap - * @param {char} arg0 - * @return {bool} - */ -initHeightMap : function ( -char -) -{ - return false; -}, - -/** - * @method setMaxDetailMapAmount - * @param {int} arg0 - */ -setMaxDetailMapAmount : function ( -int -) -{ -}, - -/** - * @method setDrawWire - * @param {bool} arg0 - */ -setDrawWire : function ( -bool -) -{ -}, - -/** - * @method setDetailMap - * @param {unsigned int} arg0 - * @param {cc.Terrain::DetailMap} arg1 - */ -setDetailMap : function ( -int, -map -) -{ -}, - -/** - * @method resetHeightMap - * @param {char} arg0 - */ -resetHeightMap : function ( -char -) -{ -}, - -/** - * @method setLightDir - * @param {vec3_object} arg0 - */ -setLightDir : function ( -vec3 -) -{ -}, - -/** - * @method setAlphaMap - * @param {cc.Texture2D} arg0 - */ -setAlphaMap : function ( -texture2d -) -{ -}, - -/** - * @method setSkirtHeightRatio - * @param {float} arg0 - */ -setSkirtHeightRatio : function ( -float -) -{ -}, - -/** - * @method convertToTerrainSpace - * @param {vec2_object} arg0 - * @return {vec2_object} - */ -convertToTerrainSpace : function ( -vec2 -) -{ - return cc.Vec2; -}, - -/** - * @method initTextures - * @return {bool} - */ -initTextures : function ( -) -{ - return false; -}, - -/** - * @method initProperties - * @return {bool} - */ -initProperties : function ( -) -{ - return false; -}, - -/** - * @method getHeight -* @param {vec2_object|float} vec2 -* @param {vec3_object|float} vec3 -* @param {vec3_object} vec3 -* @return {float|float} -*/ -getHeight : function( -float, -float, -vec3 -) -{ - return 0; -}, - -/** - * @method initWithTerrainData - * @param {cc.Terrain::TerrainData} arg0 - * @param {cc.Terrain::CrackFixedType} arg1 - * @return {bool} - */ -initWithTerrainData : function ( -terraindata, -crackfixedtype -) -{ - return false; -}, - -/** - * @method setLODDistance - * @param {float} arg0 - * @param {float} arg1 - * @param {float} arg2 - */ -setLODDistance : function ( -float, -float, -float -) -{ -}, - -/** - * @method getTerrainSize - * @return {size_object} - */ -getTerrainSize : function ( -) -{ - return cc.Size; -}, - -/** - * @method getIntersectionPoint -* @param {cc.Ray|cc.Ray} ray -* @param {vec3_object} vec3 -* @return {bool|vec3_object} -*/ -getIntersectionPoint : function( -ray, -vec3 -) -{ - return false; -}, - -/** - * @method getNormal - * @param {int} arg0 - * @param {int} arg1 - * @return {vec3_object} - */ -getNormal : function ( -int, -int -) -{ - return cc.Vec3; -}, - -/** - * @method reload - */ -reload : function ( -) -{ -}, - -/** - * @method getImageHeight - * @param {int} arg0 - * @param {int} arg1 - * @return {float} - */ -getImageHeight : function ( -int, -int -) -{ - return 0; -}, - -/** - * @method setLightMap - * @param {String} arg0 - */ -setLightMap : function ( -str -) -{ -}, - -/** - * @method setIsEnableFrustumCull - * @param {bool} arg0 - */ -setIsEnableFrustumCull : function ( -bool -) -{ -}, - -/** - * @method getMinHeight - * @return {float} - */ -getMinHeight : function ( -) -{ - return 0; -}, - -/** - * @method getMaxHeight - * @return {float} - */ -getMaxHeight : function ( -) -{ - return 0; -}, - -/** - * @method Terrain - * @constructor - */ -Terrain : function ( -) -{ -}, - -}; - -/** - * @class Bundle3D - */ -jsb.Bundle3D = { - -/** - * @method load - * @param {String} arg0 - * @return {bool} - */ -load : function ( -str -) -{ - return false; -}, - -/** - * @method loadSkinData - * @param {String} arg0 - * @param {cc.SkinData} arg1 - * @return {bool} - */ -loadSkinData : function ( -str, -skindata -) -{ - return false; -}, - -/** - * @method clear - */ -clear : function ( -) -{ -}, - -/** - * @method loadMaterials - * @param {cc.MaterialDatas} arg0 - * @return {bool} - */ -loadMaterials : function ( -materialdatas -) -{ - return false; -}, - -/** - * @method loadMeshDatas - * @param {cc.MeshDatas} arg0 - * @return {bool} - */ -loadMeshDatas : function ( -meshdatas -) -{ - return false; -}, - -/** - * @method loadNodes - * @param {cc.NodeDatas} arg0 - * @return {bool} - */ -loadNodes : function ( -nodedatas -) -{ - return false; -}, - -/** - * @method loadAnimationData - * @param {String} arg0 - * @param {cc.Animation3DData} arg1 - * @return {bool} - */ -loadAnimationData : function ( -str, -animation3ddata -) -{ - return false; -}, - -/** - * @method createBundle - * @return {cc.Bundle3D} - */ -createBundle : function ( -) -{ - return cc.Bundle3D; -}, - -/** - * @method destroyBundle - * @param {cc.Bundle3D} arg0 - */ -destroyBundle : function ( -bundle3d -) -{ -}, - -/** - * @method loadObj - * @param {cc.MeshDatas} arg0 - * @param {cc.MaterialDatas} arg1 - * @param {cc.NodeDatas} arg2 - * @param {String} arg3 - * @param {char} arg4 - * @return {bool} - */ -loadObj : function ( -meshdatas, -materialdatas, -nodedatas, -str, -char -) -{ - return false; -}, - -/** - * @method Bundle3D - * @constructor - */ -Bundle3D : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_extension_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_extension_auto_api.js deleted file mode 100644 index 2a5567ec3b..0000000000 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_extension_auto_api.js +++ /dev/null @@ -1,510 +0,0 @@ -/** - * @module cocos2dx_3d_extension - */ -var jsb = jsb || {}; - -/** - * @class ParticleSystem3D - */ -jsb.ParticleSystem3D = { - -/** - * @method resumeParticleSystem - */ -resumeParticleSystem : function ( -) -{ -}, - -/** - * @method startParticleSystem - */ -startParticleSystem : function ( -) -{ -}, - -/** - * @method isEnabled - * @return {bool} - */ -isEnabled : function ( -) -{ - return false; -}, - -/** - * @method isKeepLocal - * @return {bool} - */ -isKeepLocal : function ( -) -{ - return false; -}, - -/** - * @method setEnabled - * @param {bool} arg0 - */ -setEnabled : function ( -bool -) -{ -}, - -/** - * @method getParticleQuota - * @return {unsigned int} - */ -getParticleQuota : function ( -) -{ - return 0; -}, - -/** - * @method getBlendFunc - * @return {cc.BlendFunc} - */ -getBlendFunc : function ( -) -{ - return cc.BlendFunc; -}, - -/** - * @method pauseParticleSystem - */ -pauseParticleSystem : function ( -) -{ -}, - -/** - * @method getState - * @return {cc.ParticleSystem3D::State} - */ -getState : function ( -) -{ - return 0; -}, - -/** - * @method getAliveParticleCount - * @return {int} - */ -getAliveParticleCount : function ( -) -{ - return 0; -}, - -/** - * @method setParticleQuota - * @param {unsigned int} arg0 - */ -setParticleQuota : function ( -int -) -{ -}, - -/** - * @method setBlendFunc - * @param {cc.BlendFunc} arg0 - */ -setBlendFunc : function ( -blendfunc -) -{ -}, - -/** - * @method stopParticleSystem - */ -stopParticleSystem : function ( -) -{ -}, - -/** - * @method setKeepLocal - * @param {bool} arg0 - */ -setKeepLocal : function ( -bool -) -{ -}, - -/** - * @method ParticleSystem3D - * @constructor - */ -ParticleSystem3D : function ( -) -{ -}, - -}; - -/** - * @class PUParticleSystem3D - */ -jsb.PUParticleSystem3D = { - -/** - * @method initWithFilePath - * @param {String} arg0 - * @return {bool} - */ -initWithFilePath : function ( -str -) -{ - return false; -}, - -/** - * @method getParticleSystemScaleVelocity - * @return {float} - */ -getParticleSystemScaleVelocity : function ( -) -{ - return 0; -}, - -/** - * @method setEmittedSystemQuota - * @param {unsigned int} arg0 - */ -setEmittedSystemQuota : function ( -int -) -{ -}, - -/** - * @method getDefaultDepth - * @return {float} - */ -getDefaultDepth : function ( -) -{ - return 0; -}, - -/** - * @method getEmittedSystemQuota - * @return {unsigned int} - */ -getEmittedSystemQuota : function ( -) -{ - return 0; -}, - -/** - * @method initWithFilePathAndMaterialPath - * @param {String} arg0 - * @param {String} arg1 - * @return {bool} - */ -initWithFilePathAndMaterialPath : function ( -str, -str -) -{ - return false; -}, - -/** - * @method clearAllParticles - */ -clearAllParticles : function ( -) -{ -}, - -/** - * @method getMaterialName - * @return {String} - */ -getMaterialName : function ( -) -{ - return ; -}, - -/** - * @method calulateRotationOffset - */ -calulateRotationOffset : function ( -) -{ -}, - -/** - * @method getMaxVelocity - * @return {float} - */ -getMaxVelocity : function ( -) -{ - return 0; -}, - -/** - * @method forceUpdate - * @param {float} arg0 - */ -forceUpdate : function ( -float -) -{ -}, - -/** - * @method getTimeElapsedSinceStart - * @return {float} - */ -getTimeElapsedSinceStart : function ( -) -{ - return 0; -}, - -/** - * @method getEmittedEmitterQuota - * @return {unsigned int} - */ -getEmittedEmitterQuota : function ( -) -{ - return 0; -}, - -/** - * @method isMarkedForEmission - * @return {bool} - */ -isMarkedForEmission : function ( -) -{ - return false; -}, - -/** - * @method getDefaultWidth - * @return {float} - */ -getDefaultWidth : function ( -) -{ - return 0; -}, - -/** - * @method setEmittedEmitterQuota - * @param {unsigned int} arg0 - */ -setEmittedEmitterQuota : function ( -int -) -{ -}, - -/** - * @method setMarkedForEmission - * @param {bool} arg0 - */ -setMarkedForEmission : function ( -bool -) -{ -}, - -/** - * @method clone - * @return {cc.PUParticleSystem3D} - */ -clone : function ( -) -{ - return cc.PUParticleSystem3D; -}, - -/** - * @method setDefaultWidth - * @param {float} arg0 - */ -setDefaultWidth : function ( -float -) -{ -}, - -/** - * @method copyAttributesTo - * @param {cc.PUParticleSystem3D} arg0 - */ -copyAttributesTo : function ( -puparticlesystem3d -) -{ -}, - -/** - * @method setMaterialName - * @param {String} arg0 - */ -setMaterialName : function ( -str -) -{ -}, - -/** - * @method getParentParticleSystem - * @return {cc.PUParticleSystem3D} - */ -getParentParticleSystem : function ( -) -{ - return cc.PUParticleSystem3D; -}, - -/** - * @method setMaxVelocity - * @param {float} arg0 - */ -setMaxVelocity : function ( -float -) -{ -}, - -/** - * @method getDefaultHeight - * @return {float} - */ -getDefaultHeight : function ( -) -{ - return 0; -}, - -/** - * @method getDerivedPosition - * @return {vec3_object} - */ -getDerivedPosition : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method rotationOffset - * @param {vec3_object} arg0 - */ -rotationOffset : function ( -vec3 -) -{ -}, - -/** - * @method getDerivedOrientation - * @return {cc.Quaternion} - */ -getDerivedOrientation : function ( -) -{ - return cc.Quaternion; -}, - -/** - * @method removeAllEmitter - */ -removeAllEmitter : function ( -) -{ -}, - -/** - * @method setParticleSystemScaleVelocity - * @param {float} arg0 - */ -setParticleSystemScaleVelocity : function ( -float -) -{ -}, - -/** - * @method getDerivedScale - * @return {vec3_object} - */ -getDerivedScale : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method setDefaultHeight - * @param {float} arg0 - */ -setDefaultHeight : function ( -float -) -{ -}, - -/** - * @method removeAllListener - */ -removeAllListener : function ( -) -{ -}, - -/** - * @method setDefaultDepth - * @param {float} arg0 - */ -setDefaultDepth : function ( -float -) -{ -}, - -/** - * @method create -* @param {String|String} str -* @param {String} str -* @return {cc.PUParticleSystem3D|cc.PUParticleSystem3D|cc.PUParticleSystem3D} -*/ -create : function( -str, -str -) -{ - return cc.PUParticleSystem3D; -}, - -/** - * @method PUParticleSystem3D - * @constructor - */ -PUParticleSystem3D : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index 56905a9bf5..3316167355 100644 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -13435,6 +13435,16 @@ texture2d { }, +/** + * @method setMinSeg + * @param {float} arg0 + */ +setMinSeg : function ( +float +) +{ +}, + /** * @method getTexture * @return {cc.Texture2D} @@ -13455,6 +13465,16 @@ color3b { }, +/** + * @method getMinSeg + * @return {float} + */ +getMinSeg : function ( +) +{ + return 0; +}, + /** * @method setBlendFunc * @param {cc.BlendFunc} arg0 @@ -13465,6 +13485,16 @@ blendfunc { }, +/** + * @method setFadeTime + * @param {float} arg0 + */ +setFadeTime : function ( +float +) +{ +}, + /** * @method setStartingPositionInitialized * @param {bool} arg0 @@ -13475,6 +13505,16 @@ bool { }, +/** + * @method getFadeTime + * @return {float} + */ +getFadeTime : function ( +) +{ + return 0; +}, + /** * @method getBlendFunc * @return {cc.BlendFunc} diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_navmesh_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_navmesh_auto_api.js deleted file mode 100644 index 3e02c71968..0000000000 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_navmesh_auto_api.js +++ /dev/null @@ -1,520 +0,0 @@ -/** - * @module cocos2dx_navmesh - */ -var jsb = jsb || {}; - -/** - * @class NavMeshAgent - */ -jsb.NavMeshAgent = { - -/** - * @method setMaxSpeed - * @param {float} arg0 - */ -setMaxSpeed : function ( -float -) -{ -}, - -/** - * @method syncToNode - */ -syncToNode : function ( -) -{ -}, - -/** - * @method completeOffMeshLink - */ -completeOffMeshLink : function ( -) -{ -}, - -/** - * @method getSeparationWeight - * @return {float} - */ -getSeparationWeight : function ( -) -{ - return 0; -}, - -/** - * @method setAutoTraverseOffMeshLink - * @param {bool} arg0 - */ -setAutoTraverseOffMeshLink : function ( -bool -) -{ -}, - -/** - * @method getCurrentVelocity - * @return {vec3_object} - */ -getCurrentVelocity : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method syncToAgent - */ -syncToAgent : function ( -) -{ -}, - -/** - * @method isOnOffMeshLink - * @return {bool} - */ -isOnOffMeshLink : function ( -) -{ - return false; -}, - -/** - * @method setSeparationWeight - * @param {float} arg0 - */ -setSeparationWeight : function ( -float -) -{ -}, - -/** - * @method pause - */ -pause : function ( -) -{ -}, - -/** - * @method setAutoOrientation - * @param {bool} arg0 - */ -setAutoOrientation : function ( -bool -) -{ -}, - -/** - * @method getHeight - * @return {float} - */ -getHeight : function ( -) -{ - return 0; -}, - -/** - * @method getMaxSpeed - * @return {float} - */ -getMaxSpeed : function ( -) -{ - return 0; -}, - -/** - * @method getCurrentOffMeshLinkData - * @return {cc.OffMeshLinkData} - */ -getCurrentOffMeshLinkData : function ( -) -{ - return cc.OffMeshLinkData; -}, - -/** - * @method getRadius - * @return {float} - */ -getRadius : function ( -) -{ - return 0; -}, - -/** - * @method setSyncFlag - * @param {cc.NavMeshAgent::NavMeshAgentSyncFlag} arg0 - */ -setSyncFlag : function ( -navmeshagentsyncflag -) -{ -}, - -/** - * @method getSyncFlag - * @return {cc.NavMeshAgent::NavMeshAgentSyncFlag} - */ -getSyncFlag : function ( -) -{ - return 0; -}, - -/** - * @method resume - */ -resume : function ( -) -{ -}, - -/** - * @method stop - */ -stop : function ( -) -{ -}, - -/** - * @method setMaxAcceleration - * @param {float} arg0 - */ -setMaxAcceleration : function ( -float -) -{ -}, - -/** - * @method setOrientationRefAxes - * @param {vec3_object} arg0 - */ -setOrientationRefAxes : function ( -vec3 -) -{ -}, - -/** - * @method getMaxAcceleration - * @return {float} - */ -getMaxAcceleration : function ( -) -{ - return 0; -}, - -/** - * @method setHeight - * @param {float} arg0 - */ -setHeight : function ( -float -) -{ -}, - -/** - * @method getObstacleAvoidanceType - * @return {unsigned char} - */ -getObstacleAvoidanceType : function ( -) -{ - return 0; -}, - -/** - * @method getVelocity - * @return {vec3_object} - */ -getVelocity : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method setRadius - * @param {float} arg0 - */ -setRadius : function ( -float -) -{ -}, - -/** - * @method setObstacleAvoidanceType - * @param {unsigned char} arg0 - */ -setObstacleAvoidanceType : function ( -char -) -{ -}, - -/** - * @method getNavMeshAgentComponentName - * @return {String} - */ -getNavMeshAgentComponentName : function ( -) -{ - return ; -}, - -/** - * @method create - * @param {cc.NavMeshAgentParam} arg0 - * @return {cc.NavMeshAgent} - */ -create : function ( -navmeshagentparam -) -{ - return cc.NavMeshAgent; -}, - -/** - * @method NavMeshAgent - * @constructor - */ -NavMeshAgent : function ( -) -{ -}, - -}; - -/** - * @class NavMeshObstacle - */ -jsb.NavMeshObstacle = { - -/** - * @method getSyncFlag - * @return {cc.NavMeshObstacle::NavMeshObstacleSyncFlag} - */ -getSyncFlag : function ( -) -{ - return 0; -}, - -/** - * @method initWith - * @param {float} arg0 - * @param {float} arg1 - * @return {bool} - */ -initWith : function ( -float, -float -) -{ - return false; -}, - -/** - * @method syncToObstacle - */ -syncToObstacle : function ( -) -{ -}, - -/** - * @method syncToNode - */ -syncToNode : function ( -) -{ -}, - -/** - * @method getHeight - * @return {float} - */ -getHeight : function ( -) -{ - return 0; -}, - -/** - * @method setSyncFlag - * @param {cc.NavMeshObstacle::NavMeshObstacleSyncFlag} arg0 - */ -setSyncFlag : function ( -navmeshobstaclesyncflag -) -{ -}, - -/** - * @method getRadius - * @return {float} - */ -getRadius : function ( -) -{ - return 0; -}, - -/** - * @method create - * @param {float} arg0 - * @param {float} arg1 - * @return {cc.NavMeshObstacle} - */ -create : function ( -float, -float -) -{ - return cc.NavMeshObstacle; -}, - -/** - * @method getNavMeshObstacleComponentName - * @return {String} - */ -getNavMeshObstacleComponentName : function ( -) -{ - return ; -}, - -/** - * @method NavMeshObstacle - * @constructor - */ -NavMeshObstacle : function ( -) -{ -}, - -}; - -/** - * @class NavMesh - */ -jsb.NavMesh = { - -/** - * @method removeNavMeshObstacle - * @param {cc.NavMeshObstacle} arg0 - */ -removeNavMeshObstacle : function ( -navmeshobstacle -) -{ -}, - -/** - * @method removeNavMeshAgent - * @param {cc.NavMeshAgent} arg0 - */ -removeNavMeshAgent : function ( -navmeshagent -) -{ -}, - -/** - * @method update - * @param {float} arg0 - */ -update : function ( -float -) -{ -}, - -/** - * @method isDebugDrawEnabled - * @return {bool} - */ -isDebugDrawEnabled : function ( -) -{ - return false; -}, - -/** - * @method addNavMeshAgent - * @param {cc.NavMeshAgent} arg0 - */ -addNavMeshAgent : function ( -navmeshagent -) -{ -}, - -/** - * @method addNavMeshObstacle - * @param {cc.NavMeshObstacle} arg0 - */ -addNavMeshObstacle : function ( -navmeshobstacle -) -{ -}, - -/** - * @method setDebugDrawEnable - * @param {bool} arg0 - */ -setDebugDrawEnable : function ( -bool -) -{ -}, - -/** - * @method debugDraw - * @param {cc.Renderer} arg0 - */ -debugDraw : function ( -renderer -) -{ -}, - -/** - * @method create - * @param {String} arg0 - * @param {String} arg1 - * @return {cc.NavMesh} - */ -create : function ( -str, -str -) -{ - return cc.NavMesh; -}, - -/** - * @method NavMesh - * @constructor - */ -NavMesh : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js deleted file mode 100644 index 8d6b550044..0000000000 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js +++ /dev/null @@ -1,2708 +0,0 @@ -/** - * @module cocos2dx_physics3d - */ -var jsb = jsb || {}; - -/** - * @class Physics3DShape - */ -jsb.Physics3DShape = { - -/** - * @method initConvexHull - * @param {vec3_object} arg0 - * @param {int} arg1 - * @return {bool} - */ -initConvexHull : function ( -vec3, -int -) -{ - return false; -}, - -/** - * @method getbtShape - * @return {btCollisionShape} - */ -getbtShape : function ( -) -{ - return btCollisionShape; -}, - -/** - * @method initSphere - * @param {float} arg0 - * @return {bool} - */ -initSphere : function ( -float -) -{ - return false; -}, - -/** - * @method initBox - * @param {vec3_object} arg0 - * @return {bool} - */ -initBox : function ( -vec3 -) -{ - return false; -}, - -/** - * @method initCapsule - * @param {float} arg0 - * @param {float} arg1 - * @return {bool} - */ -initCapsule : function ( -float, -float -) -{ - return false; -}, - -/** - * @method initCylinder - * @param {float} arg0 - * @param {float} arg1 - * @return {bool} - */ -initCylinder : function ( -float, -float -) -{ - return false; -}, - -/** - * @method getShapeType - * @return {cc.Physics3DShape::ShapeType} - */ -getShapeType : function ( -) -{ - return 0; -}, - -/** - * @method createBox - * @param {vec3_object} arg0 - * @return {cc.Physics3DShape} - */ -createBox : function ( -vec3 -) -{ - return cc.Physics3DShape; -}, - -/** - * @method createCylinder - * @param {float} arg0 - * @param {float} arg1 - * @return {cc.Physics3DShape} - */ -createCylinder : function ( -float, -float -) -{ - return cc.Physics3DShape; -}, - -/** - * @method createConvexHull - * @param {vec3_object} arg0 - * @param {int} arg1 - * @return {cc.Physics3DShape} - */ -createConvexHull : function ( -vec3, -int -) -{ - return cc.Physics3DShape; -}, - -/** - * @method createCapsule - * @param {float} arg0 - * @param {float} arg1 - * @return {cc.Physics3DShape} - */ -createCapsule : function ( -float, -float -) -{ - return cc.Physics3DShape; -}, - -/** - * @method createSphere - * @param {float} arg0 - * @return {cc.Physics3DShape} - */ -createSphere : function ( -float -) -{ - return cc.Physics3DShape; -}, - -/** - * @method Physics3DShape - * @constructor - */ -Physics3DShape : function ( -) -{ -}, - -}; - -/** - * @class Physics3DObject - */ -jsb.Physics3DObject = { - -/** - * @method setUserData - * @param {void} arg0 - */ -setUserData : function ( -void -) -{ -}, - -/** - * @method getUserData - * @return {void} - */ -getUserData : function ( -) -{ - return void; -}, - -/** - * @method getObjType - * @return {cc.Physics3DObject::PhysicsObjType} - */ -getObjType : function ( -) -{ - return 0; -}, - -/** - * @method setPhysicsWorld - * @param {cc.Physics3DWorld} arg0 - */ -setPhysicsWorld : function ( -physics3dworld -) -{ -}, - -/** - * @method getWorldTransform - * @return {mat4_object} - */ -getWorldTransform : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method getPhysicsWorld - * @return {cc.Physics3DWorld} - */ -getPhysicsWorld : function ( -) -{ - return cc.Physics3DWorld; -}, - -/** - * @method setMask - * @param {unsigned int} arg0 - */ -setMask : function ( -int -) -{ -}, - -/** - * @method getCollisionCallback - * @return {function} - */ -getCollisionCallback : function ( -) -{ - return std::function; -}, - -/** - * @method getMask - * @return {unsigned int} - */ -getMask : function ( -) -{ - return 0; -}, - -/** - * @method needCollisionCallback - * @return {bool} - */ -needCollisionCallback : function ( -) -{ - return false; -}, - -}; - -/** - * @class Physics3DRigidBody - */ -jsb.Physics3DRigidBody = { - -/** - * @method setGravity - * @param {vec3_object} arg0 - */ -setGravity : function ( -vec3 -) -{ -}, - -/** - * @method getFriction - * @return {float} - */ -getFriction : function ( -) -{ - return 0; -}, - -/** - * @method setAngularFactor -* @param {float|vec3_object} float -*/ -setAngularFactor : function( -vec3 -) -{ -}, - -/** - * @method addConstraint - * @param {cc.Physics3DConstraint} arg0 - */ -addConstraint : function ( -physics3dconstraint -) -{ -}, - -/** - * @method getRigidBody - * @return {btRigidBody} - */ -getRigidBody : function ( -) -{ - return btRigidBody; -}, - -/** - * @method getTotalForce - * @return {vec3_object} - */ -getTotalForce : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getConstraintCount - * @return {unsigned int} - */ -getConstraintCount : function ( -) -{ - return 0; -}, - -/** - * @method applyCentralForce - * @param {vec3_object} arg0 - */ -applyCentralForce : function ( -vec3 -) -{ -}, - -/** - * @method setMassProps - * @param {float} arg0 - * @param {vec3_object} arg1 - */ -setMassProps : function ( -float, -vec3 -) -{ -}, - -/** - * @method setFriction - * @param {float} arg0 - */ -setFriction : function ( -float -) -{ -}, - -/** - * @method setKinematic - * @param {bool} arg0 - */ -setKinematic : function ( -bool -) -{ -}, - -/** - * @method setDamping - * @param {float} arg0 - * @param {float} arg1 - */ -setDamping : function ( -float, -float -) -{ -}, - -/** - * @method applyImpulse - * @param {vec3_object} arg0 - * @param {vec3_object} arg1 - */ -applyImpulse : function ( -vec3, -vec3 -) -{ -}, - -/** - * @method isKinematic - * @return {bool} - */ -isKinematic : function ( -) -{ - return false; -}, - -/** - * @method applyTorque - * @param {vec3_object} arg0 - */ -applyTorque : function ( -vec3 -) -{ -}, - -/** - * @method setCcdMotionThreshold - * @param {float} arg0 - */ -setCcdMotionThreshold : function ( -float -) -{ -}, - -/** - * @method setRollingFriction - * @param {float} arg0 - */ -setRollingFriction : function ( -float -) -{ -}, - -/** - * @method getCcdMotionThreshold - * @return {float} - */ -getCcdMotionThreshold : function ( -) -{ - return 0; -}, - -/** - * @method getLinearFactor - * @return {vec3_object} - */ -getLinearFactor : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method applyDamping - * @param {float} arg0 - */ -applyDamping : function ( -float -) -{ -}, - -/** - * @method getAngularVelocity - * @return {vec3_object} - */ -getAngularVelocity : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method init - * @param {cc.Physics3DRigidBodyDes} arg0 - * @return {bool} - */ -init : function ( -physics3drigidbodydes -) -{ - return false; -}, - -/** - * @method applyTorqueImpulse - * @param {vec3_object} arg0 - */ -applyTorqueImpulse : function ( -vec3 -) -{ -}, - -/** - * @method setActive - * @param {bool} arg0 - */ -setActive : function ( -bool -) -{ -}, - -/** - * @method setLinearFactor - * @param {vec3_object} arg0 - */ -setLinearFactor : function ( -vec3 -) -{ -}, - -/** - * @method setLinearVelocity - * @param {vec3_object} arg0 - */ -setLinearVelocity : function ( -vec3 -) -{ -}, - -/** - * @method getLinearVelocity - * @return {vec3_object} - */ -getLinearVelocity : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method setCcdSweptSphereRadius - * @param {float} arg0 - */ -setCcdSweptSphereRadius : function ( -float -) -{ -}, - -/** - * @method applyForce - * @param {vec3_object} arg0 - * @param {vec3_object} arg1 - */ -applyForce : function ( -vec3, -vec3 -) -{ -}, - -/** - * @method setAngularVelocity - * @param {vec3_object} arg0 - */ -setAngularVelocity : function ( -vec3 -) -{ -}, - -/** - * @method applyCentralImpulse - * @param {vec3_object} arg0 - */ -applyCentralImpulse : function ( -vec3 -) -{ -}, - -/** - * @method getGravity - * @return {vec3_object} - */ -getGravity : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getRollingFriction - * @return {float} - */ -getRollingFriction : function ( -) -{ - return 0; -}, - -/** - * @method setCenterOfMassTransform - * @param {mat4_object} arg0 - */ -setCenterOfMassTransform : function ( -mat4 -) -{ -}, - -/** - * @method setInvInertiaDiagLocal - * @param {vec3_object} arg0 - */ -setInvInertiaDiagLocal : function ( -vec3 -) -{ -}, - -/** - * @method removeConstraint -* @param {unsigned int|cc.Physics3DConstraint} int -*/ -removeConstraint : function( -physics3dconstraint -) -{ -}, - -/** - * @method getTotalTorque - * @return {vec3_object} - */ -getTotalTorque : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getInvMass - * @return {float} - */ -getInvMass : function ( -) -{ - return 0; -}, - -/** - * @method getConstraint - * @param {unsigned int} arg0 - * @return {cc.Physics3DConstraint} - */ -getConstraint : function ( -int -) -{ - return cc.Physics3DConstraint; -}, - -/** - * @method getRestitution - * @return {float} - */ -getRestitution : function ( -) -{ - return 0; -}, - -/** - * @method getCcdSweptSphereRadius - * @return {float} - */ -getCcdSweptSphereRadius : function ( -) -{ - return 0; -}, - -/** - * @method getHitFraction - * @return {float} - */ -getHitFraction : function ( -) -{ - return 0; -}, - -/** - * @method getAngularDamping - * @return {float} - */ -getAngularDamping : function ( -) -{ - return 0; -}, - -/** - * @method getInvInertiaDiagLocal - * @return {vec3_object} - */ -getInvInertiaDiagLocal : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getCenterOfMassTransform - * @return {mat4_object} - */ -getCenterOfMassTransform : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method getAngularFactor - * @return {vec3_object} - */ -getAngularFactor : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method setRestitution - * @param {float} arg0 - */ -setRestitution : function ( -float -) -{ -}, - -/** - * @method setHitFraction - * @param {float} arg0 - */ -setHitFraction : function ( -float -) -{ -}, - -/** - * @method getLinearDamping - * @return {float} - */ -getLinearDamping : function ( -) -{ - return 0; -}, - -/** - * @method Physics3DRigidBody - * @constructor - */ -Physics3DRigidBody : function ( -) -{ -}, - -}; - -/** - * @class Physics3DComponent - */ -jsb.Physics3DComponent = { - -/** - * @method syncNodeToPhysics - */ -syncNodeToPhysics : function ( -) -{ -}, - -/** - * @method addToPhysicsWorld - * @param {cc.Physics3DWorld} arg0 - */ -addToPhysicsWorld : function ( -physics3dworld -) -{ -}, - -/** - * @method syncPhysicsToNode - */ -syncPhysicsToNode : function ( -) -{ -}, - -/** - * @method getPhysics3DObject - * @return {cc.Physics3DObject} - */ -getPhysics3DObject : function ( -) -{ - return cc.Physics3DObject; -}, - -/** - * @method setPhysics3DObject - * @param {cc.Physics3DObject} arg0 - */ -setPhysics3DObject : function ( -physics3dobject -) -{ -}, - -/** - * @method setSyncFlag - * @param {cc.Physics3DComponent::PhysicsSyncFlag} arg0 - */ -setSyncFlag : function ( -physicssyncflag -) -{ -}, - -/** - * @method setTransformInPhysics - * @param {vec3_object} arg0 - * @param {cc.Quaternion} arg1 - */ -setTransformInPhysics : function ( -vec3, -quaternion -) -{ -}, - -/** - * @method create -* @param {cc.Physics3DObject} physics3dobject -* @param {vec3_object} vec3 -* @param {cc.Quaternion} quaternion -* @return {cc.Physics3DComponent|cc.Physics3DComponent} -*/ -create : function( -physics3dobject, -vec3, -quaternion -) -{ - return cc.Physics3DComponent; -}, - -/** - * @method getPhysics3DComponentName - * @return {String} - */ -getPhysics3DComponentName : function ( -) -{ - return ; -}, - -/** - * @method Physics3DComponent - * @constructor - */ -Physics3DComponent : function ( -) -{ -}, - -}; - -/** - * @class PhysicsSprite3D - */ -jsb.PhysicsSprite3D = { - -/** - * @method syncNodeToPhysics - */ -syncNodeToPhysics : function ( -) -{ -}, - -/** - * @method syncPhysicsToNode - */ -syncPhysicsToNode : function ( -) -{ -}, - -/** - * @method getPhysicsObj - * @return {cc.Physics3DObject} - */ -getPhysicsObj : function ( -) -{ - return cc.Physics3DObject; -}, - -/** - * @method setSyncFlag - * @param {cc.Physics3DComponent::PhysicsSyncFlag} arg0 - */ -setSyncFlag : function ( -physicssyncflag -) -{ -}, - -/** - * @method PhysicsSprite3D - * @constructor - */ -PhysicsSprite3D : function ( -) -{ -}, - -}; - -/** - * @class Physics3DWorld - */ -jsb.Physics3DWorld = { - -/** - * @method setGravity - * @param {vec3_object} arg0 - */ -setGravity : function ( -vec3 -) -{ -}, - -/** - * @method stepSimulate - * @param {float} arg0 - */ -stepSimulate : function ( -float -) -{ -}, - -/** - * @method needCollisionChecking - * @return {bool} - */ -needCollisionChecking : function ( -) -{ - return false; -}, - -/** - * @method collisionChecking - */ -collisionChecking : function ( -) -{ -}, - -/** - * @method setGhostPairCallback - */ -setGhostPairCallback : function ( -) -{ -}, - -/** - * @method init - * @param {cc.Physics3DWorldDes} arg0 - * @return {bool} - */ -init : function ( -physics3dworlddes -) -{ - return false; -}, - -/** - * @method removeAllPhysics3DObjects - */ -removeAllPhysics3DObjects : function ( -) -{ -}, - -/** - * @method isDebugDrawEnabled - * @return {bool} - */ -isDebugDrawEnabled : function ( -) -{ - return false; -}, - -/** - * @method removeAllPhysics3DConstraints - */ -removeAllPhysics3DConstraints : function ( -) -{ -}, - -/** - * @method getGravity - * @return {vec3_object} - */ -getGravity : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method removePhysics3DConstraint - * @param {cc.Physics3DConstraint} arg0 - */ -removePhysics3DConstraint : function ( -physics3dconstraint -) -{ -}, - -/** - * @method addPhysics3DObject - * @param {cc.Physics3DObject} arg0 - */ -addPhysics3DObject : function ( -physics3dobject -) -{ -}, - -/** - * @method setDebugDrawEnable - * @param {bool} arg0 - */ -setDebugDrawEnable : function ( -bool -) -{ -}, - -/** - * @method removePhysics3DObject - * @param {cc.Physics3DObject} arg0 - */ -removePhysics3DObject : function ( -physics3dobject -) -{ -}, - -/** - * @method getPhysicsObject - * @param {btCollisionObject} arg0 - * @return {cc.Physics3DObject} - */ -getPhysicsObject : function ( -btcollisionobject -) -{ - return cc.Physics3DObject; -}, - -/** - * @method addPhysics3DConstraint - * @param {cc.Physics3DConstraint} arg0 - * @param {bool} arg1 - */ -addPhysics3DConstraint : function ( -physics3dconstraint, -bool -) -{ -}, - -/** - * @method debugDraw - * @param {cc.Renderer} arg0 - */ -debugDraw : function ( -renderer -) -{ -}, - -/** - * @method sweepShape - * @param {cc.Physics3DShape} arg0 - * @param {mat4_object} arg1 - * @param {mat4_object} arg2 - * @param {cc.Physics3DWorld::HitResult} arg3 - * @return {bool} - */ -sweepShape : function ( -physics3dshape, -mat4, -mat4, -hitresult -) -{ - return false; -}, - -/** - * @method create - * @param {cc.Physics3DWorldDes} arg0 - * @return {cc.Physics3DWorld} - */ -create : function ( -physics3dworlddes -) -{ - return cc.Physics3DWorld; -}, - -/** - * @method Physics3DWorld - * @constructor - */ -Physics3DWorld : function ( -) -{ -}, - -}; - -/** - * @class Physics3DConstraint - */ -jsb.Physics3DConstraint = { - -/** - * @method setEnabled - * @param {bool} arg0 - */ -setEnabled : function ( -bool -) -{ -}, - -/** - * @method setBreakingImpulse - * @param {float} arg0 - */ -setBreakingImpulse : function ( -float -) -{ -}, - -/** - * @method getUserData - * @return {void} - */ -getUserData : function ( -) -{ - return void; -}, - -/** - * @method getBreakingImpulse - * @return {float} - */ -getBreakingImpulse : function ( -) -{ - return 0; -}, - -/** - * @method getBodyA - * @return {cc.Physics3DRigidBody} - */ -getBodyA : function ( -) -{ - return cc.Physics3DRigidBody; -}, - -/** - * @method isEnabled - * @return {bool} - */ -isEnabled : function ( -) -{ - return false; -}, - -/** - * @method getOverrideNumSolverIterations - * @return {int} - */ -getOverrideNumSolverIterations : function ( -) -{ - return 0; -}, - -/** - * @method getBodyB - * @return {cc.Physics3DRigidBody} - */ -getBodyB : function ( -) -{ - return cc.Physics3DRigidBody; -}, - -/** - * @method setOverrideNumSolverIterations - * @param {int} arg0 - */ -setOverrideNumSolverIterations : function ( -int -) -{ -}, - -/** - * @method getConstraintType - * @return {cc.Physics3DConstraint::ConstraintType} - */ -getConstraintType : function ( -) -{ - return 0; -}, - -/** - * @method setUserData - * @param {void} arg0 - */ -setUserData : function ( -void -) -{ -}, - -/** - * @method getbtContraint - * @return {btTypedConstraint} - */ -getbtContraint : function ( -) -{ - return btTypedConstraint; -}, - -}; - -/** - * @class Physics3DPointToPointConstraint - */ -jsb.Physics3DPointToPointConstraint = { - -/** - * @method getPivotPointInA - * @return {vec3_object} - */ -getPivotPointInA : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getPivotPointInB - * @return {vec3_object} - */ -getPivotPointInB : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method init -* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody -* @param {cc.Physics3DRigidBody|vec3_object} physics3drigidbody -* @param {vec3_object} vec3 -* @param {vec3_object} vec3 -* @return {bool|bool} -*/ -init : function( -physics3drigidbody, -physics3drigidbody, -vec3, -vec3 -) -{ - return false; -}, - -/** - * @method setPivotPointInA - * @param {vec3_object} arg0 - */ -setPivotPointInA : function ( -vec3 -) -{ -}, - -/** - * @method setPivotPointInB - * @param {vec3_object} arg0 - */ -setPivotPointInB : function ( -vec3 -) -{ -}, - -/** - * @method create -* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody -* @param {cc.Physics3DRigidBody|vec3_object} physics3drigidbody -* @param {vec3_object} vec3 -* @param {vec3_object} vec3 -* @return {cc.Physics3DPointToPointConstraint|cc.Physics3DPointToPointConstraint} -*/ -create : function( -physics3drigidbody, -physics3drigidbody, -vec3, -vec3 -) -{ - return cc.Physics3DPointToPointConstraint; -}, - -/** - * @method Physics3DPointToPointConstraint - * @constructor - */ -Physics3DPointToPointConstraint : function ( -) -{ -}, - -}; - -/** - * @class Physics3DHingeConstraint - */ -jsb.Physics3DHingeConstraint = { - -/** - * @method getHingeAngle -* @param {mat4_object} mat4 -* @param {mat4_object} mat4 -* @return {float|float} -*/ -getHingeAngle : function( -mat4, -mat4 -) -{ - return 0; -}, - -/** - * @method getMotorTargetVelosity - * @return {float} - */ -getMotorTargetVelosity : function ( -) -{ - return 0; -}, - -/** - * @method getFrameOffsetA - * @return {mat4_object} - */ -getFrameOffsetA : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method getFrameOffsetB - * @return {mat4_object} - */ -getFrameOffsetB : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method setMaxMotorImpulse - * @param {float} arg0 - */ -setMaxMotorImpulse : function ( -float -) -{ -}, - -/** - * @method enableAngularMotor - * @param {bool} arg0 - * @param {float} arg1 - * @param {float} arg2 - */ -enableAngularMotor : function ( -bool, -float, -float -) -{ -}, - -/** - * @method getUpperLimit - * @return {float} - */ -getUpperLimit : function ( -) -{ - return 0; -}, - -/** - * @method getMaxMotorImpulse - * @return {float} - */ -getMaxMotorImpulse : function ( -) -{ - return 0; -}, - -/** - * @method getLowerLimit - * @return {float} - */ -getLowerLimit : function ( -) -{ - return 0; -}, - -/** - * @method setUseFrameOffset - * @param {bool} arg0 - */ -setUseFrameOffset : function ( -bool -) -{ -}, - -/** - * @method getEnableAngularMotor - * @return {bool} - */ -getEnableAngularMotor : function ( -) -{ - return false; -}, - -/** - * @method enableMotor - * @param {bool} arg0 - */ -enableMotor : function ( -bool -) -{ -}, - -/** - * @method getBFrame - * @return {mat4_object} - */ -getBFrame : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method setFrames - * @param {mat4_object} arg0 - * @param {mat4_object} arg1 - */ -setFrames : function ( -mat4, -mat4 -) -{ -}, - -/** - * @method getUseFrameOffset - * @return {bool} - */ -getUseFrameOffset : function ( -) -{ - return false; -}, - -/** - * @method setAngularOnly - * @param {bool} arg0 - */ -setAngularOnly : function ( -bool -) -{ -}, - -/** - * @method setLimit - * @param {float} arg0 - * @param {float} arg1 - * @param {float} arg2 - * @param {float} arg3 - * @param {float} arg4 - */ -setLimit : function ( -float, -float, -float, -float, -float -) -{ -}, - -/** - * @method setMotorTarget -* @param {float|cc.Quaternion} float -* @param {float|float} float -*/ -setMotorTarget : function( -quaternion, -float -) -{ -}, - -/** - * @method getAngularOnly - * @return {bool} - */ -getAngularOnly : function ( -) -{ - return false; -}, - -/** - * @method setAxis - * @param {vec3_object} arg0 - */ -setAxis : function ( -vec3 -) -{ -}, - -/** - * @method getAFrame - * @return {mat4_object} - */ -getAFrame : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method create -* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody|cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody -* @param {vec3_object|mat4_object|cc.Physics3DRigidBody|cc.Physics3DRigidBody} vec3 -* @param {vec3_object|bool|vec3_object|mat4_object} vec3 -* @param {bool|vec3_object|mat4_object} bool -* @param {vec3_object|bool} vec3 -* @param {vec3_object} vec3 -* @param {bool} bool -* @return {cc.Physics3DHingeConstraint|cc.Physics3DHingeConstraint|cc.Physics3DHingeConstraint|cc.Physics3DHingeConstraint} -*/ -create : function( -physics3drigidbody, -physics3drigidbody, -vec3, -vec3, -vec3, -vec3, -bool -) -{ - return cc.Physics3DHingeConstraint; -}, - -/** - * @method Physics3DHingeConstraint - * @constructor - */ -Physics3DHingeConstraint : function ( -) -{ -}, - -}; - -/** - * @class Physics3DSliderConstraint - */ -jsb.Physics3DSliderConstraint = { - -/** - * @method setPoweredAngMotor - * @param {bool} arg0 - */ -setPoweredAngMotor : function ( -bool -) -{ -}, - -/** - * @method getDampingLimAng - * @return {float} - */ -getDampingLimAng : function ( -) -{ - return 0; -}, - -/** - * @method setRestitutionOrthoLin - * @param {float} arg0 - */ -setRestitutionOrthoLin : function ( -float -) -{ -}, - -/** - * @method setRestitutionDirLin - * @param {float} arg0 - */ -setRestitutionDirLin : function ( -float -) -{ -}, - -/** - * @method getLinearPos - * @return {float} - */ -getLinearPos : function ( -) -{ - return 0; -}, - -/** - * @method getFrameOffsetA - * @return {mat4_object} - */ -getFrameOffsetA : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method getFrameOffsetB - * @return {mat4_object} - */ -getFrameOffsetB : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method setPoweredLinMotor - * @param {bool} arg0 - */ -setPoweredLinMotor : function ( -bool -) -{ -}, - -/** - * @method getDampingDirAng - * @return {float} - */ -getDampingDirAng : function ( -) -{ - return 0; -}, - -/** - * @method getRestitutionLimLin - * @return {float} - */ -getRestitutionLimLin : function ( -) -{ - return 0; -}, - -/** - * @method getSoftnessOrthoAng - * @return {float} - */ -getSoftnessOrthoAng : function ( -) -{ - return 0; -}, - -/** - * @method setSoftnessOrthoLin - * @param {float} arg0 - */ -setSoftnessOrthoLin : function ( -float -) -{ -}, - -/** - * @method setSoftnessLimLin - * @param {float} arg0 - */ -setSoftnessLimLin : function ( -float -) -{ -}, - -/** - * @method getAngularPos - * @return {float} - */ -getAngularPos : function ( -) -{ - return 0; -}, - -/** - * @method setRestitutionLimAng - * @param {float} arg0 - */ -setRestitutionLimAng : function ( -float -) -{ -}, - -/** - * @method setUpperLinLimit - * @param {float} arg0 - */ -setUpperLinLimit : function ( -float -) -{ -}, - -/** - * @method setDampingDirLin - * @param {float} arg0 - */ -setDampingDirLin : function ( -float -) -{ -}, - -/** - * @method getUpperAngLimit - * @return {float} - */ -getUpperAngLimit : function ( -) -{ - return 0; -}, - -/** - * @method getDampingDirLin - * @return {float} - */ -getDampingDirLin : function ( -) -{ - return 0; -}, - -/** - * @method getSoftnessDirAng - * @return {float} - */ -getSoftnessDirAng : function ( -) -{ - return 0; -}, - -/** - * @method getPoweredAngMotor - * @return {bool} - */ -getPoweredAngMotor : function ( -) -{ - return false; -}, - -/** - * @method setLowerAngLimit - * @param {float} arg0 - */ -setLowerAngLimit : function ( -float -) -{ -}, - -/** - * @method setUpperAngLimit - * @param {float} arg0 - */ -setUpperAngLimit : function ( -float -) -{ -}, - -/** - * @method setTargetLinMotorVelocity - * @param {float} arg0 - */ -setTargetLinMotorVelocity : function ( -float -) -{ -}, - -/** - * @method setDampingLimAng - * @param {float} arg0 - */ -setDampingLimAng : function ( -float -) -{ -}, - -/** - * @method getRestitutionLimAng - * @return {float} - */ -getRestitutionLimAng : function ( -) -{ - return 0; -}, - -/** - * @method getUseFrameOffset - * @return {bool} - */ -getUseFrameOffset : function ( -) -{ - return false; -}, - -/** - * @method getSoftnessOrthoLin - * @return {float} - */ -getSoftnessOrthoLin : function ( -) -{ - return 0; -}, - -/** - * @method getDampingOrthoAng - * @return {float} - */ -getDampingOrthoAng : function ( -) -{ - return 0; -}, - -/** - * @method setUseFrameOffset - * @param {bool} arg0 - */ -setUseFrameOffset : function ( -bool -) -{ -}, - -/** - * @method setLowerLinLimit - * @param {float} arg0 - */ -setLowerLinLimit : function ( -float -) -{ -}, - -/** - * @method getRestitutionDirLin - * @return {float} - */ -getRestitutionDirLin : function ( -) -{ - return 0; -}, - -/** - * @method getTargetLinMotorVelocity - * @return {float} - */ -getTargetLinMotorVelocity : function ( -) -{ - return 0; -}, - -/** - * @method getLowerLinLimit - * @return {float} - */ -getLowerLinLimit : function ( -) -{ - return 0; -}, - -/** - * @method getSoftnessLimLin - * @return {float} - */ -getSoftnessLimLin : function ( -) -{ - return 0; -}, - -/** - * @method setDampingOrthoAng - * @param {float} arg0 - */ -setDampingOrthoAng : function ( -float -) -{ -}, - -/** - * @method setSoftnessDirAng - * @param {float} arg0 - */ -setSoftnessDirAng : function ( -float -) -{ -}, - -/** - * @method getPoweredLinMotor - * @return {bool} - */ -getPoweredLinMotor : function ( -) -{ - return false; -}, - -/** - * @method setRestitutionOrthoAng - * @param {float} arg0 - */ -setRestitutionOrthoAng : function ( -float -) -{ -}, - -/** - * @method setDampingDirAng - * @param {float} arg0 - */ -setDampingDirAng : function ( -float -) -{ -}, - -/** - * @method setFrames - * @param {mat4_object} arg0 - * @param {mat4_object} arg1 - */ -setFrames : function ( -mat4, -mat4 -) -{ -}, - -/** - * @method getRestitutionOrthoAng - * @return {float} - */ -getRestitutionOrthoAng : function ( -) -{ - return 0; -}, - -/** - * @method getMaxAngMotorForce - * @return {float} - */ -getMaxAngMotorForce : function ( -) -{ - return 0; -}, - -/** - * @method getDampingOrthoLin - * @return {float} - */ -getDampingOrthoLin : function ( -) -{ - return 0; -}, - -/** - * @method getUpperLinLimit - * @return {float} - */ -getUpperLinLimit : function ( -) -{ - return 0; -}, - -/** - * @method setMaxLinMotorForce - * @param {float} arg0 - */ -setMaxLinMotorForce : function ( -float -) -{ -}, - -/** - * @method getRestitutionOrthoLin - * @return {float} - */ -getRestitutionOrthoLin : function ( -) -{ - return 0; -}, - -/** - * @method setTargetAngMotorVelocity - * @param {float} arg0 - */ -setTargetAngMotorVelocity : function ( -float -) -{ -}, - -/** - * @method getSoftnessLimAng - * @return {float} - */ -getSoftnessLimAng : function ( -) -{ - return 0; -}, - -/** - * @method setRestitutionDirAng - * @param {float} arg0 - */ -setRestitutionDirAng : function ( -float -) -{ -}, - -/** - * @method getDampingLimLin - * @return {float} - */ -getDampingLimLin : function ( -) -{ - return 0; -}, - -/** - * @method getLowerAngLimit - * @return {float} - */ -getLowerAngLimit : function ( -) -{ - return 0; -}, - -/** - * @method getRestitutionDirAng - * @return {float} - */ -getRestitutionDirAng : function ( -) -{ - return 0; -}, - -/** - * @method getTargetAngMotorVelocity - * @return {float} - */ -getTargetAngMotorVelocity : function ( -) -{ - return 0; -}, - -/** - * @method setRestitutionLimLin - * @param {float} arg0 - */ -setRestitutionLimLin : function ( -float -) -{ -}, - -/** - * @method getMaxLinMotorForce - * @return {float} - */ -getMaxLinMotorForce : function ( -) -{ - return 0; -}, - -/** - * @method setDampingOrthoLin - * @param {float} arg0 - */ -setDampingOrthoLin : function ( -float -) -{ -}, - -/** - * @method setSoftnessOrthoAng - * @param {float} arg0 - */ -setSoftnessOrthoAng : function ( -float -) -{ -}, - -/** - * @method setDampingLimLin - * @param {float} arg0 - */ -setDampingLimLin : function ( -float -) -{ -}, - -/** - * @method setSoftnessDirLin - * @param {float} arg0 - */ -setSoftnessDirLin : function ( -float -) -{ -}, - -/** - * @method setMaxAngMotorForce - * @param {float} arg0 - */ -setMaxAngMotorForce : function ( -float -) -{ -}, - -/** - * @method getSoftnessDirLin - * @return {float} - */ -getSoftnessDirLin : function ( -) -{ - return 0; -}, - -/** - * @method setSoftnessLimAng - * @param {float} arg0 - */ -setSoftnessLimAng : function ( -float -) -{ -}, - -/** - * @method getUseLinearReferenceFrameA - * @return {bool} - */ -getUseLinearReferenceFrameA : function ( -) -{ - return false; -}, - -/** - * @method create - * @param {cc.Physics3DRigidBody} arg0 - * @param {cc.Physics3DRigidBody} arg1 - * @param {mat4_object} arg2 - * @param {mat4_object} arg3 - * @param {bool} arg4 - * @return {cc.Physics3DSliderConstraint} - */ -create : function ( -physics3drigidbody, -physics3drigidbody, -mat4, -mat4, -bool -) -{ - return cc.Physics3DSliderConstraint; -}, - -/** - * @method Physics3DSliderConstraint - * @constructor - */ -Physics3DSliderConstraint : function ( -) -{ -}, - -}; - -/** - * @class Physics3DConeTwistConstraint - */ -jsb.Physics3DConeTwistConstraint = { - -/** - * @method getBFrame - * @return {mat4_object} - */ -getBFrame : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method setFixThresh - * @param {float} arg0 - */ -setFixThresh : function ( -float -) -{ -}, - -/** - * @method getFrameOffsetB - * @return {mat4_object} - */ -getFrameOffsetB : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method getFrameOffsetA - * @return {mat4_object} - */ -getFrameOffsetA : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method getFixThresh - * @return {float} - */ -getFixThresh : function ( -) -{ - return 0; -}, - -/** - * @method getSwingSpan2 - * @return {float} - */ -getSwingSpan2 : function ( -) -{ - return 0; -}, - -/** - * @method getSwingSpan1 - * @return {float} - */ -getSwingSpan1 : function ( -) -{ - return 0; -}, - -/** - * @method setMaxMotorImpulse - * @param {float} arg0 - */ -setMaxMotorImpulse : function ( -float -) -{ -}, - -/** - * @method setFrames - * @param {mat4_object} arg0 - * @param {mat4_object} arg1 - */ -setFrames : function ( -mat4, -mat4 -) -{ -}, - -/** - * @method getTwistAngle - * @return {float} - */ -getTwistAngle : function ( -) -{ - return 0; -}, - -/** - * @method GetPointForAngle - * @param {float} arg0 - * @param {float} arg1 - * @return {vec3_object} - */ -GetPointForAngle : function ( -float, -float -) -{ - return cc.Vec3; -}, - -/** - * @method setMaxMotorImpulseNormalized - * @param {float} arg0 - */ -setMaxMotorImpulseNormalized : function ( -float -) -{ -}, - -/** - * @method getTwistSpan - * @return {float} - */ -getTwistSpan : function ( -) -{ - return 0; -}, - -/** - * @method setDamping - * @param {float} arg0 - */ -setDamping : function ( -float -) -{ -}, - -/** - * @method setLimit - * @param {float} arg0 - * @param {float} arg1 - * @param {float} arg2 - * @param {float} arg3 - * @param {float} arg4 - * @param {float} arg5 - */ -setLimit : function ( -float, -float, -float, -float, -float, -float -) -{ -}, - -/** - * @method getAFrame - * @return {mat4_object} - */ -getAFrame : function ( -) -{ - return cc.Mat4; -}, - -/** - * @method enableMotor - * @param {bool} arg0 - */ -enableMotor : function ( -bool -) -{ -}, - -/** - * @method create -* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody -* @param {cc.Physics3DRigidBody|mat4_object} physics3drigidbody -* @param {mat4_object} mat4 -* @param {mat4_object} mat4 -* @return {cc.Physics3DConeTwistConstraint|cc.Physics3DConeTwistConstraint} -*/ -create : function( -physics3drigidbody, -physics3drigidbody, -mat4, -mat4 -) -{ - return cc.Physics3DConeTwistConstraint; -}, - -/** - * @method Physics3DConeTwistConstraint - * @constructor - */ -Physics3DConeTwistConstraint : function ( -) -{ -}, - -}; - -/** - * @class Physics3D6DofConstraint - */ -jsb.Physics3D6DofConstraint = { - -/** - * @method setLinearLowerLimit - * @param {vec3_object} arg0 - */ -setLinearLowerLimit : function ( -vec3 -) -{ -}, - -/** - * @method getLinearLowerLimit - * @return {vec3_object} - */ -getLinearLowerLimit : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getAngularUpperLimit - * @return {vec3_object} - */ -getAngularUpperLimit : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method getUseFrameOffset - * @return {bool} - */ -getUseFrameOffset : function ( -) -{ - return false; -}, - -/** - * @method getLinearUpperLimit - * @return {vec3_object} - */ -getLinearUpperLimit : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method setAngularLowerLimit - * @param {vec3_object} arg0 - */ -setAngularLowerLimit : function ( -vec3 -) -{ -}, - -/** - * @method isLimited - * @param {int} arg0 - * @return {bool} - */ -isLimited : function ( -int -) -{ - return false; -}, - -/** - * @method setUseFrameOffset - * @param {bool} arg0 - */ -setUseFrameOffset : function ( -bool -) -{ -}, - -/** - * @method setLinearUpperLimit - * @param {vec3_object} arg0 - */ -setLinearUpperLimit : function ( -vec3 -) -{ -}, - -/** - * @method getAngularLowerLimit - * @return {vec3_object} - */ -getAngularLowerLimit : function ( -) -{ - return cc.Vec3; -}, - -/** - * @method setAngularUpperLimit - * @param {vec3_object} arg0 - */ -setAngularUpperLimit : function ( -vec3 -) -{ -}, - -/** - * @method create -* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody -* @param {mat4_object|cc.Physics3DRigidBody} mat4 -* @param {bool|mat4_object} bool -* @param {mat4_object} mat4 -* @param {bool} bool -* @return {cc.Physics3D6DofConstraint|cc.Physics3D6DofConstraint} -*/ -create : function( -physics3drigidbody, -physics3drigidbody, -mat4, -mat4, -bool -) -{ - return cc.Physics3D6DofConstraint; -}, - -/** - * @method Physics3D6DofConstraint - * @constructor - */ -Physics3D6DofConstraint : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 6c57dea304..7d40d6b760 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -40179,6 +40179,26 @@ bool js_cocos2dx_MotionStreak_setTexture(JSContext *cx, uint32_t argc, jsval *vp JS_ReportError(cx, "js_cocos2dx_MotionStreak_setTexture : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_MotionStreak_setMinSeg(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_MotionStreak_setMinSeg : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_MotionStreak_setMinSeg : Error processing arguments"); + cobj->setMinSeg(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_MotionStreak_setMinSeg : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_MotionStreak_getTexture(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -40224,6 +40244,24 @@ bool js_cocos2dx_MotionStreak_tintWithColor(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_MotionStreak_tintWithColor : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_MotionStreak_getMinSeg(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_MotionStreak_getMinSeg : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getMinSeg(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_MotionStreak_getMinSeg : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_MotionStreak_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -40244,6 +40282,26 @@ bool js_cocos2dx_MotionStreak_setBlendFunc(JSContext *cx, uint32_t argc, jsval * JS_ReportError(cx, "js_cocos2dx_MotionStreak_setBlendFunc : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_MotionStreak_setFadeTime(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_MotionStreak_setFadeTime : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_MotionStreak_setFadeTime : Error processing arguments"); + cobj->setFadeTime(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_MotionStreak_setFadeTime : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_MotionStreak_setStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -40264,6 +40322,24 @@ bool js_cocos2dx_MotionStreak_setStartingPositionInitialized(JSContext *cx, uint JS_ReportError(cx, "js_cocos2dx_MotionStreak_setStartingPositionInitialized : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_MotionStreak_getFadeTime(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_MotionStreak_getFadeTime : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getFadeTime(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_MotionStreak_getFadeTime : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_MotionStreak_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -40615,10 +40691,14 @@ void js_register_cocos2dx_MotionStreak(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec funcs[] = { JS_FN("reset", js_cocos2dx_MotionStreak_reset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTexture", js_cocos2dx_MotionStreak_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMinSeg", js_cocos2dx_MotionStreak_setMinSeg, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTexture", js_cocos2dx_MotionStreak_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("tintWithColor", js_cocos2dx_MotionStreak_tintWithColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMinSeg", js_cocos2dx_MotionStreak_getMinSeg, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setBlendFunc", js_cocos2dx_MotionStreak_setBlendFunc, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFadeTime", js_cocos2dx_MotionStreak_setFadeTime, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setStartingPositionInitialized", js_cocos2dx_MotionStreak_setStartingPositionInitialized, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFadeTime", js_cocos2dx_MotionStreak_getFadeTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getBlendFunc", js_cocos2dx_MotionStreak_getBlendFunc, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isStartingPositionInitialized", js_cocos2dx_MotionStreak_isStartingPositionInitialized, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isFastMode", js_cocos2dx_MotionStreak_isFastMode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index 48b3cd6a9d..4188f9b70d 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -2454,10 +2454,14 @@ void js_register_cocos2dx_MotionStreak(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_MotionStreak_reset(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_setTexture(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_MotionStreak_setMinSeg(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_getTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_tintWithColor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_MotionStreak_getMinSeg(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_MotionStreak_setFadeTime(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_setStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_MotionStreak_getFadeTime(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_isStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_MotionStreak_isFastMode(JSContext *cx, uint32_t argc, jsval *vp); From 8633eb22104e498371fa2695caf6a7ac02fcc678 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Thu, 12 May 2016 18:22:43 +0800 Subject: [PATCH 6/9] Solve the crash in simulator if there is no return value of onTouchBegan. --- .../manual/jsb_event_dispatcher_manual.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/native/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp index dded784665..66a83d568d 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp @@ -41,8 +41,15 @@ bool js_EventListenerTouchOneByOne_create(JSContext *cx, uint32_t argc, jsval *v if (!ok) return false; - CCASSERT(jsret.isBoolean(), "the return value of onTouchBegan isn't boolean"); - return jsret.toBoolean(); + // Solve the crash when there is no return value of onTouchBegan. + // related issue : https://github.com/cocos-creator/fireball/issues/2557 + // CCASSERT(jsret.isBoolean(), "the return value of onTouchBegan isn't boolean"); + // return jsret.toBoolean(); + if (jsret.isBoolean()) { + return jsret.toBoolean(); + } else { + return false; + } }; ret->onTouchMoved = [ret](Touch* touch, Event* event) { From 76cee016f673c425949583b6386d76d41472dde2 Mon Sep 17 00:00:00 2001 From: 2youyou2 <501251991@qq.com> Date: Fri, 13 May 2016 15:48:17 +0800 Subject: [PATCH 7/9] default search path should not be empty --- native/cocos/platform/CCFileUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/cocos/platform/CCFileUtils.cpp b/native/cocos/platform/CCFileUtils.cpp index 50f85713ae..3eaa525153 100644 --- a/native/cocos/platform/CCFileUtils.cpp +++ b/native/cocos/platform/CCFileUtils.cpp @@ -923,7 +923,7 @@ void FileUtils::setWritablePath(const std::string& writablePath) void FileUtils::setDefaultResourceRootPath(const std::string& resRootPath) { - if (_defaultResRootPath == resRootPath) + if (resRootPath.empty() || _defaultResRootPath == resRootPath) return; if (!_searchPathArray.empty() && !_defaultResRootPath.empty()) From db921c300c6a3c116f4961efb5ccdbbb6aa069fe Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Tue, 17 May 2016 17:26:44 +0800 Subject: [PATCH 8/9] update cocos2d_specifics and jsb_cocos2d --- .../js-bindings/manual/cocos2d_specifics.cpp | 404 ------------------ .../js-bindings/script/jsb_cocos2d.js | 174 ++++++++ 2 files changed, 174 insertions(+), 404 deletions(-) diff --git a/native/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/native/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 31428d7868..c954efc590 100644 --- a/native/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/native/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -3069,392 +3069,6 @@ bool js_cocos2dx_ccGLEnableVertexAttribs(JSContext *cx, uint32_t argc, jsval *vp return false; } - - -bool js_cocos2dx_ccpAdd(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0 + arg1; - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpDistanceSQ(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - float ret = arg0.getDistanceSq(arg1); - - jsval jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpDistance(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - float ret = arg0.getDistance(arg1); - - jsval jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpClamp(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 3) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - cocos2d::Point arg2; - ok &= jsval_to_ccpoint(cx, args.get(2), &arg2); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0.getClampPoint(arg1, arg2); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpLengthSQ(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - float ret = arg0.getLengthSq(); - - jsval jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpLength(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - float ret = arg0.getLength(); - - jsval jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpNeg(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = -arg0; - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpSub(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0 - arg1; - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpMult(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - - double arg1; - ok &= JS::ToNumber(cx, args.get(1), &arg1); - - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0 * arg1; - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - -bool js_cocos2dx_ccpMidpoint(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0.getMidpoint(arg1); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} - - -bool js_cocos2dx_ccpDot(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - float ret = arg0.dot(arg1); - - jsval jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} - -bool js_cocos2dx_ccpCross(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - float ret = arg0.cross(arg1); - - jsval jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} - -bool js_cocos2dx_ccpPerp(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0.getPerp(); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - - -bool js_cocos2dx_ccpRPerp(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0.getRPerp(); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - - -bool js_cocos2dx_ccpProject(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0.project(arg1); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} - -bool js_cocos2dx_ccpRotate(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 2) { - cocos2d::Point arg0; - ok &= jsval_to_ccpoint(cx, args.get(0), &arg0); - cocos2d::Point arg1; - ok &= jsval_to_ccpoint(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - Point ret = arg0.rotate(arg1); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} - -bool js_cocos2dx_ccpNormalize(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::Vec2 ret; - ok &= jsval_to_vector2(cx, args.get(0), &ret); - JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - - ret.normalize(); - - jsval jsret = ccpoint_to_jsval(cx, ret); - args.rval().set(jsret); - - return true; - } - - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} - bool js_cocos2dx_ccmat4CreateTranslation(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -5581,24 +5195,6 @@ void register_cocos2dx_js_core(JSContext* cx, JS::HandleObject global) JS_DefineFunction(cx, tmpObj, "getScriptObject", js_cocos2dx_ComponentJS_getScriptObject, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); JS_DefineFunction(cx, ccObj, "glEnableVertexAttribs", js_cocos2dx_ccGLEnableVertexAttribs, 1, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pAdd", js_cocos2dx_ccpAdd, 1, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pDistanceSQ", js_cocos2dx_ccpDistanceSQ, 1, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pDistance", js_cocos2dx_ccpDistance, 1, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pSub", js_cocos2dx_ccpSub, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pNeg", js_cocos2dx_ccpNeg, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pMult", js_cocos2dx_ccpMult, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pMidpoint", js_cocos2dx_ccpMidpoint, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pDot", js_cocos2dx_ccpDot, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pCross", js_cocos2dx_ccpCross, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pPerp", js_cocos2dx_ccpPerp, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pRPerp", js_cocos2dx_ccpRPerp, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pProject", js_cocos2dx_ccpProject, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pRotate", js_cocos2dx_ccpRotate, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pNormalize", js_cocos2dx_ccpNormalize, 0, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pClamp", js_cocos2dx_ccpClamp, 2, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pLengthSQ", js_cocos2dx_ccpLengthSQ, 1, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "pLength", js_cocos2dx_ccpLength, 1, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, ccObj, "registerTargetedDelegate", js_cocos2dx_JSTouchDelegate_registerTargetedDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, ccObj, "registerStandardDelegate", js_cocos2dx_JSTouchDelegate_registerStandardDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT); diff --git a/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js b/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js index c4bf0ac310..21b6162319 100644 --- a/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js +++ b/native/cocos/scripting/js-bindings/script/jsb_cocos2d.js @@ -792,6 +792,180 @@ cc.pRotateByAngle = function (v, pivot, angle) { return r; }; +/** + * Calculates sum of two points. + * @method pAdd + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Vec2} + */ +cc.pAdd = function (v1, v2) { + return cc.p(v1.x + v2.x, v1.y + v2.y); +}; + +/** + * Calculates the square distance between two points (not calling sqrt() ). + * @method pDistanceSQ + * @param {Vec2} point1 + * @param {Vec2} point2 + * @return {Number} + */ +cc.pDistanceSQ = function(point1, point2){ + return cc.pLengthSQ(cc.pSub(point1,point2)); +}; + +/** + * Calculates the distance between two points. + * @method pDistance + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Number} + */ +cc.pDistance = function (v1, v2) { + return cc.pLength(cc.pSub(v1, v2)); +}; + +/** + * Calculates difference of two points. + * @method pSub + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Vec2} + */ +cc.pSub = function (v1, v2) { + return cc.p(v1.x - v2.x, v1.y - v2.y); +}; + +/** + * Returns opposite of Vec2. + * @method pNeg + * @param {Vec2} point + * @return {Vec2} + */ +cc.pNeg = function (point) { + return cc.p(-point.x, -point.y); +}; + +/** + * Returns point multiplied by given factor. + * @method pMult + * @param {Vec2} point + * @param {Number} floatVar + * @return {Vec2} + */ +cc.pMult = function (point, floatVar) { + return cc.p(point.x * floatVar, point.y * floatVar); +}; + +/** + * Calculates midpoint between two points. + * @method pMidpoint + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Vec2} + */ +cc.pMidpoint = function (v1, v2) { + return cc.pMult(cc.pAdd(v1, v2), 0.5); +}; + +/** + * Calculates dot product of two points. + * @method pDot + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Number} + */ +cc.pDot = function (v1, v2) { + return v1.x * v2.x + v1.y * v2.y; +}; + +/** + * Calculates cross product of two points. + * @method pCross + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Number} + */ +cc.pCross = function (v1, v2) { + return v1.x * v2.y - v1.y * v2.x; +}; + +/** + * Calculates perpendicular of v, + * rotated 90 degrees counter-clockwise -- cross(v, perp(v)) greater than 0. + * @method pPerp + * @param {Vec2} point + * @return {Vec2} + */ +cc.pPerp = function (point) { + return cc.p(-point.y, point.x); +}; + +/** + * Calculates perpendicular of v, + * rotated 90 degrees clockwise -- cross(v, rperp(v)) smaller than 0. + * @method pRPerp + * @param {Vec2} point + * @return {Vec2} + */ +cc.pRPerp = function (point) { + return cc.p(point.y, -point.x); +}; + +/** + * Calculates the projection of v1 over v2. + * @method pProject + * @param {Vec2} v1 + * @param {Vec2} v2 + * @return {Vec2} + */ +cc.pProject = function (v1, v2) { + return cc.pMult(v2, cc.pDot(v1, v2) / cc.pDot(v2, v2)); +}; + +/** + * Returns this vector with a magnitude of 1. + * @method pNormalize + * @param {Vec2} v + * @return {Vec2} + */ +cc.pNormalize = function (v) { + var n = cc.pLength(v); + return n === 0 ? cc.p(v) : cc.pMult(v, 1.0 / n); +}; + +/** + * Clamp a point between from and to. + * @method pClamp + * @param {Vec2} p + * @param {Vec2} min_inclusive + * @param {Vec2} max_inclusive + * @return {Vec2} + */ +cc.pClamp = function (p, min_inclusive, max_inclusive) { + return cc.p(cc.clampf(p.x, min_inclusive.x, max_inclusive.x), cc.clampf(p.y, min_inclusive.y, max_inclusive.y)); +}; + +/** + * Calculates the square length of a cc.Vec2 (not calling sqrt() ). + * @method pLengthSQ + * @param {Vec2} v + * @return {Number} + */ +cc.pLengthSQ = function (v) { + return cc.pDot(v, v); +}; + +/** + * Calculates distance between point an origin. + * @method pLength + * @param {Vec2} v + * @return {Number} + */ +cc.pLength = function (v) { + return Math.sqrt(cc.pLengthSQ(v)); +}; + /** * A general line-line intersection test * @param {cc.Point} A A is the startpoint for the first line P1 = (p1 - p2). From 9ce7955434a14cca4285461d21da4adbdce3e89c Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 17 May 2016 17:33:11 +0800 Subject: [PATCH 9/9] Some small fixes --- native/cocos/platform/CCFileUtils.cpp | 2 +- .../js-bindings/manual/ScriptingCore.cpp | 2 +- .../local-storage/LocalStorage-android.cpp | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/native/cocos/platform/CCFileUtils.cpp b/native/cocos/platform/CCFileUtils.cpp index 3eaa525153..ee4dc8d7a7 100644 --- a/native/cocos/platform/CCFileUtils.cpp +++ b/native/cocos/platform/CCFileUtils.cpp @@ -923,7 +923,7 @@ void FileUtils::setWritablePath(const std::string& writablePath) void FileUtils::setDefaultResourceRootPath(const std::string& resRootPath) { - if (resRootPath.empty() || _defaultResRootPath == resRootPath) + if (resRootPath.empty() || _defaultResRootPath == resRootPath) return; if (!_searchPathArray.empty() && !_defaultResRootPath.empty()) diff --git a/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index 93bfa849a9..40df50f6c3 100644 --- a/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -415,7 +415,7 @@ void registerDefaultClasses(JSContext* cx, JS::HandleObject global) { // register some global functions JS_DefineFunction(cx, global, "require", ScriptingCore::executeScript, 1, JSPROP_PERMANENT); - JS_DefineFunction(cx, global, "log", ScriptingCore::log, 0, JSPROP_READONLY | JSPROP_PERMANENT); + JS_DefineFunction(cx, global, "log", ScriptingCore::log, 0, JSPROP_PERMANENT); JS_DefineFunction(cx, global, "executeScript", ScriptingCore::executeScript, 1, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, global, "forceGC", ScriptingCore::forceGC, 0, JSPROP_READONLY | JSPROP_PERMANENT); diff --git a/native/cocos/storage/local-storage/LocalStorage-android.cpp b/native/cocos/storage/local-storage/LocalStorage-android.cpp index 8bddbf357d..46d75c8b01 100644 --- a/native/cocos/storage/local-storage/LocalStorage-android.cpp +++ b/native/cocos/storage/local-storage/LocalStorage-android.cpp @@ -97,14 +97,20 @@ bool localStorageGetItem( const std::string& key, std::string *outItem ) jstring jret = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID, jkey); if (jret == nullptr) { + t.env->DeleteLocalRef(jret); + t.env->DeleteLocalRef(jkey); + t.env->DeleteLocalRef(t.classID); return false; } - auto value = JniHelper::jstring2string(jret); - outItem->assign(value); - t.env->DeleteLocalRef(jret); - t.env->DeleteLocalRef(jkey); - t.env->DeleteLocalRef(t.classID); - return true; + else + { + auto value = JniHelper::jstring2string(jret); + outItem->assign(value); + t.env->DeleteLocalRef(jret); + t.env->DeleteLocalRef(jkey); + t.env->DeleteLocalRef(t.classID); + return true; + } } else {