Skip to content

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 &params)
ParameterDescription
paramsArrow::Parameters

Constructs an Arrow object.

Factories preferred


Arrow::Create() auto

cpp
static auto vglx::Arrow::Create(const Parameters &params)
ParameterDescription
paramsArrow::Parameters

Creates a shared pointer to an Arrow object.

Types

Arrow::Parameters struct

Parameters for constructing an Arrow object.

NameTypeDescription
colorColorColor of the arrow.
directionVector3Direction of the arrow.
lengthfloatLength of the arrow.
originVector3Origin of the arrow.

Functions

SetDirection() void

cpp
void vglx::Arrow::SetDirection(const Vector3 &direction)
ParameterDescription
directionDirection of the arrow.

Sets the direction of the arrow.

SetOrigin() void

cpp
void vglx::Arrow::SetOrigin(const Vector3 &origin)
ParameterDescription
originOrigin of the arrow.

Sets the origin of the arrow.

Released under the MIT License.