Coder Social home page Coder Social logo

Comments (8)

GuoLei1990 avatar GuoLei1990 commented on May 23, 2024

LayaMotionState 是没有C++代码实现的,是采用emsdk在js中模拟了对C++对象的继承,我可以给你IDL文件的声明代码
[JSImplementation="btMotionState"]
interface LayaMotionState {
void LayaMotionState();
void getWorldTransform([Ref] btTransform worldTrans);
void setWorldTransform([Const, Ref] btTransform worldTrans);
};

from layaair.

grant930 avatar grant930 commented on May 23, 2024

@GuoLei1990 非常感谢。目前也是通过JSImplementation来实现对其他接口的继承。还有一个相关问题, 针对bullet的版本laya采用的是2.82还是2.83?有没有需要额外注意的地方

from layaair.

GuoLei1990 avatar GuoLei1990 commented on May 23, 2024

目前bullet版本是2.87版本,我们对bullet源码做了一点修改,应该问题不大,你们可以试试。

from layaair.

grant930 avatar grant930 commented on May 23, 2024

@GuoLei1990
在用修改ammo工程后的idl构建成功并替代laya.physics3D.js , 运行后有报错:
laya.d3.js:31995 Uncaught TypeError: physics3D(...).then is not a function
at Function.init (laya.d3.js:31995)
at new Main (bundle.js:294)

定位到这一行:
physics3D(config.defaultPhysicsMemory * 1024 * 1024).then(function () {

请问是否还需要额外处理? 我们只是想开放几个bullet的接口,简单替换掉laya.physics3D.js 貌似不行

from layaair.

GuoLei1990 avatar GuoLei1990 commented on May 23, 2024

我们已经优化了物理引擎部分 你可以克隆一下最新的代码,你现在的修改可能对引擎来说可能已经过时了

from layaair.

GuoLei1990 avatar GuoLei1990 commented on May 23, 2024

@grant930 编译后需要微调一下
(1)编译后调整构造函数参数为memorySize参数。
(2)第一行function(memorySize)前插入window.Physics3D=
(2)"Physics3D=Physics3D||{}"替换为"Physics3D={}"。
(3)需查找TOTAL_MEMORY关键字替换固定16M内存常量为memorySize参数。
(4)去掉Laya.Physics3D前的this,改外window.Physics3D
(5)去掉_currentScript相关两行代码支持微信小程序
这是我们以前的修改文档

from layaair.

grant930 avatar grant930 commented on May 23, 2024

裁剪后的版本变化很大,想问下目前是否还有计划中的大变动? 假如继续使用2.3.0版本的物理库是否有比较大风险?

from layaair.

GuoLei1990 avatar GuoLei1990 commented on May 23, 2024

暂时不会有大变动,
但必须注意物理库和引擎库的版本必须保持一致

from layaair.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.