Internal: Component constructor
type of the component. Ex. "TransformComponent"
Owning entity. Entity only passed when wrapping existing entity.
Global coordinates. The global coordinates are absolute and are used to compute the offset from the global origin coordinate stored in the TransformSystem. After computing the offset value, this is combined with the position to form the final translation of the component. Component World coordinate offset = (coordinates - Origin + position). If the Entity is a child entity, the coordinate field is ignored.
Internal flag set if component is a Cogs Core component.
Local position relative to the global coordinates, or the parent coordinate system if the parent field is set. Do Not set or get if transformFlags is non-zero.
Rotation given as a quaternion. Do Not set or get if transformFlags is non-zero.
Scale factor to apply to each of the axes. Do Not set or get if transformFlags is non-zero.
Complete transformation. Only used if field transformFlags is set. Do Not set or get if transformFlags is zero.
Transform flags. Set to 0 if individual scale, rotate, translate fields shall be used. Non-zero if the Field transform shall be used. If the transform field has been used and switching back to value 0 if this field, all the fields: rotation, position and scale must be set.
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
Defines a 4x4 transformation matrix for the entity and a global offset for root entities. The transformation can either be set using position, scaling and orientation or by explicit setting of the 4x4 matrix. Transforms can also be parented by setting the parent field. This makes the transform data of a component instance relative to the parent transform.