Elements.pyECSS.Component.BasicTransform¶
- class Elements.pyECSS.Component.BasicTransform(name=None, type=None, id=None, trs=None)[source]¶
An example of a concrete Component Transform class
Contains a basic Euclidean Translation, Rotation and Scale Homogeneous matrices all-in-one TRS 4x4 matrix
- Parameters
Component ([type]) – [description]
- __init__(name=None, type=None, id=None, trs=None)[source]¶
Initializes a Component object with optional name, type, and id parameters.
Args: - name (str, optional): The name of the component. Defaults to None. - type (str, optional): The type of the component. Defaults to None. - id (str, optional): The ID of the component. Defaults to None.
If name is None, then the component’s name is set to the name of its class. If type is None, the type is set to the name of the class. If id is None, a unique ID is generated using the uuid.uuid1() method.
The _parent, _children, _worldManager, and _eventManager attributes are set to None by default.
Returns: - None
Methods
__init__([name, type, id, trs])Initializes a Component object with optional name, type, and id parameters.
accept(system[, event])Accepts a class object to operate on the Component, based on the Visitor pattern.
add(object)Add a Component object to the children of this Component.
getChild(index)Get the child Component object at the given index.
getClassName()Get the name of this Component class.
getNumberOfChildren()Get the number of child Component objects for this Component.
init()abstract method to be subclassed for extra initialisation
print()prints out name, type, id, parent of this Component
remove(object)Removes a Component object to the children of this Component.
update(**kwargs)Local 2 world transformation calculation Traverses upwards whole scenegraph and multiply all transformations along this path
Attributes
eventManagerGet the ECSSManager of the component.
idGet the ID of the component.
l2camtranslation, rotation ,scale, projection
l2worldtranslation, rotation ,scale
nameGet the name of the component.
parentGet the parent of the component.
rotationEulerAnglesscaletranslationtrstranslation, rotation ,scale
typeGet the type of the component.
worldManagerGet Component’s ECSSManager