new components

master
Theunis J. Botha 2021-10-02 06:50:42 +02:00
parent 7ee2b9f5ea
commit 2b8c94cb25
17 changed files with 2349 additions and 740 deletions

View File

@ -41,3 +41,9 @@ r3 create RuntimeNodeJSImage runtime_extends RuntimeImage ./r3-runtime/
r3 create Runtime base ./r3-runtime/
r3 create ComponentCode component_extends Component ./r3-component/
r3 create R3Object object_base ./r3-object/
r3 create ComponentMaterial component_extends Component ./r3-component/
r3 create ComponentTexture component_extends Component ./r3-component/
r3 create ComponentMesh component_extends Component ./r3-component/
r3 create ComponentGeometry component_extends Component ./r3-component/
r3 create ComponentBufferGeometry component_extends ComponentGeometry ./r3-component/
r3 create ComponentPlaneGeometry component_extends ComponentBufferGeometry ./r3-component/

1873
dist/r3.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "r3",
"version": "3.0.207",
"version": "3.0.214",
"description": "",
"private": true,
"dependencies": {

View File

@ -21,11 +21,12 @@ R3.Entity = Entity;
R3.Component = Component;
R3.Code = R3Object.Component.Code;
R3.Canvas = R3Object.Component.DOM.Canvas;
R3.PlaneGeometry = R3Object.Component.Geometry.BufferGeometry.PlaneGeometry;
R3.Image = R3Object.Component.Graphics.Image;
R3.Material = R3Object.Component.Graphics.Material;
R3.Mesh = R3Object.Component.Graphics.Mesh;
R3.Texture = R3Object.Component.Graphics.Texture;
R3.Touch = R3Object.Component.Input.Touch;
R3.Material = R3Object.Component.Material;
R3.Mesh = R3Object.Component.Mesh;
R3.Texture = R3Object.Component.Texture;
//GENERATED_DEFINES_END
//CUSTOM_DEFINES_START

View File

@ -3,26 +3,32 @@ const Component = require('./r3-component.js');
const ComponentCode = require('./r3-component-code.js');
const ComponentDOM = require('./r3-component-d-o-m.js');
const ComponentCanvas = require('./r3-component-canvas.js');
const ComponentGeometry = require('./r3-component-geometry.js');
const ComponentBufferGeometry = require('./r3-component-buffer-geometry.js');
const ComponentPlaneGeometry = require('./r3-component-plane-geometry.js');
const ComponentGraphics = require('./r3-component-graphics.js');
const ComponentImage = require('./r3-component-image.js');
const ComponentInput = require('./r3-component-input.js');
const ComponentTouch = require('./r3-component-touch.js');
const ComponentMaterial = require('./r3-component-material.js');
const ComponentMesh = require('./r3-component-mesh.js');
const ComponentTexture = require('./r3-component-texture.js');
const ComponentInput = require('./r3-component-input.js');
const ComponentTouch = require('./r3-component-touch.js');
//GENERATED_IMPORTS_END
//GENERATED_INDEX_BODY_START
Component.Code = ComponentCode;
Component.DOM = ComponentDOM;
Component.DOM.Canvas = ComponentCanvas;
Component.Geometry = ComponentGeometry;
Component.Geometry.BufferGeometry = ComponentBufferGeometry;
Component.Geometry.BufferGeometry.PlaneGeometry = ComponentPlaneGeometry;
Component.Graphics = ComponentGraphics;
Component.Graphics.Image = ComponentImage;
Component.Graphics.Material = ComponentMaterial;
Component.Graphics.Mesh = ComponentMesh;
Component.Graphics.Texture = ComponentTexture;
Component.Input = ComponentInput;
Component.Input.Touch = ComponentTouch;
Component.Material = ComponentMaterial;
Component.Mesh = ComponentMesh;
Component.Texture = ComponentTexture;
//GENERATED_INDEX_BODY_END
//GENERATED_EXPORTS_START

View File

@ -0,0 +1,347 @@
//GENERATED_IMPORTS_START
const Entity = require('../r3-entity/r3-entity.js');
//GENERATED_IMPORTS_END
//CUSTOM_IMPORTS_START
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const ComponentGeometry = require('./r3-component-geometry.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Geometry.BufferGeometry
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGeometry]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentBufferGeometry]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
instance=null - Holds the current instance of this object as determined (built) by the runtime object.
TEMPLATE_OPTIONS_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_REQUIRED_COMPONENTS_START
CUSTOM_REQUIRED_COMPONENTS_END
TEMPLATE_STATIC_OPTIONS_START
TEMPLATE_STATIC_OPTIONS_END
CUSTOM_STATIC_OPTIONS_START
CUSTOM_STATIC_OPTIONS_END
TEMPLATE_INSTANCE_OPTIONS_MAPPING_START
TEMPLATE_INSTANCE_OPTIONS_MAPPING_END
CUSTOM_INSTANCE_OPTIONS_MAPPING_START
CUSTOM_INSTANCE_OPTIONS_MAPPING_END
TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START
instance
TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END
TEMPLATE_METHODS_START
initialize() - Notifies all systems listening that this component initialized.
updateInstance(property) - Updates this object by copying the values of the current object into it's instance object.
updateFromInstance(property) - Updates this object by copying the values of its instance into the current object.
TEMPLATE_METHODS_END
CUSTOM_METHODS_START
CUSTOM_METHODS_END
TEMPLATE_STATIC_METHODS_START
TEMPLATE_STATIC_METHODS_END
CUSTOM_STATIC_METHODS_START
CUSTOM_STATIC_METHODS_END
**/
class ComponentBufferGeometry extends ComponentGeometry {
//GENERATED_CONSTRUCTOR_START
constructor(options) {
if (typeof options === 'undefined') {
options = {};
}
if (typeof options.maxDepth === 'undefined') {
options.maxDepth = 0;
}
if (typeof options.callDepth === 'undefined') {
options.callDepth = 0;
} else {
options.callDepth++;
}
options.maxDepth = options.callDepth;
super(options);
//GENERATED_TEMPLATE_OPTIONS_INIT_START
/**
* instance - Holds the current instance of this object as determined (built) by the runtime object.
*/
if (typeof options.instance === 'undefined') {
options.instance = null;
}
//GENERATED_TEMPLATE_OPTIONS_INIT_END
//GENERATED_OPTIONS_INIT_START
//GENERATED_OPTIONS_INIT_END
//GENERATED_REQUIRED_COMPONENTS_START
//GENERATED_REQUIRED_COMPONENTS_END
//CUSTOM_OPTIONS_INIT_START
//CUSTOM_OPTIONS_INIT_END
//CUSTOM_BEFORE_INIT_START
//CUSTOM_BEFORE_INIT_END
this.underConstruction = true;
Object.assign(this, options);
this.underConstruction = false;
if (options.callDepth === 0) {
this.initialize();
} else {
options.callDepth--;
}
//CUSTOM_AFTER_INIT_START
//CUSTOM_AFTER_INIT_END
}
//GENERATED_CONSTRUCTOR_END
//GENERATED_TEMPLATE_METHODS_START
/**
* initialize()
* - Notifies all systems listening that this component initialized.
*/
initialize() {
//GENERATED_INITIALIZE_METHOD_START
super.initialize();
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
} else {
this.initializeDepth++;
}
//GENERATED_INITIALIZE_METHOD_AFTER_END
}
/**
* updateInstance()
* - Updates this object by copying the values of the current object into it's instance object.
* @param property
*/
updateInstance(property) {
//GENERATED_UPDATE_INSTANCE_METHOD_START
this.emit(Event.UPDATE_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_INSTANCE_OPTIONS_START
//GENERATED_UPDATE_INSTANCE_OPTIONS_END
//GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START
//GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END
this.emit(Event.UPDATE_INSTANCE_AFTER, this);
//GENERATED_UPDATE_INSTANCE_METHOD_END
//CUSTOM_UPDATE_INSTANCE_METHOD_START
//CUSTOM_UPDATE_INSTANCE_METHOD_END
//GENERATED_UPDATE_INSTANCE_METHOD_AFTER_START
//GENERATED_UPDATE_INSTANCE_METHOD_AFTER_END
}
/**
* updateFromInstance()
* - Updates this object by copying the values of its instance into the current object.
* @param property
*/
updateFromInstance(property) {
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_START
this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END
//GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START
//GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END
this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this);
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_END
//CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START
//CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_START
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_END
}
//GENERATED_TEMPLATE_METHODS_END
//GENERATED_METHODS_START
//GENERATED_METHODS_END
//GENERATED_TEMPLATE_STATIC_METHODS_START
//GENERATED_TEMPLATE_STATIC_METHODS_END
//GENERATED_STATIC_METHODS_START
//GENERATED_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
}
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END
//GENERATED_STATIC_OPTIONS_INIT_START
//GENERATED_STATIC_OPTIONS_INIT_END
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = ComponentBufferGeometry;

View File

@ -0,0 +1,328 @@
//GENERATED_IMPORTS_START
const Entity = require('../r3-entity/r3-entity.js');
//GENERATED_IMPORTS_END
//CUSTOM_IMPORTS_START
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Geometry
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentGeometry]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
instance=null - Holds the current instance of this object as determined (built) by the runtime object.
TEMPLATE_OPTIONS_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_REQUIRED_COMPONENTS_START
CUSTOM_REQUIRED_COMPONENTS_END
TEMPLATE_STATIC_OPTIONS_START
TEMPLATE_STATIC_OPTIONS_END
CUSTOM_STATIC_OPTIONS_START
CUSTOM_STATIC_OPTIONS_END
TEMPLATE_INSTANCE_OPTIONS_MAPPING_START
TEMPLATE_INSTANCE_OPTIONS_MAPPING_END
CUSTOM_INSTANCE_OPTIONS_MAPPING_START
CUSTOM_INSTANCE_OPTIONS_MAPPING_END
TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START
instance
TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END
TEMPLATE_METHODS_START
initialize() - Notifies all systems listening that this component initialized.
updateInstance(property) - Updates this object by copying the values of the current object into it's instance object.
updateFromInstance(property) - Updates this object by copying the values of its instance into the current object.
TEMPLATE_METHODS_END
CUSTOM_METHODS_START
CUSTOM_METHODS_END
TEMPLATE_STATIC_METHODS_START
TEMPLATE_STATIC_METHODS_END
CUSTOM_STATIC_METHODS_START
CUSTOM_STATIC_METHODS_END
**/
class ComponentGeometry extends Component {
//GENERATED_CONSTRUCTOR_START
constructor(options) {
if (typeof options === 'undefined') {
options = {};
}
if (typeof options.maxDepth === 'undefined') {
options.maxDepth = 0;
}
if (typeof options.callDepth === 'undefined') {
options.callDepth = 0;
} else {
options.callDepth++;
}
options.maxDepth = options.callDepth;
super(options);
//GENERATED_TEMPLATE_OPTIONS_INIT_START
/**
* instance - Holds the current instance of this object as determined (built) by the runtime object.
*/
if (typeof options.instance === 'undefined') {
options.instance = null;
}
//GENERATED_TEMPLATE_OPTIONS_INIT_END
//GENERATED_OPTIONS_INIT_START
//GENERATED_OPTIONS_INIT_END
//GENERATED_REQUIRED_COMPONENTS_START
//GENERATED_REQUIRED_COMPONENTS_END
//CUSTOM_OPTIONS_INIT_START
//CUSTOM_OPTIONS_INIT_END
//CUSTOM_BEFORE_INIT_START
//CUSTOM_BEFORE_INIT_END
this.underConstruction = true;
Object.assign(this, options);
this.underConstruction = false;
if (options.callDepth === 0) {
this.initialize();
} else {
options.callDepth--;
}
//CUSTOM_AFTER_INIT_START
//CUSTOM_AFTER_INIT_END
}
//GENERATED_CONSTRUCTOR_END
//GENERATED_TEMPLATE_METHODS_START
/**
* initialize()
* - Notifies all systems listening that this component initialized.
*/
initialize() {
//GENERATED_INITIALIZE_METHOD_START
super.initialize();
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
} else {
this.initializeDepth++;
}
//GENERATED_INITIALIZE_METHOD_AFTER_END
}
/**
* updateInstance()
* - Updates this object by copying the values of the current object into it's instance object.
* @param property
*/
updateInstance(property) {
//GENERATED_UPDATE_INSTANCE_METHOD_START
this.emit(Event.UPDATE_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_INSTANCE_OPTIONS_START
//GENERATED_UPDATE_INSTANCE_OPTIONS_END
//GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START
//GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END
this.emit(Event.UPDATE_INSTANCE_AFTER, this);
//GENERATED_UPDATE_INSTANCE_METHOD_END
//CUSTOM_UPDATE_INSTANCE_METHOD_START
//CUSTOM_UPDATE_INSTANCE_METHOD_END
//GENERATED_UPDATE_INSTANCE_METHOD_AFTER_START
//GENERATED_UPDATE_INSTANCE_METHOD_AFTER_END
}
/**
* updateFromInstance()
* - Updates this object by copying the values of its instance into the current object.
* @param property
*/
updateFromInstance(property) {
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_START
this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END
//GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START
//GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END
this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this);
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_END
//CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START
//CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_START
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_END
}
//GENERATED_TEMPLATE_METHODS_END
//GENERATED_METHODS_START
//GENERATED_METHODS_END
//GENERATED_TEMPLATE_STATIC_METHODS_START
//GENERATED_TEMPLATE_STATIC_METHODS_END
//GENERATED_STATIC_METHODS_START
//GENERATED_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
}
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END
//GENERATED_STATIC_OPTIONS_INIT_START
//GENERATED_STATIC_OPTIONS_INIT_END
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = ComponentGeometry;

View File

@ -6,13 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const ComponentGraphics = require('./r3-component-graphics.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Graphics.Material
Class R3.Event.Object.Component.Material
[Inherited from Event]
Inherited Properties:
@ -69,24 +68,6 @@ const ComponentGraphics = require('./r3-component-graphics.js');
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGraphics]
Inherited Properties:
<no inherited properties>
@ -169,7 +150,7 @@ const ComponentGraphics = require('./r3-component-graphics.js');
**/
class ComponentMaterial extends ComponentGraphics {
class ComponentMaterial extends Component {
//GENERATED_CONSTRUCTOR_START
constructor(options) {

View File

@ -6,13 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const ComponentGraphics = require('./r3-component-graphics.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Graphics.Mesh
Class R3.Event.Object.Component.Mesh
[Inherited from Event]
Inherited Properties:
@ -69,24 +68,6 @@ const ComponentGraphics = require('./r3-component-graphics.js');
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGraphics]
Inherited Properties:
<no inherited properties>
@ -169,7 +150,7 @@ const ComponentGraphics = require('./r3-component-graphics.js');
**/
class ComponentMesh extends ComponentGraphics {
class ComponentMesh extends Component {
//GENERATED_CONSTRUCTOR_START
constructor(options) {

View File

@ -0,0 +1,365 @@
//GENERATED_IMPORTS_START
const Entity = require('../r3-entity/r3-entity.js');
//GENERATED_IMPORTS_END
//CUSTOM_IMPORTS_START
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const ComponentBufferGeometry = require('./r3-component-buffer-geometry.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Geometry.BufferGeometry.PlaneGeometry
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGeometry]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentBufferGeometry]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentPlaneGeometry]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
instance=null - Holds the current instance of this object as determined (built) by the runtime object.
TEMPLATE_OPTIONS_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_REQUIRED_COMPONENTS_START
CUSTOM_REQUIRED_COMPONENTS_END
TEMPLATE_STATIC_OPTIONS_START
TEMPLATE_STATIC_OPTIONS_END
CUSTOM_STATIC_OPTIONS_START
CUSTOM_STATIC_OPTIONS_END
TEMPLATE_INSTANCE_OPTIONS_MAPPING_START
TEMPLATE_INSTANCE_OPTIONS_MAPPING_END
CUSTOM_INSTANCE_OPTIONS_MAPPING_START
CUSTOM_INSTANCE_OPTIONS_MAPPING_END
TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START
instance
TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END
TEMPLATE_METHODS_START
initialize() - Notifies all systems listening that this component initialized.
updateInstance(property) - Updates this object by copying the values of the current object into it's instance object.
updateFromInstance(property) - Updates this object by copying the values of its instance into the current object.
TEMPLATE_METHODS_END
CUSTOM_METHODS_START
CUSTOM_METHODS_END
TEMPLATE_STATIC_METHODS_START
TEMPLATE_STATIC_METHODS_END
CUSTOM_STATIC_METHODS_START
CUSTOM_STATIC_METHODS_END
**/
class ComponentPlaneGeometry extends ComponentBufferGeometry {
//GENERATED_CONSTRUCTOR_START
constructor(options) {
if (typeof options === 'undefined') {
options = {};
}
if (typeof options.maxDepth === 'undefined') {
options.maxDepth = 0;
}
if (typeof options.callDepth === 'undefined') {
options.callDepth = 0;
} else {
options.callDepth++;
}
options.maxDepth = options.callDepth;
super(options);
//GENERATED_TEMPLATE_OPTIONS_INIT_START
/**
* instance - Holds the current instance of this object as determined (built) by the runtime object.
*/
if (typeof options.instance === 'undefined') {
options.instance = null;
}
//GENERATED_TEMPLATE_OPTIONS_INIT_END
//GENERATED_OPTIONS_INIT_START
//GENERATED_OPTIONS_INIT_END
//GENERATED_REQUIRED_COMPONENTS_START
//GENERATED_REQUIRED_COMPONENTS_END
//CUSTOM_OPTIONS_INIT_START
//CUSTOM_OPTIONS_INIT_END
//CUSTOM_BEFORE_INIT_START
//CUSTOM_BEFORE_INIT_END
this.underConstruction = true;
Object.assign(this, options);
this.underConstruction = false;
if (options.callDepth === 0) {
this.initialize();
} else {
options.callDepth--;
}
//CUSTOM_AFTER_INIT_START
//CUSTOM_AFTER_INIT_END
}
//GENERATED_CONSTRUCTOR_END
//GENERATED_TEMPLATE_METHODS_START
/**
* initialize()
* - Notifies all systems listening that this component initialized.
*/
initialize() {
//GENERATED_INITIALIZE_METHOD_START
super.initialize();
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
} else {
this.initializeDepth++;
}
//GENERATED_INITIALIZE_METHOD_AFTER_END
}
/**
* updateInstance()
* - Updates this object by copying the values of the current object into it's instance object.
* @param property
*/
updateInstance(property) {
//GENERATED_UPDATE_INSTANCE_METHOD_START
this.emit(Event.UPDATE_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_INSTANCE_OPTIONS_START
//GENERATED_UPDATE_INSTANCE_OPTIONS_END
//GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START
//GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END
this.emit(Event.UPDATE_INSTANCE_AFTER, this);
//GENERATED_UPDATE_INSTANCE_METHOD_END
//CUSTOM_UPDATE_INSTANCE_METHOD_START
//CUSTOM_UPDATE_INSTANCE_METHOD_END
//GENERATED_UPDATE_INSTANCE_METHOD_AFTER_START
//GENERATED_UPDATE_INSTANCE_METHOD_AFTER_END
}
/**
* updateFromInstance()
* - Updates this object by copying the values of its instance into the current object.
* @param property
*/
updateFromInstance(property) {
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_START
this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END
//GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START
//GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END
this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this);
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_END
//CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START
//CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_START
//GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_END
}
//GENERATED_TEMPLATE_METHODS_END
//GENERATED_METHODS_START
//GENERATED_METHODS_END
//GENERATED_TEMPLATE_STATIC_METHODS_START
//GENERATED_TEMPLATE_STATIC_METHODS_END
//GENERATED_STATIC_METHODS_START
//GENERATED_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
}
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END
//GENERATED_STATIC_OPTIONS_INIT_START
//GENERATED_STATIC_OPTIONS_INIT_END
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = ComponentPlaneGeometry;

View File

@ -6,13 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const ComponentGraphics = require('./r3-component-graphics.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Graphics.Texture
Class R3.Event.Object.Component.Texture
[Inherited from Event]
Inherited Properties:
@ -69,24 +68,6 @@ const ComponentGraphics = require('./r3-component-graphics.js');
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGraphics]
Inherited Properties:
<no inherited properties>
@ -169,7 +150,7 @@ const ComponentGraphics = require('./r3-component-graphics.js');
**/
class ComponentTexture extends ComponentGraphics {
class ComponentTexture extends Component {
//GENERATED_CONSTRUCTOR_START
constructor(options) {

View File

@ -329,14 +329,17 @@ class Component extends R3Object {
Component.CODE = 0x0;
Component.DOM = 0x1;
Component.CANVAS = 0x2;
Component.GRAPHICS = 0x3;
Component.IMAGE = 0x4;
Component.MATERIAL = 0x5;
Component.MESH = 0x6;
Component.TEXTURE = 0x7;
Component.GEOMETRY = 0x3;
Component.BUFFER_GEOMETRY = 0x4;
Component.PLANE_GEOMETRY = 0x5;
Component.GRAPHICS = 0x6;
Component.IMAGE = 0x7;
Component.INPUT = 0x8;
Component.TOUCH = 0x9;
Component.MAX_COMPONENT = 0xa;
Component.MATERIAL = 0xa;
Component.MESH = 0xb;
Component.TEXTURE = 0xc;
Component.MAX_COMPONENT = 0xd;
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START

View File

@ -7,13 +7,16 @@ const Component = require('../r3-component/r3-component.js');
const ComponentCode = require('../r3-component/r3-component-code.js');
const ComponentDOM = require('../r3-component/r3-component-d-o-m.js');
const ComponentCanvas = require('../r3-component/r3-component-canvas.js');
const ComponentGeometry = require('../r3-component/r3-component-geometry.js');
const ComponentBufferGeometry = require('../r3-component/r3-component-buffer-geometry.js');
const ComponentPlaneGeometry = require('../r3-component/r3-component-plane-geometry.js');
const ComponentGraphics = require('../r3-component/r3-component-graphics.js');
const ComponentImage = require('../r3-component/r3-component-image.js');
const ComponentInput = require('../r3-component/r3-component-input.js');
const ComponentTouch = require('../r3-component/r3-component-touch.js');
const ComponentMaterial = require('../r3-component/r3-component-material.js');
const ComponentMesh = require('../r3-component/r3-component-mesh.js');
const ComponentTexture = require('../r3-component/r3-component-texture.js');
const ComponentInput = require('../r3-component/r3-component-input.js');
const ComponentTouch = require('../r3-component/r3-component-touch.js');
//GENERATED_IMPORTS_END
//GENERATED_INDEX_BODY_START
@ -24,13 +27,16 @@ R3Object.Component = Component;
R3Object.Component.Code = ComponentCode;
R3Object.Component.DOM = ComponentDOM;
R3Object.Component.DOM.Canvas = ComponentCanvas;
R3Object.Component.Geometry = ComponentGeometry;
R3Object.Component.Geometry.BufferGeometry = ComponentBufferGeometry;
R3Object.Component.Geometry.BufferGeometry.PlaneGeometry = ComponentPlaneGeometry;
R3Object.Component.Graphics = ComponentGraphics;
R3Object.Component.Graphics.Image = ComponentImage;
R3Object.Component.Graphics.Material = ComponentMaterial;
R3Object.Component.Graphics.Mesh = ComponentMesh;
R3Object.Component.Graphics.Texture = ComponentTexture;
R3Object.Component.Input = ComponentInput;
R3Object.Component.Input.Touch = ComponentTouch;
R3Object.Component.Material = ComponentMaterial;
R3Object.Component.Mesh = ComponentMesh;
R3Object.Component.Texture = ComponentTexture;
//GENERATED_INDEX_BODY_END
//GENERATED_EXPORTS_START

View File

@ -360,14 +360,17 @@ R3Object.COMPONENT = 0x3;
R3Object.COMPONENT_CODE = 0x4;
R3Object.COMPONENT_DOM = 0x5;
R3Object.COMPONENT_CANVAS = 0x6;
R3Object.COMPONENT_GRAPHICS = 0x7;
R3Object.COMPONENT_IMAGE = 0x8;
R3Object.COMPONENT_MATERIAL = 0x9;
R3Object.COMPONENT_MESH = 0xa;
R3Object.COMPONENT_TEXTURE = 0xb;
R3Object.COMPONENT_GEOMETRY = 0x7;
R3Object.COMPONENT_BUFFER_GEOMETRY = 0x8;
R3Object.COMPONENT_PLANE_GEOMETRY = 0x9;
R3Object.COMPONENT_GRAPHICS = 0xa;
R3Object.COMPONENT_IMAGE = 0xb;
R3Object.COMPONENT_INPUT = 0xc;
R3Object.COMPONENT_TOUCH = 0xd;
R3Object.MAX_R3OBJECT = 0xe;
R3Object.COMPONENT_MATERIAL = 0xe;
R3Object.COMPONENT_MESH = 0xf;
R3Object.COMPONENT_TEXTURE = 0x10;
R3Object.MAX_R3OBJECT = 0x11;
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START

View File

@ -136,7 +136,6 @@ CUSTOM_STATIC_ON_COMPONENT_INITIALIZED_METHOD
CUSTOM_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD
CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD
CUSTOM_STATIC_ON_ENTITY_INITIALIZED_METHOD
CUSTOM_STATIC_ON_ENTITY_PROPERTY_UPDATED_METHOD
CUSTOM_STATIC_ON_GET_API_URL_METHOD
CUSTOM_STATIC_ON_GET_RUNTIME_METHOD
CUSTOM_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD

View File

@ -5,13 +5,16 @@ const Event = require('../src/r3/r3-event.js');
const ComponentCode = require('../src/r3/r3-component/./r3-component-code.js');
const ComponentDOM = require('../src/r3/r3-component/./r3-component-d-o-m.js');
const ComponentCanvas = require('../src/r3/r3-component/./r3-component-canvas.js');
const ComponentGeometry = require('../src/r3/r3-component/./r3-component-geometry.js');
const ComponentBufferGeometry = require('../src/r3/r3-component/./r3-component-buffer-geometry.js');
const ComponentPlaneGeometry = require('../src/r3/r3-component/./r3-component-plane-geometry.js');
const ComponentGraphics = require('../src/r3/r3-component/./r3-component-graphics.js');
const ComponentImage = require('../src/r3/r3-component/./r3-component-image.js');
const ComponentInput = require('../src/r3/r3-component/./r3-component-input.js');
const ComponentTouch = require('../src/r3/r3-component/./r3-component-touch.js');
const ComponentMaterial = require('../src/r3/r3-component/./r3-component-material.js');
const ComponentMesh = require('../src/r3/r3-component/./r3-component-mesh.js');
const ComponentTexture = require('../src/r3/r3-component/./r3-component-texture.js');
const ComponentInput = require('../src/r3/r3-component/./r3-component-input.js');
const ComponentTouch = require('../src/r3/r3-component/./r3-component-touch.js');
//GENERATED_COMPONENT_IMPORTS_END
//GENERATED_ENTITY_IMPORTS_START
@ -66,13 +69,16 @@ describe('R3 Tests', () => {
const componentCode = new ComponentCode();
const componentDOM = new ComponentDOM();
const componentCanvas = new ComponentCanvas();
const componentGeometry = new ComponentGeometry();
const componentBufferGeometry = new ComponentBufferGeometry();
const componentPlaneGeometry = new ComponentPlaneGeometry();
const componentGraphics = new ComponentGraphics();
const componentImage = new ComponentImage();
const componentInput = new ComponentInput();
const componentTouch = new ComponentTouch();
const componentMaterial = new ComponentMaterial();
const componentMesh = new ComponentMesh();
const componentTexture = new ComponentTexture();
const componentInput = new ComponentInput();
const componentTouch = new ComponentTouch();
//GENERATED_COMPONENT_CREATE_END
}
@ -126,5 +132,18 @@ describe('R3 Tests', () => {
}
);
it (
'Linking system calls createInstance() in the right order',
() => {
const project = new Project();
const canvas = new ComponentCanvas();
const slider = new EntitySlider();
const touch = new ComponentTouch();
const texture = new ComponentTexture();
}
);
});

View File

@ -1 +1 @@
3.0.207
3.0.214