Learn how to do the contact pair test in ammo.js for three.js objects to detect collisions of 2 specific objects.
Timestamps:
00:00 Intro/demo
00:42 Get ammo.js file and tween.js CDN
01:07 Basics of contact pair test in three.js and ammo.js
03:29 Declare variables
04:12 Ammo.js start function
04:32 Initialize physics - collision configuration and gravity
04:45 Initialize graphics - scene setup in three.js
04:57 CreateCube function to create all cube objects: mesh & rigid bodies
06:14 Create ground cube
06:26 Create target cubes
06:45 Event handlers
06:53 Shoot ball when mouse down
08:16 Contact pair result callback function
09:31 Render loop
10:41 Update physics world (update transformation to moving objects)
11:06 Contact pair test #1 - console log results to show what is happening
14:12 Contact pair test #2
14:43 Contact pair test #3
Resources:
Ammo.js @ Github:
github.com/kripken/ammo.js/
Tween.umd.js CDN @ Cloudflare:
cdnjs.com/libraries/tween.js/...
Three.js physics examples:
threejs.org/examples/?q=physics
Game Physics: AmmoJS ref
perso.liris.cnrs.fr/nicolas.p...
Bullet Physics Manual
www.cs.kent.edu/~ruttan/GameEn...
Bullet Files Description
pybullet.org/Bullet/BulletFul...
Intro to JS 3d Physics AmmoJS and ThreeJS
/ intro-to-javascript-3d...
31 июл 2024