Karana.Scene
============

.. py:module:: Karana.Scene

.. autoapi-nested-parse::

   Classes and modules related to Scenes.



Submodules
----------

.. toctree::
   :maxdepth: 1

   /generated/python_api/Karana/Scene/CoalScene_types/index
   /generated/python_api/Karana/Scene/ProxyScene_types/index
   /generated/python_api/Karana/Scene/Scene_types/index


Attributes
----------

.. autoapisummary::

   Karana.Scene.LAYER_ALL
   Karana.Scene.LAYER_COLLISION
   Karana.Scene.LAYER_CUSTOM0
   Karana.Scene.LAYER_CUSTOM1
   Karana.Scene.LAYER_CUSTOM10
   Karana.Scene.LAYER_CUSTOM11
   Karana.Scene.LAYER_CUSTOM12
   Karana.Scene.LAYER_CUSTOM13
   Karana.Scene.LAYER_CUSTOM14
   Karana.Scene.LAYER_CUSTOM15
   Karana.Scene.LAYER_CUSTOM16
   Karana.Scene.LAYER_CUSTOM17
   Karana.Scene.LAYER_CUSTOM18
   Karana.Scene.LAYER_CUSTOM19
   Karana.Scene.LAYER_CUSTOM2
   Karana.Scene.LAYER_CUSTOM20
   Karana.Scene.LAYER_CUSTOM21
   Karana.Scene.LAYER_CUSTOM22
   Karana.Scene.LAYER_CUSTOM23
   Karana.Scene.LAYER_CUSTOM3
   Karana.Scene.LAYER_CUSTOM4
   Karana.Scene.LAYER_CUSTOM5
   Karana.Scene.LAYER_CUSTOM6
   Karana.Scene.LAYER_CUSTOM7
   Karana.Scene.LAYER_CUSTOM8
   Karana.Scene.LAYER_CUSTOM9
   Karana.Scene.LAYER_FLUIDS
   Karana.Scene.LAYER_GRAPHICS
   Karana.Scene.LAYER_NONE
   Karana.Scene.LAYER_ORNAMENTAL
   Karana.Scene.LAYER_PHYSICAL
   Karana.Scene.LAYER_PHYSICAL_GRAPHICS
   Karana.Scene.LAYER_RESERVED0
   Karana.Scene.LAYER_RESERVED1
   Karana.Scene.LAYER_RESERVED2
   Karana.Scene.LAYER_RESERVED3
   Karana.Scene.LAYER_RESERVED4
   Karana.Scene.LAYER_RESERVED5
   Karana.Scene.LAYER_RESERVED6
   Karana.Scene.LAYER_RESERVED7
   Karana.Scene.LAYER_STICK_FIGURE


Classes
-------

.. autoapisummary::

   Karana.Scene.AbstractStaticGeometry
   Karana.Scene.Alignment
   Karana.Scene.AssimpImporter
   Karana.Scene.BoxGeometry
   Karana.Scene.CapsuleGeometry
   Karana.Scene.CollisionInfo
   Karana.Scene.CollisionScene
   Karana.Scene.CollisionSceneNode
   Karana.Scene.CollisionScenePart
   Karana.Scene.Color
   Karana.Scene.ConeGeometry
   Karana.Scene.Contact
   Karana.Scene.CylinderGeometry
   Karana.Scene.DistanceInfo
   Karana.Scene.GraphicalScene
   Karana.Scene.GraphicalSceneCamera
   Karana.Scene.GraphicalSceneNode
   Karana.Scene.GraphicalScenePart
   Karana.Scene.GrayscaleTexture
   Karana.Scene.HeightFieldGeometry
   Karana.Scene.ImportResult
   Karana.Scene.OrthographicProjection
   Karana.Scene.PerspectiveProjection
   Karana.Scene.PhongMaterial
   Karana.Scene.PhongMaterialInfo
   Karana.Scene.PhysicalMaterial
   Karana.Scene.PhysicalMaterialInfo
   Karana.Scene.RoundFrustumGeometry
   Karana.Scene.Scene
   Karana.Scene.SceneNode
   Karana.Scene.SceneNodeVars
   Karana.Scene.ScenePart
   Karana.Scene.ScenePartSpec
   Karana.Scene.ScenePartSpecVars
   Karana.Scene.ScenePartVars
   Karana.Scene.SceneVars
   Karana.Scene.SphereGeometry
   Karana.Scene.StaticMeshGeometry
   Karana.Scene.TextParameters
   Karana.Scene.Texture
   Karana.Scene.TransformUpdateScope
   Karana.Scene.ProxyScene
   Karana.Scene.ProxySceneNode
   Karana.Scene.ProxyScenePart
   Karana.Scene.ProxyScenePartVars
   Karana.Scene.ProxySceneVars
   Karana.Scene.WebScene
   Karana.Scene.WebSceneNode
   Karana.Scene.WebScenePart
   Karana.Scene.CoalScene
   Karana.Scene.CoalSceneNode
   Karana.Scene.CoalScenePart


Functions
---------

.. autoapisummary::

   Karana.Scene.getConvexDecomposition
   Karana.Scene.colorConvexDecomposition
   Karana.Scene.defaultGeometry
   Karana.Scene.defaultMaterial


Package Contents
----------------

.. py:function:: getConvexDecomposition(geom: StaticMeshGeometry, coacd_args: dict = {}, verbose: bool = False, dupe_vertices: bool = True) -> list[StaticMeshGeometry]

   Decompose a triangle mesh into a union of convex hulls using the COACD library.

   :param geom: Original mesh to decompose.
   :type geom: StaticMeshGeometry

   :returns: List of StaticMeshGeometry objects corresponding to each subhull.
   :rtype: list[StaticMeshGeometry]


.. py:function:: colorConvexDecomposition(geoms: list[StaticMeshGeometry], eps: float = 0.001) -> list[tuple[float, float, float]]

   Get a graph coloring for subhulls resulting from a convex decomposition.

   :param geoms: Subhulls which comprise the convex decomposition.
   :type geoms: list[StaticMeshGeometry]
   :param eps: Tolerance under which to consider adjacent vertices "touching".
   :type eps: float

   :returns: List of RGB tuples corresponding to colors for each hull
   :rtype: list[tuple[float, float, float]]


.. py:class:: AbstractStaticGeometry

   Bases: :py:obj:`Karana.Core.Base`


   Interface for static geometry types

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: aabb() -> Karana.Math.AABB

      Compute the axis-aligned bounding box (AABB)
      :returns: The AABB



   .. py:method:: getConvexity() -> bool

      Get whether the object is convex or not; used for some client scenes.

      :returns: Whether the item is convex. For some geometries this can be
                manually-marked.



.. py:class:: Alignment(*args, **kwds)

   Bases: :py:obj:`enum.Enum`


   Text alignment/justification type


   .. py:attribute:: CENTER
      :type:  ClassVar[Alignment]


   .. py:attribute:: LEFT
      :type:  ClassVar[Alignment]


   .. py:attribute:: RIGHT
      :type:  ClassVar[Alignment]


.. py:class:: AssimpImporter

   AbstractImport implementation using the third-party ASSIMP library

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: importFrom(filename: os.PathLike | str | bytes) -> ImportResult


.. py:class:: BoxGeometry(width: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex, depth: SupportsFloat | SupportsIndex)

   Bases: :py:obj:`AbstractStaticGeometry`


   Concrete box geometry class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(width: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex, depth: SupportsFloat | SupportsIndex) -> BoxGeometry
      :staticmethod:


      Create a new instance of BoxGeometry from side-lengths.

      :param width: side length in the x direction
      :param height: side length in the y direction
      :param depth: side length in the z direction

      :returns: A pointer to the newly created instance of BoxGeometry.



   .. py:method:: __getstate__() -> Annotated[numpy.typing.NDArray[numpy.float32], [3, 1]]


   .. py:method:: __setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [3, 1]]) -> None


   .. py:method:: computeMesh() -> StaticMeshGeometry


   .. py:property:: depth
      :type: float


      side length in the z direction


   .. py:property:: height
      :type: float


      side length in the y direction


   .. py:property:: width
      :type: float


      side length in the x direction


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent BoxGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a BoxGeometry from yaml file data.



   .. py:method:: to_json(o: BoxGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent BoxGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a BoxGeometry from json file data.



.. py:class:: CapsuleGeometry(radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex)

   Bases: :py:obj:`AbstractStaticGeometry`


   Geometry class for a cylinder capped with hemispheres

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex) -> CapsuleGeometry
      :staticmethod:


      Create a new instance of CapsuleGeometry from radius and height.

      :param radius: radius of the capsule
      :param height: height of the capsule's middle section

      :returns: A pointer to the newly created instance of BoxGeometry.



   .. py:method:: __getstate__() -> Annotated[numpy.typing.NDArray[numpy.float32], [2, 1]]


   .. py:method:: __setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [2, 1]]) -> None


   .. py:property:: height
      :type: float


      height of the capsule's middle section


   .. py:property:: radius
      :type: float


      radius of the capsule


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent CapsuleGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a CapsuleGeometry from yaml file data.



   .. py:method:: to_json(o: CapsuleGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent CapsuleGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a CapsuleGeometry from json file data.



.. py:class:: CollisionInfo

   .. py:method:: singleton() -> CollisionInfo
      :staticmethod:



   .. py:method:: __bool__() -> bool


   .. py:method:: hasContact() -> bool


   .. py:property:: contacts
      :type: list[Contact]



   .. py:property:: part1
      :type: int



   .. py:property:: part2
      :type: int



.. py:class:: CollisionScene

   Bases: :py:obj:`Scene`


   Scene with added collision-specific interface

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: broadphase(callback: collections.abc.Callable[[CollisionScenePart, CollisionScenePart], None]) -> None

      Do a coarse sweep over the scene check for potential
             collisions.
      :param callback:
                       - Function called for each potential collision



   .. py:method:: cachedCollisions() -> list[CollisionInfo]

      Get a list of collisions from the last sweep
      :returns: The cached collisions



   .. py:method:: lookupPart(id: SupportsInt | SupportsIndex) -> CollisionScenePart

      Fetch a part by its id
      :returns: The part



   .. py:method:: sweep(callback: collections.abc.Callable[[CollisionInfo], None], filter: collections.abc.Callable[[CollisionScenePart, CollisionScenePart], bool] = None) -> None

      Do a sweep over the scene checking for collisions
      :param callback:
                       - Function called for each collision
      :param filter:
                     - Filter function called for each potential collision pair



   .. py:method:: toDS() -> Karana.Scene.Scene_types.CollisionSceneDS

      Create a CollisionSceneDS from this CollisionScene model.

      :returns: * *CollisionSceneDS*
                * *A CollisionSceneDS instance with values set to match this model.*



.. py:class:: CollisionSceneNode

   Bases: :py:obj:`SceneNode`


.. py:class:: CollisionScenePart

   Bases: :py:obj:`ScenePart`, :py:obj:`CollisionSceneNode`


   .. py:method:: collide(other: CollisionScenePart) -> CollisionInfo
                  collide(other: CollisionScenePart, result: CollisionInfo) -> CollisionInfo


   .. py:method:: distance(other: CollisionScenePart) -> DistanceInfo
                  distance(other: CollisionScenePart, result: DistanceInfo) -> DistanceInfo


.. py:class:: Color(other: Color)

   Color class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:attribute:: ALICEBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: ANTIQUEWHITE
      :type:  ClassVar[Color]


   .. py:attribute:: AQUA
      :type:  ClassVar[Color]


   .. py:attribute:: AQUAMARINE
      :type:  ClassVar[Color]


   .. py:attribute:: AZURE
      :type:  ClassVar[Color]


   .. py:attribute:: BEIGE
      :type:  ClassVar[Color]


   .. py:attribute:: BISQUE
      :type:  ClassVar[Color]


   .. py:attribute:: BLACK
      :type:  ClassVar[Color]


   .. py:attribute:: BLANCHEDALMOND
      :type:  ClassVar[Color]


   .. py:attribute:: BLUE
      :type:  ClassVar[Color]


   .. py:attribute:: BLUEVIOLET
      :type:  ClassVar[Color]


   .. py:attribute:: BROWN
      :type:  ClassVar[Color]


   .. py:attribute:: BURLYWOOD
      :type:  ClassVar[Color]


   .. py:attribute:: CADETBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: CHARTREUSE
      :type:  ClassVar[Color]


   .. py:attribute:: CHOCOLATE
      :type:  ClassVar[Color]


   .. py:attribute:: CORAL
      :type:  ClassVar[Color]


   .. py:attribute:: CORNFLOWERBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: CORNSILK
      :type:  ClassVar[Color]


   .. py:attribute:: CRIMSON
      :type:  ClassVar[Color]


   .. py:attribute:: CYAN
      :type:  ClassVar[Color]


   .. py:attribute:: DARKBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: DARKCYAN
      :type:  ClassVar[Color]


   .. py:attribute:: DARKGOLDENROD
      :type:  ClassVar[Color]


   .. py:attribute:: DARKGRAY
      :type:  ClassVar[Color]


   .. py:attribute:: DARKGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: DARKGREY
      :type:  ClassVar[Color]


   .. py:attribute:: DARKKHAKI
      :type:  ClassVar[Color]


   .. py:attribute:: DARKMAGENTA
      :type:  ClassVar[Color]


   .. py:attribute:: DARKOLIVEGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: DARKORANGE
      :type:  ClassVar[Color]


   .. py:attribute:: DARKORCHID
      :type:  ClassVar[Color]


   .. py:attribute:: DARKRED
      :type:  ClassVar[Color]


   .. py:attribute:: DARKSALMON
      :type:  ClassVar[Color]


   .. py:attribute:: DARKSEAGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: DARKSLATEBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: DARKSLATEGRAY
      :type:  ClassVar[Color]


   .. py:attribute:: DARKSLATEGREY
      :type:  ClassVar[Color]


   .. py:attribute:: DARKTURQUOISE
      :type:  ClassVar[Color]


   .. py:attribute:: DARKVIOLET
      :type:  ClassVar[Color]


   .. py:attribute:: DEEPPINK
      :type:  ClassVar[Color]


   .. py:attribute:: DEEPSKYBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: DIMGRAY
      :type:  ClassVar[Color]


   .. py:attribute:: DIMGREY
      :type:  ClassVar[Color]


   .. py:attribute:: DODGERBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: FIREBRICK
      :type:  ClassVar[Color]


   .. py:attribute:: FLORALWHITE
      :type:  ClassVar[Color]


   .. py:attribute:: FORESTGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: FUCHSIA
      :type:  ClassVar[Color]


   .. py:attribute:: GAINSBORO
      :type:  ClassVar[Color]


   .. py:attribute:: GHOSTWHITE
      :type:  ClassVar[Color]


   .. py:attribute:: GOLD
      :type:  ClassVar[Color]


   .. py:attribute:: GOLDENROD
      :type:  ClassVar[Color]


   .. py:attribute:: GRAY
      :type:  ClassVar[Color]


   .. py:attribute:: GREEN
      :type:  ClassVar[Color]


   .. py:attribute:: GREENYELLOW
      :type:  ClassVar[Color]


   .. py:attribute:: GREY
      :type:  ClassVar[Color]


   .. py:attribute:: HONEYDEW
      :type:  ClassVar[Color]


   .. py:attribute:: HOTPINK
      :type:  ClassVar[Color]


   .. py:attribute:: INDIANRED
      :type:  ClassVar[Color]


   .. py:attribute:: INDIGO
      :type:  ClassVar[Color]


   .. py:attribute:: IVORY
      :type:  ClassVar[Color]


   .. py:attribute:: KHAKI
      :type:  ClassVar[Color]


   .. py:attribute:: LAVENDER
      :type:  ClassVar[Color]


   .. py:attribute:: LAVENDERBLUSH
      :type:  ClassVar[Color]


   .. py:attribute:: LAWNGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: LEMONCHIFFON
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTCORAL
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTCYAN
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTGOLDENRODYELLOW
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTGRAY
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTGREY
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTPINK
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTSALMON
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTSEAGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTSKYBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTSLATEGRAY
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTSLATEGREY
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTSTEELBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: LIGHTYELLOW
      :type:  ClassVar[Color]


   .. py:attribute:: LIME
      :type:  ClassVar[Color]


   .. py:attribute:: LIMEGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: LINEN
      :type:  ClassVar[Color]


   .. py:attribute:: MAGENTA
      :type:  ClassVar[Color]


   .. py:attribute:: MAROON
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMAQUAMARINE
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMORCHID
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMPURPLE
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMSEAGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMSLATEBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMSPRINGGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMTURQUOISE
      :type:  ClassVar[Color]


   .. py:attribute:: MEDIUMVIOLETRED
      :type:  ClassVar[Color]


   .. py:attribute:: MIDNIGHTBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: MINTCREAM
      :type:  ClassVar[Color]


   .. py:attribute:: MISTYROSE
      :type:  ClassVar[Color]


   .. py:attribute:: MOCCASIN
      :type:  ClassVar[Color]


   .. py:attribute:: NAVAJOWHITE
      :type:  ClassVar[Color]


   .. py:attribute:: NAVY
      :type:  ClassVar[Color]


   .. py:attribute:: OLDLACE
      :type:  ClassVar[Color]


   .. py:attribute:: OLIVE
      :type:  ClassVar[Color]


   .. py:attribute:: OLIVEDRAB
      :type:  ClassVar[Color]


   .. py:attribute:: ORANGE
      :type:  ClassVar[Color]


   .. py:attribute:: ORANGERED
      :type:  ClassVar[Color]


   .. py:attribute:: ORCHID
      :type:  ClassVar[Color]


   .. py:attribute:: PALEGOLDENROD
      :type:  ClassVar[Color]


   .. py:attribute:: PALEGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: PALETURQUOISE
      :type:  ClassVar[Color]


   .. py:attribute:: PALEVIOLETRED
      :type:  ClassVar[Color]


   .. py:attribute:: PAPAYAWHIP
      :type:  ClassVar[Color]


   .. py:attribute:: PEACHPUFF
      :type:  ClassVar[Color]


   .. py:attribute:: PERU
      :type:  ClassVar[Color]


   .. py:attribute:: PINK
      :type:  ClassVar[Color]


   .. py:attribute:: PLUM
      :type:  ClassVar[Color]


   .. py:attribute:: POWDERBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: PURPLE
      :type:  ClassVar[Color]


   .. py:attribute:: REBECCAPURPLE
      :type:  ClassVar[Color]


   .. py:attribute:: RED
      :type:  ClassVar[Color]


   .. py:attribute:: ROSYBROWN
      :type:  ClassVar[Color]


   .. py:attribute:: ROYALBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: SADDLEBROWN
      :type:  ClassVar[Color]


   .. py:attribute:: SALMON
      :type:  ClassVar[Color]


   .. py:attribute:: SANDYBROWN
      :type:  ClassVar[Color]


   .. py:attribute:: SEAGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: SEASHELL
      :type:  ClassVar[Color]


   .. py:attribute:: SIENNA
      :type:  ClassVar[Color]


   .. py:attribute:: SILVER
      :type:  ClassVar[Color]


   .. py:attribute:: SKYBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: SLATEBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: SLATEGRAY
      :type:  ClassVar[Color]


   .. py:attribute:: SLATEGREY
      :type:  ClassVar[Color]


   .. py:attribute:: SNOW
      :type:  ClassVar[Color]


   .. py:attribute:: SPRINGGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: STEELBLUE
      :type:  ClassVar[Color]


   .. py:attribute:: TAN
      :type:  ClassVar[Color]


   .. py:attribute:: TEAL
      :type:  ClassVar[Color]


   .. py:attribute:: THISTLE
      :type:  ClassVar[Color]


   .. py:attribute:: TOMATO
      :type:  ClassVar[Color]


   .. py:attribute:: TURQUOISE
      :type:  ClassVar[Color]


   .. py:attribute:: VIOLET
      :type:  ClassVar[Color]


   .. py:attribute:: WHEAT
      :type:  ClassVar[Color]


   .. py:attribute:: WHITE
      :type:  ClassVar[Color]


   .. py:attribute:: WHITESMOKE
      :type:  ClassVar[Color]


   .. py:attribute:: YELLOW
      :type:  ClassVar[Color]


   .. py:attribute:: YELLOWGREEN
      :type:  ClassVar[Color]


   .. py:attribute:: __hash__
      :type:  ClassVar[None]
      :value: None



   .. py:method:: fromHex(hex_str: str, alpha: SupportsFloat | SupportsIndex = 1.0) -> Color
      :staticmethod:


      Create a color from a hex string and opacity

      The hex_str input is parsed to extract red, green, and blue
      components. For example, "ff0000" and "f00" are pure red.

      :param hex_str: a 3 or 6 length hex string
      :param alpha: the opacity factor between 0 and 1

      :returns: the created Color



   .. py:method:: fromRGB(r: SupportsFloat | SupportsIndex, g: SupportsFloat | SupportsIndex, b: SupportsFloat | SupportsIndex) -> Color
      :staticmethod:


      Create an opaque color from rgb components

      :param r: the red component between 0 and 1
      :param g: the green component between 0 and 1
      :param b: the blue component between 0 and 1

      :returns: the created Color



   .. py:method:: fromRGBA(r: SupportsFloat | SupportsIndex, g: SupportsFloat | SupportsIndex, b: SupportsFloat | SupportsIndex, alpha: SupportsFloat | SupportsIndex) -> Color
      :staticmethod:


      Create a color from rgb components and opacity

      :param r: the red component between 0 and 1
      :param g: the green component between 0 and 1
      :param b: the blue component between 0 and 1
      :param alpha: the opacity factor between 0 and 1

      :returns: the created Color



   .. py:method:: __eq__(other: Color) -> bool

      Equality operator.

      :param other: Another Color to compare with.

      :returns: True if all components are equal.



   .. py:method:: __getstate__() -> Annotated[numpy.typing.NDArray[numpy.float32], [4, 1]]


   .. py:method:: __repr__() -> str


   .. py:method:: __setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [4, 1]]) -> None


   .. py:method:: alpha() -> float

      Get the alpha (opacity) value
      :returns: The alpha value



   .. py:method:: b() -> float

      Get the blue component
      :returns: The blue component



   .. py:method:: g() -> float

      Get the green component
      :returns: The green component



   .. py:method:: r() -> float

      Get the red component
      :returns: The red component



   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent Color in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a Color from yaml file data.



   .. py:method:: to_json(o: Color) -> dict[str, Any]
      :staticmethod:


      Class method used to represent Color in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a Color from json file data.



.. py:class:: ConeGeometry(radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex)

   Bases: :py:obj:`AbstractStaticGeometry`


   Concrete cone geometry class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex) -> ConeGeometry
      :staticmethod:


      Create a new instance of ConeGeometry from radius and height.

      :param radius: radius of the capsule
      :param height: height of the capsule's middle section

      :returns: A pointer to the newly created instance of BoxGeometry.



   .. py:method:: __getstate__() -> Annotated[numpy.typing.NDArray[numpy.float32], [2, 1]]


   .. py:method:: __setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [2, 1]]) -> None


   .. py:property:: height
      :type: float


      height of the cone


   .. py:property:: radius
      :type: float


      radius of the cone


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent ConeGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a ConeGeometry from yaml file data.



   .. py:method:: to_json(o: ConeGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent ConeGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a ConeGeometry from json file data.



.. py:class:: Contact

   .. py:property:: normal
      :type: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]



   .. py:property:: penetration
      :type: Karana.Math.Ktyping.Length



   .. py:property:: witness1
      :type: Karana.Math.Ktyping.Length3



   .. py:property:: witness2
      :type: Karana.Math.Ktyping.Length3



.. py:class:: CylinderGeometry(radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex)

   Bases: :py:obj:`AbstractStaticGeometry`


   Concrete cylinder geometry class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex) -> CylinderGeometry
      :staticmethod:


      Create a new instance of CylinderGeometry from radius and height.

      :param radius: radius of the capsule
      :param height: height of the capsule's middle section

      :returns: A pointer to the newly created instance of BoxGeometry.



   .. py:method:: __getstate__() -> Annotated[numpy.typing.NDArray[numpy.float32], [2, 1]]


   .. py:method:: __setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [2, 1]]) -> None


   .. py:property:: height
      :type: float


      height of the cylinder


   .. py:property:: radius
      :type: float


      radius of the cylinder


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent CylinderGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a CylinderGeometry from yaml file data.



   .. py:method:: to_json(o: CylinderGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent CylinderGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a CylinderGeometry from json file data.



.. py:class:: DistanceInfo

   .. py:method:: singleton() -> DistanceInfo
      :staticmethod:



   .. py:property:: distance
      :type: float



   .. py:property:: nearest1
      :type: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]



   .. py:property:: nearest2
      :type: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]



.. py:class:: GraphicalScene

   Bases: :py:obj:`Scene`


   Scene with an added graphics-specific interface

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: addOverlayText(arg0: str, arg1: SupportsFloat | SupportsIndex, arg2: SupportsFloat | SupportsIndex, arg3: TextParameters) -> int
                  addOverlayText(message: str, x: SupportsFloat | SupportsIndex, y: SupportsFloat | SupportsIndex, align: Alignment = Alignment.LEFT, size: SupportsFloat | SupportsIndex = 0.05000000074505806, color: Color = ...) -> int

      Add text in screen space
      :param message:
                      - The content of the overlay text
      :param x:
                - The horizontal position of the text between 0 and 1
      :param y:
                - The vertical position of the text between 0 and 1
      :param parameters:
                         - Addition text parameters

      :returns: Unique id to later update the text instance



   .. py:method:: defaultCamera() -> GraphicalSceneCamera

      Get the automatically created default camera
      :returns: The default camera



   .. py:method:: removeOverlayText(arg0: SupportsInt | SupportsIndex) -> None

      Add text in screen space
      :param message:
                      - The content of the overlay text
      :param x:
                - The horizontal position of the text between 0 and 1
      :param y:
                - The vertical position of the text between 0 and 1
      :param parameters:
                         - Addition text parameters

      :returns: Unique id to later update the text instance



   .. py:method:: renderToFile(arg0: os.PathLike | str | bytes) -> None

      Render the scene to a file
      :param filepath:
                       - filename to render to



   .. py:method:: setOverlayText(arg0: SupportsInt | SupportsIndex, arg1: str) -> None

      Add text in screen space
      :param message:
                      - The content of the overlay text
      :param x:
                - The horizontal position of the text between 0 and 1
      :param y:
                - The vertical position of the text between 0 and 1
      :param parameters:
                         - Addition text parameters

      :returns: Unique id to later update the text instance



.. py:class:: GraphicalSceneCamera

   Bases: :py:obj:`GraphicalSceneNode`


   .. py:method:: getMask() -> int

      Get the bitmask for which layers should be visible.
      :returns: The layers bitmask



   .. py:method:: getProjection() -> PerspectiveProjection | OrthographicProjection

      Get the camera projection parameters
      :returns: The camera projection parameters



   .. py:method:: pointCameraAt(offset: numpy.typing.ArrayLike | Karana.Math.Ktyping.Length3, target: numpy.typing.ArrayLike | Karana.Math.Ktyping.Length3, up: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) -> None

      Set the pose of the camera.
      :param offset: The position of the camera.
      :param target: The position the camera will point at.
      :param up: The up vector of the camera.



   .. py:method:: setMask(mask: SupportsInt | SupportsIndex) -> None

      Set the bitmask for which layers should be visible.
      :param mask:
                   - The layers bitmask



   .. py:method:: setProjection(projection: PerspectiveProjection | OrthographicProjection) -> None

      Set the camera projection parameters
      :param proj: The camera projection parameters



.. py:class:: GraphicalSceneNode

   Bases: :py:obj:`SceneNode`


   .. py:method:: removeTrail() -> None

      Remove a trail previously created by calling trail



   .. py:method:: showAxes(size: SupportsFloat | SupportsIndex = 1.0) -> None

      Show axes to visualize the node's position and orientation
      :param size:
                   - Lengths of the axes (zero to remove the axes)



   .. py:method:: trail(reference: GraphicalSceneNode = None, color: Color = ...) -> None

      Display a trail tracking the node's motion over time.
      :param relative_to:
                          - Another node to draw the trail relative to.
      :param color:
                    - The color of the Trail.



.. py:class:: GraphicalScenePart

   Bases: :py:obj:`ScenePart`, :py:obj:`GraphicalSceneNode`


.. py:class:: GrayscaleTexture

   Bases: :py:obj:`Texture`


   Texture specialization for grayscale values

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: lookupOrCreateTexture(filename: os.PathLike | str | bytes) -> GrayscaleTexture
      :staticmethod:


      Create a texture from a file name. This caches the texture
             so that future versions created with the same file name just
             return a pointer to the same texture.
      :param filename: The name of the file.

      :returns: A ks_ptr to the GrayscaleTexture.



   .. py:method:: __getstate__() -> tuple[str, numpy.ndarray]


   .. py:method:: __setstate__(arg0: tuple) -> None


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent GrayscaleTexture in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a GrayscaleTexture from yaml file data.



   .. py:method:: to_json(o: GrayscaleTexture) -> dict[str, Any]
      :staticmethod:


      Class method used to represent GrayscaleTexture in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a GrayscaleTexture from json file data.



.. py:class:: HeightFieldGeometry(size_x: SupportsFloat | SupportsIndex, size_y: SupportsFloat | SupportsIndex, heights: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, n]])

   Bases: :py:obj:`AbstractStaticGeometry`


   Geometry class for a 2D heightfield with a given x, y extent and z
   values on a grid.

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(size_x: SupportsFloat | SupportsIndex, size_y: SupportsFloat | SupportsIndex, heights: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, n]]) -> HeightFieldGeometry
      :staticmethod:


      Create a new instance of HeightFieldGeometry from side-lengths.

      :param size_x: side length in the x direction
      :param size_y: side length in the y direction
      :param heights: 2D grid of heights, with top-left at [0, 0] entry

      :returns: A pointer to the newly created instance of HeightFieldGeometry.



   .. py:method:: __getstate__() -> tuple[float, float, Annotated[numpy.typing.NDArray[numpy.float32], [m, n]]]


   .. py:method:: __setstate__(arg0: tuple) -> None


   .. py:method:: computeMesh() -> StaticMeshGeometry


   .. py:property:: heights
      :type: Annotated[numpy.typing.NDArray[numpy.float32], [m, n]]


      side length in the z direction


   .. py:property:: size_x
      :type: float


      side length in the x direction


   .. py:property:: size_y
      :type: float


      side length in the y direction


.. py:class:: ImportResult

   .. py:property:: geometries
      :type: list[BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | HeightFieldGeometry | StaticMeshGeometry | AbstractStaticGeometry]



   .. py:property:: materials
      :type: list[PhysicalMaterial | PhongMaterial]



   .. py:property:: parts
      :type: list[ScenePartSpec]



.. py:data:: LAYER_ALL
   :type:  int
   :value: 4294967295


.. py:data:: LAYER_COLLISION
   :type:  int
   :value: 134217728


.. py:data:: LAYER_CUSTOM0
   :type:  int
   :value: 1


.. py:data:: LAYER_CUSTOM1
   :type:  int
   :value: 2


.. py:data:: LAYER_CUSTOM10
   :type:  int
   :value: 1024


.. py:data:: LAYER_CUSTOM11
   :type:  int
   :value: 2048


.. py:data:: LAYER_CUSTOM12
   :type:  int
   :value: 4096


.. py:data:: LAYER_CUSTOM13
   :type:  int
   :value: 8192


.. py:data:: LAYER_CUSTOM14
   :type:  int
   :value: 16384


.. py:data:: LAYER_CUSTOM15
   :type:  int
   :value: 32768


.. py:data:: LAYER_CUSTOM16
   :type:  int
   :value: 65536


.. py:data:: LAYER_CUSTOM17
   :type:  int
   :value: 131072


.. py:data:: LAYER_CUSTOM18
   :type:  int
   :value: 262144


.. py:data:: LAYER_CUSTOM19
   :type:  int
   :value: 524288


.. py:data:: LAYER_CUSTOM2
   :type:  int
   :value: 4


.. py:data:: LAYER_CUSTOM20
   :type:  int
   :value: 1048576


.. py:data:: LAYER_CUSTOM21
   :type:  int
   :value: 2097152


.. py:data:: LAYER_CUSTOM22
   :type:  int
   :value: 4194304


.. py:data:: LAYER_CUSTOM23
   :type:  int
   :value: 8388608


.. py:data:: LAYER_CUSTOM3
   :type:  int
   :value: 8


.. py:data:: LAYER_CUSTOM4
   :type:  int
   :value: 16


.. py:data:: LAYER_CUSTOM5
   :type:  int
   :value: 32


.. py:data:: LAYER_CUSTOM6
   :type:  int
   :value: 64


.. py:data:: LAYER_CUSTOM7
   :type:  int
   :value: 128


.. py:data:: LAYER_CUSTOM8
   :type:  int
   :value: 256


.. py:data:: LAYER_CUSTOM9
   :type:  int
   :value: 512


.. py:data:: LAYER_FLUIDS
   :type:  int
   :value: 268435456


.. py:data:: LAYER_GRAPHICS
   :type:  int
   :value: 117440512


.. py:data:: LAYER_NONE
   :type:  int
   :value: 0


.. py:data:: LAYER_ORNAMENTAL
   :type:  int
   :value: 33554432


.. py:data:: LAYER_PHYSICAL
   :type:  int
   :value: 419430400


.. py:data:: LAYER_PHYSICAL_GRAPHICS
   :type:  int
   :value: 16777216


.. py:data:: LAYER_RESERVED0
   :type:  int
   :value: 16777216


.. py:data:: LAYER_RESERVED1
   :type:  int
   :value: 33554432


.. py:data:: LAYER_RESERVED2
   :type:  int
   :value: 67108864


.. py:data:: LAYER_RESERVED3
   :type:  int
   :value: 134217728


.. py:data:: LAYER_RESERVED4
   :type:  int
   :value: 268435456


.. py:data:: LAYER_RESERVED5
   :type:  int
   :value: 536870912


.. py:data:: LAYER_RESERVED6
   :type:  int
   :value: 1073741824


.. py:data:: LAYER_RESERVED7
   :type:  int
   :value: 2147483648


.. py:data:: LAYER_STICK_FIGURE
   :type:  int
   :value: 67108864


.. py:class:: OrthographicProjection

   Info for an orthographic camera projection


   .. py:property:: far
      :type: float


      distance to far clipping plane


   .. py:property:: height
      :type: float


      distance between top and bottom viewing planes


   .. py:property:: near
      :type: float


      distance to near clipping plane


.. py:class:: PerspectiveProjection

   Info for a perspective camera projection


   .. py:property:: far
      :type: float


      distance to far clipping plane


   .. py:property:: fov
      :type: float


      vertical field of view in degrees


   .. py:property:: near
      :type: float


      distance to near clipping plane


.. py:class:: PhongMaterial(mat: PhongMaterialInfo)

   Bases: :py:obj:`Karana.Core.Base`


   A standard Phong material

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(mat: PhongMaterialInfo) -> PhongMaterial
      :staticmethod:


      Create a PhongMaterial
      :param mat: the parameter struct

      :returns: The created PhongMaterial



   .. py:method:: __getstate__() -> PhongMaterialInfo


   .. py:method:: __setstate__(arg0: PhongMaterialInfo) -> None


   .. py:property:: info
      :type: PhongMaterialInfo


      Parameters for the materials


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent PhongMaterial in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a PhongMaterial from yaml file data.



   .. py:method:: to_json(o: PhongMaterial) -> dict[str, Any]
      :staticmethod:


      Class method used to represent PhongMaterial in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a PhongMaterial from json file data.



.. py:class:: PhongMaterialInfo

   Parameter struct for a PhongMaterial


   .. py:method:: __getstate__() -> tuple[Color, Texture, Color, Texture, Color, Texture, Color, Texture]


   .. py:method:: __setstate__(arg0: tuple) -> None


   .. py:property:: ambient_color
      :type: Color


      constant ambient color


   .. py:property:: ambient_color_map
      :type: Texture


      ambient color map


   .. py:property:: color
      :type: Color


      constant diffuse color


   .. py:property:: color_map
      :type: Texture


      diffuse color map


   .. py:property:: emissive_color
      :type: Color


      constant emissive color


   .. py:property:: emissive_color_map
      :type: Texture


      emissive color map


   .. py:property:: specular_color
      :type: Color


      constant specular color


   .. py:property:: specular_color_map
      :type: Texture


      specular color map


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent PhongMaterialInfo in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a PhongMaterialInfo from yaml file data.



   .. py:method:: to_json(o: PhongMaterialInfo) -> dict[str, Any]
      :staticmethod:


      Class method used to represent PhongMaterialInfo in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a PhongMaterialInfo from json file data.



.. py:class:: PhysicalMaterial(mat: PhysicalMaterialInfo)

   Bases: :py:obj:`Karana.Core.Base`


   A standard PBR material

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(mat: PhysicalMaterialInfo) -> PhysicalMaterial
      :staticmethod:


      Create a PhysicalMaterial
      :param mat: the parameter struct

      :returns: The created PhysicalMaterial



   .. py:method:: __getstate__() -> PhysicalMaterialInfo


   .. py:method:: __setstate__(arg0: PhysicalMaterialInfo) -> None


   .. py:property:: info
      :type: PhysicalMaterialInfo


      Parameters for the materials


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent PhysicalMaterial in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a PhysicalMaterial from yaml file data.



   .. py:method:: to_json(o: PhysicalMaterial) -> dict[str, Any]
      :staticmethod:


      Class method used to represent PhysicalMaterial in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a PhysicalMaterial from json file data.



.. py:class:: PhysicalMaterialInfo

   Parameter struct for a PhysicalMaterial


   .. py:method:: __getstate__() -> tuple[Texture, Color, float, GrayscaleTexture, float, GrayscaleTexture, Texture]


   .. py:method:: __setstate__(arg0: tuple) -> None


   .. py:property:: color
      :type: Color


      constant base color


   .. py:property:: color_map
      :type: Texture


      base color map


   .. py:property:: metalness
      :type: float


      how metal-like the material is, between 0 and 1


   .. py:property:: metalness_map
      :type: GrayscaleTexture


      grayscale metalness map


   .. py:property:: normal_map
      :type: Texture


      normal map (assumes tangent space)


   .. py:property:: roughness
      :type: float


      how rough the material is, between 0 and 1


   .. py:property:: roughness_map
      :type: GrayscaleTexture


      grayscale roughness map


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent PhysicalMaterialInfo in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a PhysicalMaterialInfo from yaml file data.



   .. py:method:: to_json(o: PhysicalMaterialInfo) -> dict[str, Any]
      :staticmethod:


      Class method used to represent PhysicalMaterialInfo in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a PhysicalMaterialInfo from json file data.



.. py:class:: RoundFrustumGeometry(bottom_radius: SupportsFloat | SupportsIndex, top_radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex)

   Bases: :py:obj:`AbstractStaticGeometry`


   Concrete round frustum geometry class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(bottom_radius: SupportsFloat | SupportsIndex, top_radius: SupportsFloat | SupportsIndex, height: SupportsFloat | SupportsIndex) -> RoundFrustumGeometry
      :staticmethod:


      Create a new instance of CapsuleGeometry from radii and height.

      :param bottom_radius: radius of bottom face
      :param top_radius: radius of top face
      :param height: height of the frustum

      :returns: A pointer to the newly created instance of RoundFrustumGeometry.



   .. py:method:: __getstate__() -> Annotated[numpy.typing.NDArray[numpy.float32], [3, 1]]


   .. py:method:: __setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [3, 1]]) -> None


   .. py:property:: bottom_radius
      :type: float


      radius of the bottom face


   .. py:property:: height
      :type: float


      height of the frustum


   .. py:property:: top_radius
      :type: float


      radius of the top face


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent RoundFrustumGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a RoundFrustumGeometry from yaml file data.



   .. py:method:: to_json(o: RoundFrustumGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent RoundFrustumGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a RoundFrustumGeometry from json file data.



.. py:class:: Scene

   Bases: :py:obj:`Karana.Core.Base`


   Base container for a hierarchy of geometries

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: defaultLayers() -> int

      Get the layers that should be created by default
      :returns: The default layers



   .. py:method:: getManager() -> Scene

      Get the Scene managing this one
      :returns: The managing scene or nullptr



   .. py:method:: getSceneNodes() -> list[SceneNode]

      Get the list of scene nodes in the scene

      :returns: The SceneNodes for this Scene.



   .. py:method:: getSceneParts(layers: SupportsInt | SupportsIndex = 4294967295) -> list[ScenePart]

      Get the list of scene parts in the scene

      :param layers: limit returned list to parts belong to the specified
                     layers

      :returns: The SceneParts for this Scene.



   .. py:method:: setManager(manager: Scene) -> None

      Assign a managing scene
      :param manager: The scene managing this one (nullable)



.. py:class:: SceneNode

   Bases: :py:obj:`Karana.Core.Base`


   Base for objects with a transform i n the scene hierarchy

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: attachTo(parent: SceneNode, maintain_world_transform: bool = False) -> None

      Attach to a parent node
      :param parent:
                     - The parent node
      :param maintain_world_sim_transform:
                                           - If true, update the node's
                                           relative transform so that its
                                           overall world transform doesn't
                                           change after attaching it to the
                                           parent



   .. py:method:: childrenNodes() -> list[SceneNode]

      Get the node's children nodes
      :returns: A list of the node's children nodes



   .. py:method:: detach(maintain_world_transform: bool = False) -> None

      Detach the node from its parent
      :param maintain_world_sim_transform:
                                           - If true, update the node's
                                           relative transform so that its
                                           overall world transform doesn't
                                           change after detaching



   .. py:method:: getManager() -> SceneNode

      Get a SceneNode managing this one
      :returns: The managing scene node or nullptr



   .. py:method:: getScale() -> float

      Get uniform scale of the node relative to its parent
      :returns: The relative uniform scale



   .. py:method:: getSimTransform() -> Karana.Math.SimTran

      Get similarity transform of the node relative to its parent
      :returns: The similarity transform



   .. py:method:: getVars() -> SceneNodeVars


   .. py:method:: getVisible() -> bool

      Get whether the object is visible
      :returns: The visibility flag



   .. py:method:: getWorldSimTransform() -> Karana.Math.SimTran

      Get similarity transform of the node relative to the scene's root
      :returns: The similarity transform



   .. py:method:: isScenePart() -> bool

      Return true if this scene node is a scene part
      :returns: true if the node is a scene part



   .. py:method:: setManager(manager: SceneNode) -> None

      Assign a managing scene node
      :param manager: The scene node managing this one (nullable)



   .. py:method:: setScale(scale: SupportsFloat | SupportsIndex) -> None

      Set uniform of the node relative to its parent
      :param scale:
                    - The relative uniform scale



   .. py:method:: setSimTransform(scale: Karana.Math.SimTran) -> None

      Set similarity transform of the node relative to its parent
      :param transform:
                        - The similarity transform



   .. py:method:: setTranslation(translation: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) -> None

      Set position of the node relative to its parent
      :param translation:
                          - The relative translation



   .. py:method:: setUnitQuaternion(quaternion: Karana.Math.UnitQuaternion) -> None

      Set rotation of the node relative to its parent
      :param quaternion:
                         - The relative rotation as a unit quaternion



   .. py:method:: setVisible(visible: bool) -> None

      Set whether the object is visible
      :param visible:
                      - The visibility flag



.. py:class:: SceneNodeVars

   Bases: :py:obj:`Karana.Core.BaseVars`


   


   .. py:property:: children_nodes
      :type: Karana.Core.VarVecString


      The names of the children SceneNode instances.


   .. py:property:: parent_node
      :type: Karana.Core.VarString


      The name of the parent SceneNode.


   .. py:property:: scale
      :type: Karana.Core.VarDouble


      The local scale of the SceneNode.


   .. py:property:: transform
      :type: Karana.Core.VarHomTran


      The local transform of the SceneNode.


   .. py:property:: world_scale
      :type: Karana.Core.VarDouble


      The world scale of the SceneNode.


   .. py:property:: world_transform
      :type: Karana.Core.VarHomTran


      The world transform of the SceneNode.


.. py:class:: ScenePart

   Bases: :py:obj:`SceneNode`


   Class for objects with geometry and material in the scene

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: getLayersString(arg0: SupportsInt | SupportsIndex) -> str
      :staticmethod:


      Convert the layer value into a more readable string form

      The conversion only uses the pre-defined and known layer values (eg.
      COLLISION etc)

      :param layer: the layer value

      :returns: A string representation of the bitmask for which layers the part
                belongs to.



   .. py:method:: getGeometry() -> BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | HeightFieldGeometry | StaticMeshGeometry | AbstractStaticGeometry

      Get the part's geometry

      :returns: The part's geometry



   .. py:method:: getIntrinsicScale() -> Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]

      Get the part's intrinsic scale.

      The intrinsic scale can be non-uniform but does not apply to attached
      nodes.

      :returns: The part's intrinsic scale.



   .. py:method:: getLayers() -> int

      Get which layers the part belongs to.

      :returns: Bitmask for which layers the part belongs to.



   .. py:method:: getMaterial() -> PhysicalMaterial | PhongMaterial

      Get the part's material

      :returns: The part's material



   .. py:method:: getVars() -> ScenePartVars


   .. py:method:: setIntrinsicScale(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) -> None

      Set the part's intrinsic scale.

      The intrinsic scale can be non-uniform but does not apply to attached
      nodes.

      :param scale:
                    - The part's intrinsic scale.



   .. py:method:: setMaterial(arg0: PhysicalMaterial | PhongMaterial) -> None

      Set the part's material

      :param material:
                       - The part's new material.



.. py:class:: ScenePartSpec(name: str = 'unnamed', geometry: BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | HeightFieldGeometry | StaticMeshGeometry | AbstractStaticGeometry = None, material: PhysicalMaterial | PhongMaterial = None, transform: Karana.Math.HomTran = ..., scale: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ..., layers: SupportsInt | SupportsIndex = 419430400)

   .. py:attribute:: geometry
      :type:  BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | HeightFieldGeometry | StaticMeshGeometry | AbstractStaticGeometry


   .. py:attribute:: material
      :type:  PhysicalMaterial | PhongMaterial


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: transform
      :type:  Karana.Math.HomTran


   .. py:property:: layers
      :type: int



   .. py:property:: scale
      :type: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]



.. py:class:: ScenePartSpecVars

   Bases: :py:obj:`Karana.Core.BaseVars`


   The Vars for the ScenePartSpec class.


   .. py:property:: geometry
      :type: Karana.Core.VarString


      The geometry type


   .. py:property:: layers
      :type: Karana.Core.VarInt


      The layers for the ScenePart.


   .. py:property:: layers_string
      :type: Karana.Core.VarString


      Readable string representation of the layers for the ScenePart


   .. py:property:: material
      :type: Karana.Core.VarString


      The material type


   .. py:property:: scale
      :type: Karana.Core.VarVec3


      The intrinsic (possibly non-uniform) scale for the geometry


   .. py:property:: transform
      :type: Karana.Core.VarHomTran


      The transform


.. py:class:: ScenePartVars

   Bases: :py:obj:`SceneNodeVars`, :py:obj:`Karana.Core.BaseVars`


   The Vars for the ScenePart class.


   .. py:property:: aabb
      :type: Karana.Core.VarSpatialVector


      The bounding box


   .. py:property:: geometry
      :type: Karana.Core.VarString


      The geometry type


   .. py:property:: intrinsic_scale
      :type: Karana.Core.VarVec3


      The intrinsic (possibly non-uniform) scale for the geometry


   .. py:property:: layers
      :type: Karana.Core.VarInt


      The layers for the ScenePart.


   .. py:property:: layers_string
      :type: Karana.Core.VarString


      Readable string representation of the layers for the ScenePart


.. py:class:: SceneVars

   Bases: :py:obj:`Karana.Core.BaseVars`


   


   .. py:property:: num_nodes
      :type: Karana.Core.VarInt


      The number of scene nodes


.. py:class:: SphereGeometry(radius: SupportsFloat | SupportsIndex)

   Bases: :py:obj:`AbstractStaticGeometry`


   Concrete sphere geometry class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(radius: SupportsFloat | SupportsIndex) -> SphereGeometry
      :staticmethod:


      Create a new instance of SphereGeometry from a radius.

      :param radius: radius of the sphere

      :returns: A pointer to the newly created instance of SphereGeometry.



   .. py:method:: __getstate__() -> float


   .. py:method:: __setstate__(arg0: SupportsFloat | SupportsIndex) -> None


   .. py:method:: computeMesh() -> StaticMeshGeometry


   .. py:property:: radius
      :type: float


      radius of the sphere


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent SphereGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a SphereGeometry from yaml file data.



   .. py:method:: to_json(o: SphereGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent SphereGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a SphereGeometry from json file data.



.. py:class:: StaticMeshGeometry(positions: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 3]], faces: Annotated[numpy.typing.ArrayLike, numpy.int32, [m, 3]], normals: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 3]], surface_map_coords: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 2]])

   Bases: :py:obj:`AbstractStaticGeometry`


   Concrete triangular mesh geometry class

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(positions: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 3]], faces: Annotated[numpy.typing.ArrayLike, numpy.int32, [m, 3]], normals: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 3]], surface_map_coords: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 2]]) -> StaticMeshGeometry
      :staticmethod:


      Create a new instance of CapsuleGeometry from radius and height.

      :param positions: matrix of vertex positions
      :param faces: matrix of triangles as three vertex indices
      :param normals: matrix of vertex normals
      :param surface_map_coords: matrix of uv (texture) coords

      :returns: A pointer to the newly created instance of StaticMeshGeometry.



   .. py:method:: __getstate__() -> tuple[Annotated[numpy.typing.NDArray[numpy.float32], [m, 3]], Annotated[numpy.typing.NDArray[numpy.int32], [m, 3]], Annotated[numpy.typing.NDArray[numpy.float32], [m, 3]], Annotated[numpy.typing.NDArray[numpy.float32], [m, 2]], str]


   .. py:method:: __setstate__(arg0: tuple) -> None


   .. py:method:: setConvexity(is_convex: bool = False) -> None

      Set whether this static mesh is convex; used by some client scenes.

      :param is_convex: Whether the mesh is convex



   .. py:property:: faces
      :type: Annotated[numpy.typing.NDArray[numpy.int32], [m, 3]]


      triangles consisting of three vertex indices


   .. py:property:: filename
      :type: str


      If this mesh comes from a file, this is the filename.


   .. py:property:: normals
      :type: Annotated[numpy.typing.NDArray[numpy.float32], [m, 3]]


      vertex normals


   .. py:property:: positions
      :type: Annotated[numpy.typing.NDArray[numpy.float32], [m, 3]]


      vertex positions


   .. py:property:: surface_map_coords
      :type: Annotated[numpy.typing.NDArray[numpy.float32], [m, 2]]


      vertex uv (texture) coordinates


   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent StaticMeshGeometry in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a StaticMeshGeometry from yaml file data.



   .. py:method:: to_json(o: StaticMeshGeometry) -> dict[str, Any]
      :staticmethod:


      Class method used to represent StaticMeshGeometry in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a StaticMeshGeometry from json file data.



.. py:class:: TextParameters

   Style parameters for text


   .. py:property:: align
      :type: Alignment


      Controls text alignment/justification


   .. py:property:: color
      :type: Color


      Color of the text


   .. py:property:: size
      :type: float


      Text size as a portion of the screen's full vertical space


.. py:class:: Texture

   Bases: :py:obj:`Karana.Core.Base`


   Class for a texture image

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(name: str, data: Annotated[numpy.typing.ArrayLike, numpy.int8]) -> Texture
      :staticmethod:


      Create a Texture instance.
      :param name: The Texture's name.
      :param data: The data for the texture.

      :returns: A ks_ptr to the Texture.



   .. py:method:: lookupOrCreateTexture(filename: os.PathLike | str | bytes) -> Texture
      :staticmethod:


      Create a texture from a file name. This caches the texture
             so that future versions created with the same file name just
             return a pointer to the same texture.
      :param filename: The name of the file.

      :returns: A ks_ptr to the Texture.



   .. py:method:: __getstate__() -> tuple[str, numpy.ndarray]


   .. py:method:: __setstate__(arg0: tuple) -> None


   .. py:method:: getData() -> numpy.ndarray

      Get the texture data associated with the Texture.
      :returns: The texture data associated with the Texture.



   .. py:method:: setData(data: Annotated[numpy.typing.ArrayLike, numpy.int8]) -> None

      Set the texture data associated with the Texture.
      :param data: The data to set the Texture data to.



   .. py:method:: writeToFile(filename: os.PathLike | str | bytes) -> None

      Write the texture to a file.
      :param filename: The name of the file to write to.



   .. py:method:: to_yaml(representer, node)
      :classmethod:


      Class method used to represent Texture in a yaml file.



   .. py:method:: from_yaml(_, node) -> Self
      :classmethod:


      Construct a Texture from yaml file data.



   .. py:method:: to_json(o: Texture) -> dict[str, Any]
      :staticmethod:


      Class method used to represent Texture in a json file.



   .. py:method:: from_json(d: dict[str, Any]) -> Self
      :classmethod:


      Construct a Texture from json file data.



.. py:class:: TransformUpdateScope(arg0: Scene)

   RAII wrapper for beginTransformUpdates and endTransformUpdates


   .. py:method:: __enter__() -> None


   .. py:method:: __exit__(arg0: type | None, arg1: Any | None, arg2: Any | None) -> bool


   .. py:method:: close() -> None

      Close the scope early.



   .. py:method:: isOpen() -> bool

      Check if the scope is still open.
      :returns: Whether the scope is open.



.. py:function:: defaultGeometry() -> BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | HeightFieldGeometry | StaticMeshGeometry | AbstractStaticGeometry

.. py:function:: defaultMaterial() -> PhysicalMaterial | PhongMaterial

.. py:class:: ProxyScene(name: str, root_frame: Karana.Frame.Frame)

   Bases: :py:obj:`Karana.Scene.Scene`


   A Scene implementation acting as a proxy to any number of registered
   'client' Scenes.

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:attribute:: update_callbacks
      :type:  Karana.Core.VoidCallbackRegistry


   .. py:method:: create(name: str, root_frame: Karana.Frame.Frame) -> ProxyScene
      :staticmethod:


      Create a ProxyScene
      :param name:
                   - Name of the ProxyScene.
      :param root_frame:
                         - Default Frame to attach nodes to.

      :returns: The created ProxyScene



   .. py:method:: chaseFrame(frame: Karana.Frame.Frame, offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]], at_offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ..., up: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ...) -> None

      Position the default camera relative to a Frame

      :param frm: the Frame to chase around
      :param offset: camera position relative to the Frame
      :param at_offset: camera target relative to the Frame
      :param up: camera up vector



   .. py:method:: clientScenes() -> list[Karana.Scene.Scene]

      Get a list of all registered client Scenes

      :returns: The list of client Scenes



   .. py:method:: collision() -> Karana.Scene.CollisionScene

      Get a registered CollisionScene

      If there is more than one only the first one found is returned.

      :returns: A CollisionScene or nullptr



   .. py:method:: empty() -> bool

      Check if the ProxyScene has any nodes or parts

      :returns: Whether the ProxyScene is empty



   .. py:method:: getNodesAttachedToFrame(frame: Karana.Frame.Frame, strict: bool) -> list[ProxySceneNode]

      Retrieve all ProxySceneNodes attached to the provided frame.

      :param frame:
                    - The frame to retrieve nodes from.
      :param strict:
                     - If true, then only get nodes directly attached to the
                     provided frame. If false, then return all nodes whose
                     ancestor frame is the provided frame.

      :returns:

                - A vector of ProxySceneNodes attached to the provided frame.



   .. py:method:: getPartsAttachedToFrame(frame: Karana.Frame.Frame, strict: bool, layers: SupportsInt | SupportsIndex = 4294967295) -> list[ProxyScenePart]

      Retrieve all ProxySceneParts attached to the provided frame.

      :param frame:
                    - The frame to retrieve parts from.
      :param strict:
                     - If true, then only get parts directly attached to the
                     provided frame. If false, then return all parts whose
                     ancestor frame is the provided frame.
      :param layers:
                     - Limit to parts belong to the specified layer

      :returns:

                - A vector of ProxySceneParts attached to the provided frame.



   .. py:method:: getVars() -> ProxySceneVars


   .. py:method:: graphics() -> Karana.Scene.GraphicalScene

      Get a registered GraphicalScene

      If there is more than one only the first one found is returned.

      :returns: A GraphicalScene or nullptr



   .. py:method:: layers(client_scene: Karana.Scene.Scene) -> int

      Get the client's layers value
      :param client_scene:
                           - The client Scene

      :returns: The layers value



   .. py:method:: lookupProxyFromImpl(impl: Karana.Scene.SceneNode) -> ProxySceneNode

      Lookup the ProxySceneNode managing the given implementation
      :param impl:
                   - The SceneNode in a client Scene

      :returns: The corresponding ProxySceneNode



   .. py:method:: originFrame(client_scene: Karana.Scene.Scene) -> Karana.Frame.Frame

      Get the Frame the client's origin is centered at
      :param client_scene:
                           - The client Scene

      :returns: The origin Frame for the given client Scene



   .. py:method:: registerClientScene(scene: Karana.Scene.Scene, origin_frame: Karana.Frame.Frame, layers: SupportsInt | SupportsIndex | None = None) -> None

      Register a client Scene to be managed
      :param scene:
                    - The client Scene
      :param origin_frame:
                           - The Frame to center the client's origin at
      :param layers:
                     - Bitmask for objects to implement



   .. py:method:: rootFrame() -> Karana.Frame.Frame

      Get the root frame.

      This is the frame that nodes are attached to by default.

      :returns: The root Frame.



   .. py:method:: showAxes(frame: Karana.Frame.Frame, size: SupportsFloat | SupportsIndex = 1.0) -> None

      Show the axes for a Frame

      :param frm: the Frame to show axes for
      :param size: the size of the axes



   .. py:method:: unregisterClientScene(arg0: Karana.Scene.Scene) -> None

      Unregister a client Scene to no longer be managed
      :param scene:
                    - The client Scene.



   .. py:method:: update() -> None
                  update(arg0: Karana.Scene.Scene) -> None

      Update all Frame-attached nodes' transforms for all clients



   .. py:method:: viewAroundFrame(frame: Karana.Frame.Frame, offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]], at_offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ..., up: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ...) -> None

      Position the default camera relative to a Frame

      :param frm: the Frame to view around
      :param offset: camera position relative to the Frame
      :param at_offset: camera target relative to the Frame
      :param up: camera up vector



   .. py:method:: setupGraphics(origin_frame: Karana.Frame.Frame, *, port: int = 29523, axes: float = 1.0, client_type: Literal['auto', 'electron', 'notebook', 'webbrowser', 'selenium'] | None = 'auto', wait_for_clients: int = 0, wait_for_clients_timeout: float = 0.0) -> tuple[Callable[[], None], Karana.Scene.WebScene]

      Easily set up graphics.

      :param origin_frame: Frame to use as the world origin for the graphics scene.
      :type origin_frame: Frame
      :param port: Port to bind the WebUI server to. Use 0 to request an arbitrary unused
                   port. Defaults to 29523.
      :type port: int
      :param axes: Length of axes visualization on root frame. Defaults to 1.0.
      :type axes: float
      :param client_type:
                          Policy for launching a client.
                              "auto": pick the best option for the environment and OS
                              "electron": always launch the electron client
                              "notebook": always open an IFrame in IPython
                              "webbrowser": always open a browser tab
                              "selenium": always open a chrome driver using selenium
                              None: don't automatically open a client
                          Defaults to "auto".
      :type client_type: Literal["auto", "electron", "notebook", "webbrowser", "selenium"] | None
      :param wait_for_clients: Number of client connections to wait for before continuing.
                               Defaults to 0.
      :type wait_for_clients: int
      :param wait_for_clients_timeout: Number of seconds to wait before raising an error if wait_for_clients
                                       is positive. Defaults to 0.
      :type wait_for_clients_timeout: float

      :returns: A tuple containing the a cleanup callable and the graphics scene.
      :rtype: tuple[Callable[[],None], WebScene]



.. py:class:: ProxySceneNode(name: str, scene: ProxyScene)

   Bases: :py:obj:`Karana.Scene.SceneNode`


   .. py:method:: ancestorFrame() -> Karana.Frame.Frame

      Get the unique Frame that an ancestor is attached to
      :returns: The Frame that this node or an ancestor is attached to



   .. py:method:: attachTo(parent: Karana.Scene.SceneNode, maintain_world_transform: bool = False) -> None
                  attachTo(parent: Karana.Frame.Frame, maintain_world_transform: bool = False) -> None

      Attach the node to a Frame
      :param parent:
                     - The Frame to attach to
      :param maintain_world_transform:
                                       - If true, update the node's relative
                                       transform so that its overall world
                                       transform doesn't change after attaching
                                       it to the parent



   .. py:method:: collision() -> Karana.Scene.CollisionSceneNode
                  collision(arg0: Karana.Scene.Scene) -> Karana.Scene.CollisionSceneNode

      Get a collision implementation If there is more than one collision
      implementation only the first one found is returned.

      :returns: A collision implementation or nullptr



   .. py:method:: create(name: Karana.Frame.Frame) -> ProxyScene

      Create a ProxyScene node.
      :param name:
                   - The name of the ProxySceneNode.
      :param scene:
                    - The ProxyScene to add the node to.

      :returns: The created ProxySceneNode



   .. py:method:: detach(maintain_world_transform: bool = False) -> None


   .. py:method:: graphics() -> Karana.Scene.GraphicalSceneNode
                  graphics(arg0: Karana.Scene.Scene) -> Karana.Scene.GraphicalSceneNode

      Get a graphical implementation If there is more than one graphical
      implementation only the first one found is returned.

      :returns: A graphical implementation or nullptr



   .. py:method:: of(scene: Karana.Scene.Scene) -> Karana.Scene.SceneNode

      Get the implementation for a given client
      :param scene:
                    - The client scene

      :returns: The implementation of this node for the client



   .. py:method:: setScale(arg0: SupportsFloat | SupportsIndex) -> None


   .. py:method:: setTranslation(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) -> None


   .. py:method:: setUnitQuaternion(arg0: Karana.Math.UnitQuaternion) -> None


.. py:class:: ProxyScenePart(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt | SupportsIndex = 419430400)
              ProxyScenePart(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt | SupportsIndex = 419430400)

   Bases: :py:obj:`Karana.Scene.ScenePart`, :py:obj:`ProxySceneNode`


   .. py:method:: create(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt | SupportsIndex = 419430400) -> ProxyScenePart
                  create(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt | SupportsIndex = 419430400) -> ProxyScenePart
      :staticmethod:


      Create a ProxyScenePart.

      :param name:
                   - Name of the ProxyScenePart.
      :param scene:
                    - The ProxyScene to add the ProxyScenePart to.
      :param geometry:
                       - Geometry of the ProxyScenePart.
      :param material:
                       - Material for the ProxyScenePart.
      :param layers:
                     - Layers to use for the ProxyScenePart.

      :returns: The new ProxyScene part.



   .. py:method:: fromScenePartSpec(scene: ProxyScene, spec: Karana.Scene.ScenePartSpec) -> ProxyScenePart
      :staticmethod:


      Create a ProxyScenePart from a ScenePartSpec.

      :param scene:
                    - The ProxyScene to add the ProxyScenePart to.
      :param spec: The spec to use to create the ProxyScenePart.

      :returns: The new ProxyScene part.



   .. py:method:: collision() -> Karana.Scene.CollisionScenePart
                  collision(arg0: Karana.Scene.Scene) -> Karana.Scene.CollisionScenePart

      Get a collision implementation If there is more than one collision
      implementation only the first one found is returned.

      :returns: A collision implementation or nullptr



   .. py:method:: getVars() -> ProxyScenePartVars


   .. py:method:: graphics() -> Karana.Scene.GraphicalScenePart
                  graphics(arg0: Karana.Scene.Scene) -> Karana.Scene.GraphicalScenePart

      Get a graphical implementation If there is more than one graphical
      implementation only the first one found is returned.

      :returns: A graphical implementation or nullptr



   .. py:method:: of(scene: Karana.Scene.Scene) -> Karana.Scene.ScenePart

      Get the implementation for a given client
      :param scene:
                    - The client scene

      :returns: The implementation of this node for the client



   .. py:method:: setIntrinsicScale(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) -> None


.. py:class:: ProxyScenePartVars

   Bases: :py:obj:`Karana.Scene.ScenePartVars`, :py:obj:`Karana.Core.BaseVars`


   The Vars for the ProxyScenePart class.


   .. py:property:: parent_frame
      :type: Karana.Core.VarString


      The parent frame name


.. py:class:: ProxySceneVars

   Bases: :py:obj:`Karana.Scene.SceneVars`, :py:obj:`Karana.Core.BaseVars`


   


   .. py:property:: root_frame
      :type: Karana.Core.VarString


      the root frame name


.. py:class:: WebScene(name: str, server: Karana.WebUI.Server)

   Bases: :py:obj:`Karana.Scene.GraphicalScene`


   GraphicalScene implementation for web-based graphics

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(name: str, server: Karana.WebUI.Server) -> WebScene
      :staticmethod:


      Create a WebScene
      :param name:
                   - Name for the WebScene
      :param server:
                     - Server to communicate with frontends

      :returns: The created WebScene



   .. py:method:: defaultCamera() -> Karana.Scene.GraphicalSceneCamera

      Get the default camera
      :returns: The camera



   .. py:method:: pushChanges() -> None

      Hint to the frontend that it's a good time to render



   .. py:method:: renderToFile(filepath: os.PathLike | str | bytes) -> None


   .. py:method:: server() -> Karana.WebUI.Server

      Get the server used by WebScene
      :returns: The server used to communicate with frontends



   .. py:method:: setOnHover(on_pick: collections.abc.Callable[[WebScenePart | None], None]) -> None

      Set a callback for when a part is hovered over
      :param on_hover: The callback to call with the part's id



   .. py:method:: setOnPick(on_pick: collections.abc.Callable[[WebScenePart | None], None]) -> None

      Set a callback for when a part is clicked on
      :param on_pick: The callback to call with the part's id



.. py:class:: WebSceneNode(name: str, scene: WebScene)

   Bases: :py:obj:`Karana.Scene.GraphicalSceneNode`


   .. py:method:: create(name: str, scene: WebScene) -> WebSceneNode
      :staticmethod:


      Create a WebSceneNode.
      :param name:
                   - Name of the node.
      :param scene:
                    - The WebScene to add the node to.

      :returns: The created WebSceneNode.



.. py:class:: WebScenePart(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt | SupportsIndex = 419430400)
              WebScenePart(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt | SupportsIndex = 419430400)

   Bases: :py:obj:`Karana.Scene.GraphicalScenePart`, :py:obj:`WebSceneNode`


   .. py:method:: create(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt | SupportsIndex = 419430400) -> WebScenePart
                  create(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt | SupportsIndex = 419430400) -> WebScenePart
      :staticmethod:


      Create a WebScenePart.

      :param name:
                   - Name of the WebScenePart.
      :param scene:
                    - The GraphicalScene to add the WebScenePart to.
      :param geometry:
                       - Geometry of the WebScenePart.
      :param material:
                       - Material for the WebScenePart.
      :param layers:
                     - Layers to use for the WebScenePart.

      :returns: The new WebScene part.



   .. py:method:: getIntrinsicScale() -> Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]


   .. py:method:: outline() -> None

      Draw an outline around the part



   .. py:method:: removeOutline() -> None

      Remove a previously added outline



   .. py:method:: setIntrinsicScale(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) -> None


.. py:class:: CoalScene(name: str)

   Bases: :py:obj:`Karana.Scene.CollisionScene`


   CollisionScene implementation using the COAL library

   See :ref:`scene_layer_sec` for more discussion on the scene layer.


   .. py:method:: create(name: str) -> CoalScene
      :staticmethod:


      Create a CoalScene
      :param name:
                   - Name for the CoalScene

      :returns: The created CoalScene



   .. py:method:: getMaxNumContacts() -> int

      Get the maximum number of contact points that we track between any two
      scene parts

      :returns: size_t



   .. py:method:: setMaxNumContacts(max_contacts: SupportsInt | SupportsIndex) -> None

      Set the maximum number of contact points that we track between any two
      scene parts.

      Also broadcasts this information to every existing CoalScenePart

      :param max_contacts: New maximum count



   .. py:method:: toDS() -> Karana.Scene.CoalScene_types.CoalSceneDS

      Create a CoalSceneDS from this CoalScene model.

      :returns: * *CoalSceneDS*
                * *A CoalSceneDS instance with values set to match this model.*



.. py:class:: CoalSceneNode(name: str, scene: CoalScene)

   Bases: :py:obj:`Karana.Scene.CollisionSceneNode`


   .. py:method:: create(name: str, scene: CoalScene) -> CoalSceneNode
      :staticmethod:


      Create a CoalSceneNode.
      :param name:
                   - The name of the CoalSceneNode.
      :param scene:
                    - The CoalScene to add the node to.

      :returns: The created CoalSceneNode.



.. py:class:: CoalScenePart(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt | SupportsIndex = 419430400)
              CoalScenePart(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt | SupportsIndex = 419430400)

   Bases: :py:obj:`CoalSceneNode`, :py:obj:`Karana.Scene.CollisionScenePart`


   .. py:method:: create(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt | SupportsIndex = 419430400) -> CoalScenePart
                  create(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.HeightFieldGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt | SupportsIndex = 419430400) -> CoalScenePart
      :staticmethod:


      Create a CoalScenePart.
      :param name:
                   - Name of the CoalScenePart.
      :param scene:
                    - The GraphicalScene to add the CoalScenePart to.
      :param geometry:
                       - Geometry of the CoalScenePart.
      :param material:
                       - Material for the CoalScenePart.
      :param layers:
                     - Layers to use for the CoalScenePart.

      :returns: The new CoalScene part.



