topical media & game development

talk show tell print

mobile-query-three-plugins-cannonjs-vendor-cannon.js-src-material-ContactMaterial.js / js



  /*global CANNON:true */
  
  
@class CANNON.ContactMaterial @brief Defines what happens when two materials meet.
parameter: CANNON.Material m1
parameter: CANNON.Material m2
parameter: float friction
parameter: float restitution @todo Contact solving parameters here too?

  
  CANNON.ContactMaterial = function(m1, m2, friction, restitution){
  
  
Contact material index in the world, -1 until added to the world this.id = -1;

  
The two materials participating in the contact this.materials = [m1,m2];

  
Kinetic friction this.friction = friction!=undefined ? Number(friction) : 0.3;

  
Restitution this.restitution = restitution!=undefined ? Number(restitution) : 0.3; };

  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.