[][src]Struct gdnative::api::BakedLightmap

pub struct BakedLightmap { /* fields omitted */ }

core class BakedLightmap inherits VisualInstance (unsafe).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

Non reference counted objects such as the ones of this type are usually owned by the engine.

BakedLightmap is a reference-only type. Persistent references can only exist in the unsafe Ref<BakedLightmap> form.

In the cases where Rust code owns an object of this type, for example if the object was just created on the Rust side and not passed to the engine yet, ownership should be either given to the engine or the object must be manually destroyed using Ref::free, or Ref::queue_free if it is a Node.

Class hierarchy

BakedLightmap inherits methods from:

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl BakedLightmap[src]

Constants

impl BakedLightmap[src]

pub fn new() -> Ref<BakedLightmap, Unique>[src]

Creates a new instance of this object.

Because this type is not reference counted, the lifetime of the returned object is not automatically managed.

Immediately after creation, the object is owned by the caller, and can be passed to the engine (in which case the engine will be responsible for destroying the object) or destroyed manually using Ref::free, or preferably Ref::queue_free if it is a Node.

pub fn bake(
    &self,
    from_node: impl AsArg<Node>,
    create_visual_debug: bool
) -> BakeError
[src]

Bakes the lightmaps within the currently edited scene. Returns a [enum BakeError] to signify if the bake was successful, or if unsuccessful, how the bake failed.

Default Arguments

  • from_node - null
  • create_visual_debug - false

pub fn debug_bake(&self)[src]

Executes a dry run bake of lightmaps within the currently edited scene.

pub fn bake_cell_size(&self) -> f64[src]

Grid subdivision size for lightmapper calculation. The default value will work for most cases. Increase for better lighting on small details or if your scene is very large.

pub fn bake_default_texels_per_unit(&self) -> f64[src]

If a [member Mesh.lightmap_size_hint] isn't specified, the lightmap baker will dynamically set the lightmap size using this value. This value is measured in texels per world unit. The maximum lightmap texture size is 4096x4096.

pub fn bake_mode(&self) -> BakeMode[src]

Lightmapping mode. See [enum BakeMode].

pub fn bake_quality(&self) -> BakeQuality[src]

Three quality modes are available. Higher quality requires more rendering time. See [enum BakeQuality].

pub fn capture_cell_size(&self) -> f64[src]

Grid size used for real-time capture information on dynamic objects. Cannot be larger than [member bake_cell_size].

pub fn energy(&self) -> f64[src]

Multiplies the light sources' intensity by this value. For instance, if the value is set to 2, lights will be twice as bright. If the value is set to 0.5, lights will be half as bright.

pub fn extents(&self) -> Vector3D<f32, UnknownUnit>[src]

The size of the affected area.

pub fn image_path(&self) -> GodotString[src]

The location where lightmaps will be saved.

pub fn light_data(&self) -> Option<Ref<BakedLightmapData, Shared>>[src]

The calculated light data.

pub fn propagation(&self) -> f64[src]

Defines how far the light will travel before it is no longer effective. The higher the number, the farther the light will travel. For instance, if the value is set to 2, the light will go twice as far. If the value is set to 0.5, the light will only go half as far.

pub fn is_hdr(&self) -> bool[src]

If [code]true[/code], the lightmap can capture light values greater than [code]1.0[/code]. Turning this off will result in a smaller file size.

pub fn set_bake_cell_size(&self, bake_cell_size: f64)[src]

Grid subdivision size for lightmapper calculation. The default value will work for most cases. Increase for better lighting on small details or if your scene is very large.

pub fn set_bake_default_texels_per_unit(&self, texels: f64)[src]

If a [member Mesh.lightmap_size_hint] isn't specified, the lightmap baker will dynamically set the lightmap size using this value. This value is measured in texels per world unit. The maximum lightmap texture size is 4096x4096.

pub fn set_bake_mode(&self, bake_mode: i64)[src]

Lightmapping mode. See [enum BakeMode].

pub fn set_bake_quality(&self, bake_quality: i64)[src]

Three quality modes are available. Higher quality requires more rendering time. See [enum BakeQuality].

pub fn set_capture_cell_size(&self, capture_cell_size: f64)[src]

Grid size used for real-time capture information on dynamic objects. Cannot be larger than [member bake_cell_size].

pub fn set_energy(&self, energy: f64)[src]

Multiplies the light sources' intensity by this value. For instance, if the value is set to 2, lights will be twice as bright. If the value is set to 0.5, lights will be half as bright.

pub fn set_extents(&self, extents: Vector3D<f32, UnknownUnit>)[src]

The size of the affected area.

pub fn set_hdr(&self, hdr: bool)[src]

If [code]true[/code], the lightmap can capture light values greater than [code]1.0[/code]. Turning this off will result in a smaller file size.

pub fn set_image_path(&self, image_path: impl Into<GodotString>)[src]

The location where lightmaps will be saved.

pub fn set_light_data(&self, data: impl AsArg<BakedLightmapData>)[src]

The calculated light data.

pub fn set_propagation(&self, propagation: f64)[src]

Defines how far the light will travel before it is no longer effective. The higher the number, the farther the light will travel. For instance, if the value is set to 2, the light will go twice as far. If the value is set to 0.5, the light will only go half as far.

Methods from Deref<Target = VisualInstance>

pub fn get_aabb(&self) -> Aabb[src]

Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. See also [method get_transformed_aabb].

pub fn get_base(&self) -> Rid[src]

Returns the RID of the resource associated with this [VisualInstance]. For example, if the Node is a [MeshInstance], this will return the RID of the associated [Mesh].

pub fn get_instance(&self) -> Rid[src]

Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call [VisualServer] functions directly on this [VisualInstance].

pub fn layer_mask(&self) -> i64[src]

The render layer(s) this [VisualInstance] is drawn on.
			This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to.

pub fn get_layer_mask_bit(&self, layer: i64) -> bool[src]

Returns [code]true[/code] when the specified layer is enabled in [member layers] and [code]false[/code] otherwise.

pub fn get_transformed_aabb(&self) -> Aabb[src]

Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance].
				Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. See also [method get_aabb].

pub fn set_base(&self, base: Rid)[src]

Sets the resource that is instantiated by this [VisualInstance], which changes how the engine handles the [VisualInstance] under the hood. Equivalent to [method VisualServer.instance_set_base].

pub fn set_layer_mask(&self, mask: i64)[src]

The render layer(s) this [VisualInstance] is drawn on.
			This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to.

pub fn set_layer_mask_bit(&self, layer: i64, enabled: bool)[src]

Enables a particular layer in [member layers].

Trait Implementations

impl Debug for BakedLightmap[src]

impl Deref for BakedLightmap[src]

type Target = VisualInstance

The resulting type after dereferencing.

impl DerefMut for BakedLightmap[src]

impl GodotObject for BakedLightmap[src]

type RefKind = ManuallyManaged

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Instanciable for BakedLightmap[src]

impl QueueFree for BakedLightmap[src]

impl SubClass<Node> for BakedLightmap[src]

impl SubClass<Object> for BakedLightmap[src]

impl SubClass<Spatial> for BakedLightmap[src]

impl SubClass<VisualInstance> for BakedLightmap[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.