This page describes the classes built into Scenic, representing points <Point>, oriented points <OrientedPoint>, and physical objects <Object>, and how they are instantiated to create objects.
Note
The documentation given here describes only the public properties and methods provided by the built-in classes. If you are working on Scenic's internals, you can find more complete documentation in the :mod:`scenic.core.object_types` module.
<class> [<specifier> [, <specifier>]*]
Instantiates a Scenic object from a Scenic class. The properties of the object are determined by the given set of zero or more specifiers. For details on the available specifiers and how they interact, see the :ref:`specifiers`.
Instantiating an instance of Object has a side effect: the object is added to the scenario being defined.
Names of Scenic classes followed immediately by punctuation are not considered instance creations. This allows us to refer to a Scenic class without creating an instance of that class in the environment, which is useful for expressions like :scenic:`isinstance(obj, Car)`, :scenic:`[Taxi, Truck]`, :scenic:`Car.staticMethod`, etc.
Locations in space. This class provides the fundamental property :prop:`position` and several associated properties.
.. autoclass:: scenic.core.object_types.Point :noindex: :no-show-inheritance: :no-members: :members: visibleRegion
A location along with an orientation, defining a local coordinate system. This class subclasses Point, adding the fundamental property :prop:`heading` and several associated properties.
.. autoclass:: scenic.core.object_types.OrientedPoint :noindex: :no-show-inheritance: :no-members: :members: visibleRegion
A physical object. This class subclasses OrientedPoint, adding a variety of properties including:
- :prop:`width` and :prop:`length` to define the bounding box of the object;
- :prop:`allowCollisions`, :prop:`requireVisible`, and :prop:`regionContainedIn` to control the built-in requirements that apply to the object;
- :prop:`behavior`, specifying the object's :term:`dynamic behavior` if any;
- :prop:`speed`, :prop:`velocity`, and other properties capturing the dynamic state of the object during simulations.
The built-in requirements applying to each object are:
- The object must be completely contained within its :term:`container`, the region specified as its :prop:`regionContainedIn` property (by default the entire :term:`workspace`).
- The object must be visible from the ego object, unless its :prop:`requireVisible` property is set to False.
- The object must not intersect another object (i.e., their bounding boxes must not overlap), unless either of the two objects has their :prop:`allowCollisions` property set to True.
.. autoclass:: scenic.core.object_types.Object :noindex: :no-show-inheritance: :no-members: :members: startDynamicSimulation, visibleRegion