微信小游戏开发之五:为three.js添加物理引擎Physijs

一、前言

The primary goal in developing Physijs is to keep it as simple and user-friendly as possible. Physics engines can be daunting and difficult to set up, with so many options and configurations it is easy to feel overwhelmed. Physijs abstracts all of that extra logic out so you can focus on the rest of your project.

简单的来说,physijs这个名字看起来拼写错误的东西,是一套把ammo.js中的底层接口,抽象出来,针对three.js封装好之后,便于使用的物理引擎。

二、必读

本文不开发源码,如有需要可以自行在GitHub搜索相关工程。

 

三、兼容经历

1、物理引擎基于worker来进行模拟,而微信开发工具中worker却有bug,无法创建,在最新版本中以修复。

2、Physijs中包含physi.js、ammo.js、physijs_worker.js,除了ammo这个基础物理库以外,另外两个都有部分源码需要修改,主要是对wx的适配。

3、worker文件需要放在worker目录中,并在

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 42
    评论
评论 42
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值