VisualInstance.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisualInstance" inherits="Spatial" version="3.3">
  3. <brief_description>
  4. Parent of all visual 3D nodes.
  5. </brief_description>
  6. <description>
  7. The [VisualInstance] is used to connect a resource to a visual representation. All visual 3D nodes inherit from the [VisualInstance]. In general, you should not access the [VisualInstance] properties directly as they are accessed and managed by the nodes that inherit from [VisualInstance]. [VisualInstance] is the node representation of the [VisualServer] instance.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_aabb" qualifiers="const">
  13. <return type="AABB" />
  14. <description>
  15. Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. See also [method get_transformed_aabb].
  16. </description>
  17. </method>
  18. <method name="get_base" qualifiers="const">
  19. <return type="RID" />
  20. <description>
  21. 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].
  22. </description>
  23. </method>
  24. <method name="get_instance" qualifiers="const">
  25. <return type="RID" />
  26. <description>
  27. 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].
  28. </description>
  29. </method>
  30. <method name="get_layer_mask_bit" qualifiers="const">
  31. <return type="bool" />
  32. <argument index="0" name="layer" type="int" />
  33. <description>
  34. Returns [code]true[/code] when the specified layer is enabled in [member layers] and [code]false[/code] otherwise.
  35. </description>
  36. </method>
  37. <method name="get_transformed_aabb" qualifiers="const">
  38. <return type="AABB" />
  39. <description>
  40. Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance].
  41. Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. See also [method get_aabb].
  42. </description>
  43. </method>
  44. <method name="set_base">
  45. <return type="void" />
  46. <argument index="0" name="base" type="RID" />
  47. <description>
  48. 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].
  49. </description>
  50. </method>
  51. <method name="set_layer_mask_bit">
  52. <return type="void" />
  53. <argument index="0" name="layer" type="int" />
  54. <argument index="1" name="enabled" type="bool" />
  55. <description>
  56. Enables a particular layer in [member layers].
  57. </description>
  58. </method>
  59. </methods>
  60. <members>
  61. <member name="layers" type="int" setter="set_layer_mask" getter="get_layer_mask" default="1">
  62. The render layer(s) this [VisualInstance] is drawn on.
  63. This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to.
  64. </member>
  65. </members>
  66. <constants>
  67. </constants>
  68. </class>