Arrow
Visual debug primitive representing a 3D arrow.
[Arrow](/reference/nodes/arrow)
is a scene node that renders a directional arrow from a given origin, primarily used for debugging, orientation helpers, or coordinate indicators. It is constructed from a shaft and cone head, scaled based on the provided length.
The arrow can be positioned using [SetOrigin()](/reference/nodes/arrow#function-set-origin-e0ea630a)
and oriented using [SetDirection()](/reference/nodes/arrow#function-set-direction-84392a1f)
.
cpp
auto arrow = vglx::Arrow::Create({
.direction = {1.0f, 0.0f, 0.0f},
.origin = Vector3::Zero(),
.color = 0xFF0000,
.length = 1.0f
});
scene->Add(arrow);
INFO
Derives from Node and inherits all public properties and methods.
Construction
Constructors
Arrow()
cpp
vglx::Arrow::Arrow(const Parameters ¶ms)
Parameter | Description |
---|---|
params | Arrow::Parameters |
Constructs an Arrow object.
Factories preferred
Arrow::Create() auto
cpp
static auto vglx::Arrow::Create(const Parameters ¶ms)
Parameter | Description |
---|---|
params | Arrow::Parameters |
Creates a shared pointer to an Arrow object.
Types
Arrow::Parameters struct
Parameters for constructing an Arrow object.
Name | Type | Description |
---|---|---|
color | Color | Color of the arrow. |
direction | Vector3 | Direction of the arrow. |
length | float | Length of the arrow. |
origin | Vector3 | Origin of the arrow. |
Functions
SetDirection() void
cpp
void vglx::Arrow::SetDirection(const Vector3 &direction)
Parameter | Description |
---|---|
direction | Direction of the arrow. |
Sets the direction of the arrow.
SetOrigin() void
cpp
void vglx::Arrow::SetOrigin(const Vector3 &origin)
Parameter | Description |
---|---|
origin | Origin of the arrow. |
Sets the origin of the arrow.