Elements.pyECSS.Component.Camera¶
- class Elements.pyECSS.Component.Camera(projMatrix=None, name=None, type=None, id=None, left=- 100.0, right=100.0, bottom=- 100.0, top=100.0, near=1.0, far=100.0)[source]¶
An example of a concrete Component Camera class
Contains a basic Projection matrices (otrhographic or perspective)
- Parameters
Component ([type]) – [description]
- __init__(projMatrix=None, name=None, type=None, id=None, left=- 100.0, right=100.0, bottom=- 100.0, top=100.0, near=1.0, far=100.0)[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__([projMatrix, name, type, id, left, …])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)Update Camera matrices
Attributes
eventManagerGet the ECSSManager of the component.
idGet the ID of the component.
nameGet the name of the component.
orthoroot2camMatGet Component’s root to camera matrix
parentGet the parent of the component.
projMatGet Component’s camera Projection matrix
root2camGet Component’s root to camera matrix
typeGet the type of the component.
worldManagerGet Component’s ECSSManager