Lysa  0.0
Lysa 3D Engine
Scene Class Referenceabstract

Detailed Description

A renderable scene that holds a collection of MeshInstance objects submitted to the GPU.

Lua full name: lysa.Scene

Public Member Functions

nil add_instance (id: integer)
 Adds a MeshInstance by id to this scene for rendering. More...
 
nil update_instance (id: integer)
 Notifies the renderer that the MeshInstance with the given id has been modified (transform, material, etc.). More...
 
nil remove_instance (id: integer)
 Removes a MeshInstance by id from this scene. More...
 
RayCastHit|nil ray_cast (ray: Ray, parent: MeshInstance|nil)
 Casts a ray through all MeshInstances and returns the closest hit, or nil. The length of direction defines the max distance. More...
 
RayCastHit[] ray_cast_all (ray: Ray, parent: MeshInstance|nil)
 Casts a ray through all MeshInstances and returns all hits sorted by ascending distance, one per MeshInstance. More...
 

Properties

integer id
 Unique scene identifier.
 

Member Function Documentation

nil add_instance ( integer  id)

Adds a MeshInstance by id to this scene for rendering.

Parameters
idinteger
nil update_instance ( integer  id)

Notifies the renderer that the MeshInstance with the given id has been modified (transform, material, etc.).

Parameters
idinteger
nil remove_instance ( integer  id)

Removes a MeshInstance by id from this scene.

Parameters
idinteger
RayCastHit|nil ray_cast ( Ray  ray,
MeshInstance|nil  parent)

Casts a ray through all MeshInstances and returns the closest hit, or nil. The length of direction defines the max distance.

Parameters
rayRay
parentMeshInstance|nil
Returns
RayCastHit|nil
RayCastHit[] ray_cast_all ( Ray  ray,
MeshInstance|nil  parent)

Casts a ray through all MeshInstances and returns all hits sorted by ascending distance, one per MeshInstance.

Parameters
rayRay
parentMeshInstance|nil
Returns
RayCastHit[]

Property Documentation

integer id

Unique scene identifier.