r3-legacy/src/game-lib-d3-shape-plane.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-06-24 02:42:28 +02:00
/**
* 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() {
2017-10-23 14:52:35 +02:00
/**
* 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);
2017-06-24 02:42:28 +02:00
};
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
);
2017-06-24 02:42:28 +02:00
};