VisualInstance.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisualInstance" inherits="CullInstance" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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. <member name="sorting_offset" type="float" setter="set_sorting_offset" getter="get_sorting_offset" default="0.0">
  66. The sorting offset used by this [VisualInstance]. Adjusting it to a higher value will make the [VisualInstance] reliably draw on top of other [VisualInstance]s that are otherwise positioned at the same spot.
  67. </member>
  68. <member name="sorting_use_aabb_center" type="bool" setter="set_sorting_use_aabb_center" getter="is_sorting_use_aabb_center" default="true">
  69. If [code]true[/code], the object is sorted based on the [AABB] center. Sorted based on the global position otherwise.
  70. The [AABB] center based sorting is generally more accurate for 3D models. The position based sorting instead allows to better control the drawing order when working with [Particles] and [CPUParticles].
  71. </member>
  72. </members>
  73. <constants>
  74. </constants>
  75. </class>