Arrow
Visual debug primitive representing a 3D directional arrow.
Arrow is a lightweight scene node used for debugging spatial relationships: normals, force vectors, light directions, coordinate axes, or any vector-based visualization. The arrow is defined by an origin point, a direction, a length, and a color. Its geometry is generated automatically and updates whenever the direction or origin is changed.
cpp
my_scene->Add(vglx::Arrow::Create({
.direction = {1.0f, 0.0f, 0.0f},
.origin = Vector3::Zero(),
.color = 0xFF0000,
.length = 1.0f
}));INFO
Derives from Node and inherits all public properties and methods.
Construction
Constructors
Arrow()
Constructs an arrow node from the given parameters.
cpp
Arrow::Arrow(const Parameters& params);| Parameter | Description |
|---|---|
| params | Initialization parameters for constructing the arrow. |
Factories preferred
Creates an instance of Arrow.
cpp
static std::unique_ptr<Arrow> Arrow::Create(const Parameters& params);| Parameter | Description |
|---|---|
| params | Initialization parameters for constructing the arrow. |
Types
Arrow::Parameters struct
Functions
SetDirection() void
Updates the direction of the arrow.
Automatically recalculates the internal transform so the arrow points in the new direction.
cpp
void Arrow::SetDirection(const Vector3& direction);| Parameter | Description |
|---|---|
| direction | New direction vector. |
SetOrigin() void
Updates the origin of the arrow.
Moves the base of the arrow to the given world-space point.
cpp
void Arrow::SetOrigin(const Vector3& origin);| Parameter | Description |
|---|---|
| origin | New origin position. |