/** * Shape Superset - The apiShape properties get moved into the Shape object itself, and then the instance is created * @param physics * @param apiShape GameLib.D3.API.Shape * @constructor */ GameLib.D3.Shape.Plane = function ( physics, apiShape ) { this.physics = physics; this.physics.isNotCannonThrow(); GameLib.D3.Shape.call( this, this.physics, apiShape ); }; GameLib.D3.Shape.Plane.prototype = Object.create(GameLib.D3.Shape.prototype); GameLib.D3.Shape.Plane.prototype.constructor = GameLib.D3.Shape.Plane; /** * * @returns {GameLib.D3.Shape.Plane|*|SEA3D.Plane} */ GameLib.D3.Shape.Plane.prototype.createInstance = function() { /** * A plane is just a plane at z = 0, to rotate it put it inside a rigid body and rotate the body */ this.instance = new CANNON.Plane(); GameLib.D3.Shape.prototype.createInstance.call(this); }; GameLib.D3.Shape.Plane.prototype.updateInstance = function() { }; GameLib.D3.Shape.Plane.FromObject = function(physics, objectShape) { var apiShape = GameLib.D3.API.Shape.FromObject(objectShape); return new GameLib.D3.Shape.Plane( physics, apiShape ); };