aframe-physics-system icon indicating copy to clipboard operation
aframe-physics-system copied to clipboard

Add some utility components

Open donmccurdy opened this issue 8 years ago • 2 comments

  • force="1 0 0"
  • proximity-force="maxDistance: 2;" (allow things to hover, or push away from others?)
  • rotation-constraint="y" (limit rotation to y axis)
  • position-constraint="x, z" (limit movement to x and z axes)

donmccurdy avatar Mar 29 '17 04:03 donmccurdy

constant-force="1 0 0"

multiplies a random force of RAND * (1 1 1) * random-force when near object of class foo random-force="force: 0, 5, 0; distance: 3; class: .foo"

same as random-force but only once, useful for explosions and scattering random-impulse="force: 2 10 2, ..."

ray sets direction and distance of raycast, if hit then apply force repel-force="ray: 0 -2 0; force: 0, 3, 0"

Using them with a mixin or a class ( e.g. ".hovering" ) would be interesting.

alfa256 avatar Mar 29 '17 05:03 alfa256

+1 for the position-constraint, or even axis for something like the distance constraint.

sirkitree avatar Dec 15 '17 15:12 sirkitree