EmmaPrats / Easy-Physics

Easy Physics library for easily making physics based animations on the HTML5 Canvas!
1 stars 0 forks source link

RigidBox: pointVolume should be pointVolume2D=π^2 and pointVolume3D=3/4πr^2 #3

Open EmmaPrats opened 5 years ago

EmmaPrats commented 5 years ago

This might cause problems of the letters drowning too fast because the volume will be much smaller than the previous approach of making it a box of: widh = width height = height depth = (widh + height) / 2

EmmaPrats commented 5 years ago

No! Make it boxes!

Since we can assume that the sampling algorithm will find fewer points than the real space that the object occupies, it's a good idea to use boxes instead of spheres, since using spheres will yield even less volume.

We have a bounding box, so: pointVolume2D = gridSize gridSize pointVolume3D = gridSize gridSize * (boxWidth+boxHeight)/2

EmmaPrats commented 5 years ago

Or, if we assume that the user will assume that the letter is like an extruded glyph, not too thin, not too thick... pointVolume3D = gridSize gridSize gridSize