Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
Vector Class Reference

#include <vector.h>

Public Member Functions

 Vector (void)
 
 Vector (const Vector &v)
 
 Vector (float _x, float _y=0.f, float _z=0.f)
 
virtual ~Vector ()
 
Vectoroperator= (const Vector &v)
 
Vectoroperator= (const float &f)
 
Vector operator- (const Vector &v)
 
Vector operator+ (const Vector &v)
 
Vector operator* (float scalar)
 
Vectoroperator/ (float scalar)
 
bool operator< (const Vector &v)
 
bool operator<= (const Vector &v)
 
bool operator> (const Vector &v)
 
bool operator>= (const Vector &v)
 
Vectoroperator-= (const Vector &v)
 
Vectoroperator-= (float scalar)
 
Vectoroperator+= (const Vector &v)
 
Vectoroperator+= (float scalar)
 
Vectoroperator*= (float scalar)
 
Vectoroperator/= (float scalar)
 
Vector operator- ()
 
bool operator== (const Vector &v)
 
bool operator!= (const Vector &v)
 
SDL_FPoint ToFPoint () const
 
SDL_Point ToPoint () const
 
ImVec2 ToImVec2 () const
 
float Norm () const
 
float operator^ (const Vector &V) const
 
float operator* (const Vector &V) const
 
VectorNormalize ()
 
float Length () const
 
float Magnitude () const
 
bool bIsNull (void)
 
float Dist (Vector &)
 
float sqrDist (Vector &)
 
VectorSet (float _x, float _y, float _z)
 
float Angle (const Vector &xE)
 
VectorRotate (float angle)
 
VectorScale (const Vector &_v)
 
VectorScale (const float _x, float _y, float _z)
 
void Clamp (const Vector &min, const Vector &max)
 
Vector Blend (Vector &_vDdest, float _ffactor)
 

Static Public Member Functions

static Vector FromImVec2 (const ImVec2 &v)
 

Public Attributes

float x
 
float y
 
float z
 

Friends

ostreamoperator<< (ostream &os, const Vector &v)
 

Detailed Description

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h, and /home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 23 of file vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/3]

Vector::Vector ( void  )
inline

Definition at line 28 of file vector.h.

References x, y, and z.

Referenced by operator*(), operator+(), operator-(), and operator-().

+ Here is the caller graph for this function:

◆ Vector() [2/3]

Vector::Vector ( const Vector v)
inline

Definition at line 29 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ Vector() [3/3]

Vector::Vector ( float  _x,
float  _y = 0.f,
float  _z = 0.f 
)
inline

Definition at line 30 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ ~Vector()

virtual Vector::~Vector ( )
inlinevirtual

Definition at line 31 of file vector.h.

Member Function Documentation

◆ Angle()

float Vector::Angle ( const Vector xE)
inline

Definition at line 82 of file vector.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ bIsNull()

bool Vector::bIsNull ( void  )
inline

Definition at line 76 of file vector.h.

References x, y, and z.

◆ Blend()

Vector Vector::Blend ( Vector _vDdest,
float  _ffactor 
)
inline

Definition at line 126 of file vector.h.

References GetComponentTypeID_Static(), and vBlend().

+ Here is the call graph for this function:

◆ Clamp()

void Vector::Clamp ( const Vector min,
const Vector max 
)
inline

Definition at line 119 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ Dist()

float Vector::Dist ( Vector v)
inline

Definition at line 12 of file vector.cpp.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ FromImVec2()

static Vector Vector::FromImVec2 ( const ImVec2 v)
inlinestatic

◆ Length()

float Vector::Length ( ) const
inline

Definition at line 73 of file vector.h.

References Norm().

Referenced by NavigationSystem::FollowPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Magnitude()

float Vector::Magnitude ( ) const
inline

Definition at line 74 of file vector.h.

References Norm().

Referenced by ExecuteBTAction(), ExecuteBTCondition(), AIPerceptionSystem::IsTargetVisible(), AIPerceptionSystem::Process(), and AIMotionSystem::Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Norm()

float Vector::Norm ( ) const
inline

Definition at line 66 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

Referenced by Length(), Magnitude(), and Normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Normalize()

Vector & Vector::Normalize ( )
inline

Definition at line 72 of file vector.h.

References GetComponentTypeID_Static(), Norm(), x, y, and z.

Referenced by NavigationSystem::FollowPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator!=()

bool Vector::operator!= ( const Vector v)
inline

Definition at line 57 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator*() [1/2]

float Vector::operator* ( const Vector V) const
inline

Definition at line 69 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator*() [2/2]

Vector Vector::operator* ( float  scalar)
inline

Definition at line 39 of file vector.h.

References GetComponentTypeID_Static(), Vector(), x, y, and z.

+ Here is the call graph for this function:

◆ operator*=()

Vector & Vector::operator*= ( float  scalar)
inline

Definition at line 51 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator+()

Vector Vector::operator+ ( const Vector v)
inline

Definition at line 38 of file vector.h.

References GetComponentTypeID_Static(), Vector(), x, y, and z.

+ Here is the call graph for this function:

◆ operator+=() [1/2]

Vector & Vector::operator+= ( const Vector v)
inline

Definition at line 49 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator+=() [2/2]

Vector & Vector::operator+= ( float  scalar)
inline

Definition at line 50 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator-() [1/2]

Vector Vector::operator- ( )
inline

Definition at line 55 of file vector.h.

References Vector(), x, y, and z.

+ Here is the call graph for this function:

◆ operator-() [2/2]

Vector Vector::operator- ( const Vector v)
inline

Definition at line 37 of file vector.h.

References GetComponentTypeID_Static(), Vector(), x, y, and z.

+ Here is the call graph for this function:

◆ operator-=() [1/2]

Vector & Vector::operator-= ( const Vector v)
inline

Definition at line 47 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator-=() [2/2]

Vector & Vector::operator-= ( float  scalar)
inline

Definition at line 48 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator/()

Vector & Vector::operator/ ( float  scalar)
inline

Definition at line 40 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator/=()

Vector & Vector::operator/= ( float  scalar)
inline

Definition at line 52 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator<()

bool Vector::operator< ( const Vector v)

Definition at line 53 of file vector.cpp.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator<=()

bool Vector::operator<= ( const Vector v)

Definition at line 58 of file vector.cpp.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator=() [1/2]

Vector & Vector::operator= ( const float f)
inline

Definition at line 36 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator=() [2/2]

Vector & Vector::operator= ( const Vector v)
inline

Definition at line 35 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator==()

bool Vector::operator== ( const Vector v)
inline

Definition at line 56 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator>()

bool Vector::operator> ( const Vector v)

Definition at line 63 of file vector.cpp.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator>=()

bool Vector::operator>= ( const Vector v)

Definition at line 68 of file vector.cpp.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ operator^()

float Vector::operator^ ( const Vector V) const
inline

Definition at line 67 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ Rotate()

Vector & Vector::Rotate ( float  angle)
inline

Definition at line 93 of file vector.h.

References GetComponentTypeID_Static(), x, and y.

+ Here is the call graph for this function:

◆ Scale() [1/2]

Vector & Vector::Scale ( const float  _x,
float  _y,
float  _z 
)
inline

Definition at line 110 of file vector.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ Scale() [2/2]

Vector & Vector::Scale ( const Vector _v)
inline

Definition at line 102 of file vector.h.

References GetComponentTypeID_Static(), and x.

+ Here is the call graph for this function:

◆ Set()

Vector & Vector::Set ( float  _x,
float  _y,
float  _z 
)
inline

Definition at line 80 of file vector.h.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ sqrDist()

float Vector::sqrDist ( Vector v)
inline

Definition at line 24 of file vector.cpp.

References GetComponentTypeID_Static(), x, y, and z.

+ Here is the call graph for this function:

◆ ToFPoint()

SDL_FPoint Vector::ToFPoint ( ) const
inline

Definition at line 59 of file vector.h.

References GetComponentTypeID_Static(), x, and y.

Referenced by Draw_FilledHexagon(), and Draw_FilledTriangle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToImVec2()

ImVec2 Vector::ToImVec2 ( ) const
inline

◆ ToPoint()

SDL_Point Vector::ToPoint ( ) const
inline

Definition at line 60 of file vector.h.

References GetComponentTypeID_Static(), x, and y.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

ostream & operator<< ( ostream os,
const Vector v 
)
friend

Definition at line 48 of file vector.cpp.

Member Data Documentation

◆ x

float Vector::x

Definition at line 27 of file vector.h.

Referenced by ComponentParameter::AsString(), bIsNull(), Clamp(), Dist(), Olympe::BTGraphLayoutEngine::DoNodesOverlap(), Draw_Text(), GridSystem::DrawFilledRectWorld(), GridSystem::DrawLineWorld(), AIEvents::EmitExplosion(), AIEvents::EmitNoise(), NavigationSystem::FollowPath(), OlympeEffectSystem::Initialize(), Olympe::Tiled::IsometricProjection::IsoToWorld(), GameObject::Load(), Norm(), Normalize(), CameraSystem::OnEvent(), operator!=(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator=(), operator==(), operator>(), operator>=(), operator^(), CameraSystem::ProcessKeyboardInput(), Olympe::BTGraphLayoutEngine::PushNodeApart(), GameObject::Render(), RenderingEditorSystem::Render(), OlympeEffectSystem::Render(), RenderEntitiesForCamera(), GridSystem::RenderNavigationOverlay(), Olympe::Editor::TilemapEditorApp::RenderPropertiesPanel(), RenderSingleEntity(), RenderTileImmediate(), Olympe::BTGraphLayoutEngine::ResolveCollisions(), Rotate(), GameObject::Save(), Scale(), Olympe::Tiled::IsometricProjection::ScreenToTile(), CameraTransform::ScreenToWorld(), Olympe::Rendering::IsometricRenderer::ScreenToWorld(), Set(), sqrDist(), ToFPoint(), ToPoint(), OlympeEffectSystem::Implementation::UpdateOrbs(), VisualSprite_data::UpdateRect(), VisualEditor_data::UpdateRect(), Vector(), Vector(), Vector(), vNormal(), Olympe::Tiled::IsometricProjection::WorldToIso(), CameraTransform::WorldToScreen(), and Olympe::Rendering::IsometricRenderer::WorldToScreen().

◆ y

float Vector::y

◆ z

float Vector::z

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