20
Show your life with emotion Thomas, VR Engineer (@thomasbalou)

How to handle collisions in Beloola with THREEJS

Embed Size (px)

Citation preview

Page 1: How to handle collisions in Beloola with THREEJS

Show your life with emotion

Thomas, VR Engineer (@thomasbalou)

Page 2: How to handle collisions in Beloola with THREEJS

Handling collisions in WebGL and THREEJS

Page 3: How to handle collisions in Beloola with THREEJS

Beloola in a few words

● 6 years old company● WebVR social platform● User created 3D spaces● Content aggregation

from best of breeds platforms

● Customizable avatars● Social interactions

Page 4: How to handle collisions in Beloola with THREEJS

Beloola historicFrom static world to procedural collision

Page 5: How to handle collisions in Beloola with THREEJS

Beloola before: a static world

● Nice worlds handled by designers but...

● Big 3D mesh● Long download and

parsing time● Static world, not easy to

modify

Page 6: How to handle collisions in Beloola with THREEJS

Using an heightmap for collisions

● Raster image: grid of pixels containing height datas

● Easy to read (.raw file)● Lightweight

● But not fit for dynamic collision2746*4000 pixel -> 36.6*53.04 meters (118*174 feet)

Page 7: How to handle collisions in Beloola with THREEJS

How to retrieve heightmap informations

Page 8: How to handle collisions in Beloola with THREEJS

A clean slate for better worlds

● Moving forward from static worlds to user generated content

● Design of a builder tool● Development of a

system of collision between objects

Page 9: How to handle collisions in Beloola with THREEJS

Raycast and OctreeHow to handle collisions in high filled worlds

Page 10: How to handle collisions in Beloola with THREEJS

How to handle multiple meshs

● Multiple meshs in the same space

● Catch 2D user input in a 3D world

Page 11: How to handle collisions in Beloola with THREEJS

Using the raycast to catch mouse input

Page 12: How to handle collisions in Beloola with THREEJS

The octree algorithm

● External library by Collin Hover (https://github.com/collinhover/threeoctree)

● Subdivise the scene in cubes to simplify proximity calculation

"Octree2" by WhiteTimberwolf

Page 13: How to handle collisions in Beloola with THREEJS

Using the octree in THREEJS

Page 14: How to handle collisions in Beloola with THREEJS

Handling collisions on movement

● Avatar has to check for collision on movement

● Multiple collision directions to look for

● Too much collision detection can be costly

Page 15: How to handle collisions in Beloola with THREEJS

Calculating collisions in realtime

Page 16: How to handle collisions in Beloola with THREEJS

Handling avatar collisions in Beloola

Page 17: How to handle collisions in Beloola with THREEJS

Handling avatar collisions in Beloola

Page 18: How to handle collisions in Beloola with THREEJS

Handling avatar collisions in Beloola

Page 19: How to handle collisions in Beloola with THREEJS

Handling avatar collisions in Beloola

Page 20: How to handle collisions in Beloola with THREEJS

Thank you