VisualInstance3D
Parent of all visual 3D nodes.
VisualInstance3D.swift:11class VisualInstance3D
The VisualInstance3D
is used to connect a resource to a visual representation. All visual 3D nodes inherit from the VisualInstance3D
. In general, you should not access the VisualInstance3D
properties directly as they are accessed and managed by the nodes that inherit from VisualInstance3D
. VisualInstance3D
is the node representation of the RenderingServer
instance.
Superclasses
class Node3D
Most basic 3D game object, parent of all 3D-related nodes.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var layers: UInt32
The render layer(s) this
VisualInstance3D
is drawn on.var sortingOffset: Double
The amount by which the depth of this
VisualInstance3D
will be adjusted when sorting by depth. Uses the same units as the engine (which are typically meters). Adjusting it to a higher value will make theVisualInstance3D
reliably draw on top of otherVisualInstance3D
s that are otherwise positioned at the same spot. To ensure it always draws on top of other objects around it (not positioned at the same spot), set the value to be greater than the distance between thisVisualInstance3D
and the other nearbyVisualInstance3D
s.var sortingUseAabbCenter: Bool
If
true
, the object is sorted based on theAABB
center. The object will be sorted based on the global position otherwise.func getAabb(
) -> AABB Returns the
AABB
(also known as the bounding box) for thisVisualInstance3D
.func getBase(
) -> RID Returns the RID of the resource associated with this
VisualInstance3D
. For example, if the Node is aMeshInstance3D
, this will return the RID of the associatedMesh
.func getInstance(
) -> RID Returns the RID of this instance. This RID is the same as the RID returned by
instanceCreate
. This RID is needed if you want to callRenderingServer
functions directly on thisVisualInstance3D
.func getLayerMaskValue(layerNumber: Int32
) -> Bool Returns whether or not the specified layer of the
layers
is enabled, given alayerNumber
between 1 and 20.func setBase(RID
) Sets the resource that is instantiated by this
VisualInstance3D
, which changes how the engine handles theVisualInstance3D
under the hood. Equivalent toinstanceSetBase(instance:base:)
.func setLayerMaskValue(layerNumber: Int32, value: Bool
) Based on
value
, enables or disables the specified layer in thelayers
, given alayerNumber
between 1 and 20.
Show implementation details (1)
Hide implementation details
Subclasses
class Decal
Node that projects a texture onto a
MeshInstance3D
.class FogVolume
A region that contributes to the default volumetric fog from the world environment.
class GPUParticlesAttractor3D
Abstract base class for 3D particle attractors.
class GPUParticlesCollision3D
Abstract base class for 3D particle collision shapes affecting
GPUParticles3D
nodes.class GeometryInstance3D
Base node for geometry-based visual instances.
class Light3D
Provides a base class for different kinds of light nodes.
class LightmapGI
Computes and stores baked lightmaps for fast global illumination.
class ReflectionProbe
Captures its surroundings to create fast, accurate reflections from a given point.
class RootMotionView
Editor-only helper for setting up root motion in
AnimationMixer
.class VisibleOnScreenNotifier3D
A box-shaped region of 3D space that detects whether it is visible on screen.
class VoxelGI
Real-time global illumination (GI) probe.