From 493ec31cb19b4211c703762d14a4e6232c4c2143 Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Sat, 21 Apr 2018 17:45:38 -0500 Subject: Physics Engine (#4) * Add matter-js as a dependency * Add body component * Fix renderable node doc * Add the physics node type * Correct typo in physics enabled node types * Update docs on render system * Add physics system * Update changelog * Add physics engine to main app * Tweak the gravity of the world * Add body to sumo factory * Add angle component * Add angle to entity * Add angle to the nodes * Pass angle between systems * Set default angle to 0 * Split systems and nodes * Fix indentaion in physics world control * Add third sumo entity * Adjust values for constriants and physics * Correct docs in new nodes * Update built-in docs --- lib/nodes/physical_with_attributes.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/nodes/physical_with_attributes.js (limited to 'lib/nodes/physical_with_attributes.js') diff --git a/lib/nodes/physical_with_attributes.js b/lib/nodes/physical_with_attributes.js new file mode 100644 index 0000000..96ba79d --- /dev/null +++ b/lib/nodes/physical_with_attributes.js @@ -0,0 +1,31 @@ +import { Node } from '@serpentity/serpentity'; + +import AngleComponent from '../components/angle'; +import BodyComponent from '../components/body'; +import PositionComponent from '@serpentity/components.position'; + +/** + * Node identifying an entity that can interact with physics and has + * components updated from its values + * + * @extends {external:Serpentity.Node} + * @class PhysicalWithAttributesNode + */ +export default class PhysicalWithAttributesNode extends Node { + +}; + +/** + * Holds the types that are used to identify an entity with a physics + * object and external attributes + * + * @property {object} types + * @name types + * @memberof PhysicalWithAttributesNode + */ +PhysicalWithAttributesNode.types = { + angle: AngleComponent, + position: PositionComponent, + body: BodyComponent +}; + -- cgit