Component constructor
Type-name of the component, e.g. name of sub-class implementing the component. "MyComponent", etc.
Internal flag set if component is a Cogs Core component.
Gets the optional owning entity
Component name == type. For compatibility
Gets the type of the component. Ex. "TransformComponent", "SceneComponent" etc.
Static
createInternal: Creates a new component of the given type (name). Component is wrapped when adding to an entity.
Type of the component. Ex. "TransformComponent"
Created Cogs.js component.
Static
wrap
Base class for components implementing dynamic behavior.
Consider using Cogs Control Event "preRender" instead. Any updates to Cogs called from custom Dynamic Component will cause a second rendering. If called from Event "preRender" callback the update is in place Before the frame is rendered.
Inherit this class to create JavaScript custom components that are added to a Cogs Entity. The dynamic component acts as a non-virtual base for components not designed to be managed by a component system, but implementing behavior in member functions callable by the DynamicComponentSystem that owns all dynamic component instances. Member names assumed to handle Cogs messages: "initialize", "update", "postUpdate", "cleanup", "gpuPicking(number,vec3)".
See documentation for Dynamic components methods details.
Example