Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::LineSegment Class Reference

LineSegment defined by two Vector3, an start and a end. More...

#include <LineSegment.h>

Public Member Functions

 AZ_TYPE_INFO (LineSegment, "{7557da1e-cc20-11ec-9d64-0242ac120002}")
 
 LineSegment ()=default
 Default constructor, Creates an empty LineSegment at the origin with a length of 0.
 
 LineSegment (const AZ::Vector3 &start, const AZ::Vector3 &end)
 Create a LineSegment with a start and an end.
 
const AZ::Vector3GetStart () const
 
const AZ::Vector3GetEnd () const
 
AZ::Vector3 GetDifference () const
 
AZ::Vector3 GetPoint (float t) const
 

Static Public Member Functions

static LineSegment CreateFromRayAndLength (const Ray &segment, float length)
 

Detailed Description

LineSegment defined by two Vector3, an start and a end.

Member Function Documentation

◆ CreateFromRayAndLength()

static LineSegment AZ::LineSegment::CreateFromRayAndLength ( const Ray segment,
float  length 
)
static

Create a LineSegment from a ray where origin is the start and the length defines the end of the LineSegment given the direction of the Ray.

◆ GetDifference()

AZ::Vector3 AZ::LineSegment::GetDifference ( ) const

The difference between the end the the start.

Returns
Direction and mangitude of the LineSegment.

◆ GetPoint()

AZ::Vector3 AZ::LineSegment::GetPoint ( float  t) const

Returns the point along the segment from start to end -range [0, 1].

Parameters
tfraction/proportion/percentage along the LineSegment.
Returns
The Position give the fraction t.

The documentation for this class was generated from the following file: