GeometryInstance

Refreshing Cache...

Inherits: VisualInstance < Spatial < Node < Object

Inherited By: CPUParticles, CSGShape, ImmediateGeometry, MeshInstance, MultiMeshInstance, Particles, SpriteBase3D

Base node for geometry-based visual instances.

Description

Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.

Methods

boolget_flag ( Flags flag ) const
voidset_custom_aabb ( AABB aabb )
voidset_flag ( Flags flag, bool value )

Enumerations

enum ShadowCastingSetting:

  • SHADOW_CASTING_SETTING_OFF = 0 — Will not cast any shadows.
  • SHADOW_CASTING_SETTING_ON = 1 — Will cast shadows from all visible faces in the GeometryInstance.

Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.

  • SHADOW_CASTING_SETTING_DOUBLE_SIDED = 2 — Will cast shadows from all visible faces in the GeometryInstance.

Will not take culling into account, so all faces will be taken into account when shadow casting.

  • SHADOW_CASTING_SETTING_SHADOWS_ONLY = 3 — Will only show the shadows casted from this object.

In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.


enum Flags:

  • FLAG_USE_BAKED_LIGHT = 0 — Will allow the GeometryInstance to be used when baking lights using a GIProbe or BakedLightmap.
  • FLAG_DRAW_NEXT_FRAME_IF_VISIBLE = 1 — Unused in this class, exposed for consistency with InstanceFlags.
  • FLAG_MAX = 2 — Represents the size of the Flags enum.

Property Descriptions

Default1
Setterset_cast_shadows_setting(value)
Getterget_cast_shadows_setting()

The selected shadow casting flag. See ShadowCastingSetting for possible values.


Default0.0
Setterset_extra_cull_margin(value)
Getterget_extra_cull_margin()

The extra distance added to the GeometryInstance’s bounding box (AABB) to increase its cull box.


Default0.0
Setterset_lod_max_distance(value)
Getterget_lod_max_distance()

The GeometryInstance’s max LOD distance.

Note: This property currently has no effect.


Default0.0
Setterset_lod_max_hysteresis(value)
Getterget_lod_max_hysteresis()

The GeometryInstance’s max LOD margin.

Note: This property currently has no effect.


Default0.0
Setterset_lod_min_distance(value)
Getterget_lod_min_distance()

The GeometryInstance’s min LOD distance.

Note: This property currently has no effect.


Default0.0
Setterset_lod_min_hysteresis(value)
Getterget_lod_min_hysteresis()

The GeometryInstance’s min LOD margin.

Note: This property currently has no effect.


Setterset_material_override(value)
Getterget_material_override()

The material override for the whole geometry.

If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.


  • bool use_in_baked_light
Defaultfalse
Setterset_flag(value)
Getterget_flag()

If true, this GeometryInstance will be used when baking lights using a GIProbe or BakedLightmap.

Method Descriptions

Returns the Flags that have been set for this object.


  • void set_custom_aabb ( AABB aabb )

Overrides the bounding box of this node with a custom one. To remove it, set an AABB with all fields set to zero.


Sets the Flags specified. See Flags for options.

doradoro's advice! Getters and Setters will be deprecated! Avoid their use!

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:32:21. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.