基于 Web 的 2D 图形引擎 Matter.js

码农软件 · 软件分类 · 图形/图像处理 · 2019-09-06 20:42:28

软件介绍

Matter.js 是一个基于 Web 的 2D 图形引擎。

特性:

  • 物理属性(质量、面积、密度等)

  • 任何凸多边形的刚体

  • 稳定的叠加和 resting

  • 碰撞 (broad-phase, mid-phase and narrow-phase)

  • Restitution (elastic and inelastic collisions)

  • Conservation of momentum

  • Friction and resistance

  • Constraints

  • Gravity

  • Composite bodies

  • Sleeping and static bodies

  • Events

  • Rounded corners (chamfering)

  • Views (translate, zoom)

  • Collision queries (raycasting, region tests)

  • Time scaling (slow-mo, speed-up)

  • Canvas renderer (supports vectors and textures)

  • WebGL renderer (requires pixi.js)

  • MatterTools for creating, testing and debugging worlds

  • World state serialisation (requires resurrect.js)

  • Cross-browser (Chrome, Firefox, Safari, IE8+)

  • Mobile-compatible (touch, responsive)

  • An original JavaScript physics implementation (not a port)

示例代码:

// Matter.js module aliases
var Engine = Matter.Engine,
    World = Matter.World,
    Bodies = Matter.Bodies;

// create a Matter.js engine
var engine = Engine.create(document.body);

// create two boxes and a ground
var boxA = Bodies.rectangle(400, 200, 80, 80);
var boxB = Bodies.rectangle(450, 50, 80, 80);
var ground = Bodies.rectangle(400, 610, 810, 60, { isStatic: true });

// add all of the bodies to the world
World.add(engine.world, [boxA, boxB, ground]);

// run the engine
Engine.run(engine);

A pyramid of blocks

本文地址:https://codercto.com/soft/d/14031.html

Scrum敏捷软件开发

Scrum敏捷软件开发

Mike Cohn / 廖靖斌、吕梁岳、陈争云、阳陆育 / 清华大学出版社 / 2010-11 / 69.00元

《Scrum敏捷软件开发》是敏捷联盟及Scrum联盟创始人之一、敏捷估算及计划的鼻祖Mike Cohn三大经典著作中影响最为深厚的扛鼎之作,也是全球敏捷社区中获得广泛肯定的企业敏捷转型权威参考。作者花四年时间,把自己近十五年的敏捷实践经验,特别是近四年中针对各种敏捷转型企业的咨询和指导工作,并结合旁征博引的方式,从更高的思想层次对敏捷与Scrum多年来的经验和教训进行深入而前面的梳理和总结,最终集......一起来看看 《Scrum敏捷软件开发》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具