Skip to content

Arrow

Visual debug primitive representing a 3D arrow.

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() and oriented using SetDirection().

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()

Constructs an Arrow object.

cpp
Arrow::Arrow(const Parameters& params);
ParameterDescription
paramsArrow::Parameters

Factories preferred


Arrow::Create() auto

Creates a shared pointer to an Arrow object.

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

Types

Arrow::Parameters struct

Parameters for constructing an Arrow object.

ParameterDescription
direction Vector3Direction of the arrow.
origin Vector3Origin of the arrow.
color ColorColor of the arrow.
length floatLength of the arrow.

Functions

SetDirection() void

Sets the direction of the arrow.

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

SetOrigin() void

Sets the origin of the arrow.

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

Released under the MIT License.