VisualInstance.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. </return>
  15. <description>
  16. Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. See also [method get_transformed_aabb].
  17. </description>
  18. </method>
  19. <method name="get_base" qualifiers="const">
  20. <return type="RID">
  21. </return>
  22. <description>
  23. 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].
  24. </description>
  25. </method>
  26. <method name="get_instance" qualifiers="const">
  27. <return type="RID">
  28. </return>
  29. <description>
  30. 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].
  31. </description>
  32. </method>
  33. <method name="get_layer_mask_bit" qualifiers="const">
  34. <return type="bool">
  35. </return>
  36. <argument index="0" name="layer" type="int">
  37. </argument>
  38. <description>
  39. Returns [code]true[/code] when the specified layer is enabled in [member layers] and [code]false[/code] otherwise.
  40. </description>
  41. </method>
  42. <method name="get_transformed_aabb" qualifiers="const">
  43. <return type="AABB">
  44. </return>
  45. <description>
  46. Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance].
  47. Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. See also [method get_aabb].
  48. </description>
  49. </method>
  50. <method name="set_base">
  51. <return type="void">
  52. </return>
  53. <argument index="0" name="base" type="RID">
  54. </argument>
  55. <description>
  56. 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].
  57. </description>
  58. </method>
  59. <method name="set_layer_mask_bit">
  60. <return type="void">
  61. </return>
  62. <argument index="0" name="layer" type="int">
  63. </argument>
  64. <argument index="1" name="enabled" type="bool">
  65. </argument>
  66. <description>
  67. Enables a particular layer in [member layers].
  68. </description>
  69. </method>
  70. </methods>
  71. <members>
  72. <member name="layers" type="int" setter="set_layer_mask" getter="get_layer_mask" default="1">
  73. The render layer(s) this [VisualInstance] is drawn on.
  74. This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to.
  75. </member>
  76. </members>
  77. <constants>
  78. </constants>
  79. </class>