My Project
 
Loading...
Searching...
No Matches
Vector3 Class Reference

#include <Quaternion.h>

Public Member Functions

 Vector3 (float x_, float y_, float z_)
 
Vector3 operator+ (Vector3 vt)
 
Vector3 operator+ (float nt)
 
Vector3 operator- (Vector3 vt)
 
Vector3 operator- (float nt)
 
Vector3 operator+= (Vector3 vt)
 
Vector3 operator+= (float nt)
 
Vector3 operator-= (Vector3 vt)
 
Vector3 operator-= (float nt)
 
Vector3 operator* (Vector3 vt)
 
Vector3 operator* (float nt)
 
Vector3 operator/ (Vector3 vt)
 
Vector3 operator/ (float nt)
 
Vector3 operator*= (Vector3 vt)
 
Vector3 operator*= (float nt)
 
Vector3 operator/= (Vector3 vt)
 
Vector3 operator/= (float nt)
 
Vector3 normalize ()
 
float get_magnitude ()
 
float dot_product (Vector3 vt)
 
Vector3 cross_product (Vector3 vt)
 
float angle_between_vectors (Vector3 vt)
 
Vector3 rad_to_deg ()
 
Vector3 deg_to_rad ()
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

Class to perform 3 dimensional vector math, also used for quaternions

x - y - z components

X Roll Y Pitch Z Yaw

Member Function Documentation

◆ angle_between_vectors()

float Vector3::angle_between_vectors ( Vector3 vt)

Returns the angle between the two vectors

Parameters
vtOther vector
Returns
Angle between the vectors

◆ cross_product()

Vector3 Vector3::cross_product ( Vector3 vt)

Cross product of this vector and another vector vt (v_this x v_other)

Parameters
vtOther vector to calculate cross product with
Returns
Result of cross product

◆ deg_to_rad()

Vector3 Vector3::deg_to_rad ( )

Returns conversion of Vector3 xyz degree components to radians

Returns
Converted Vector3

◆ dot_product()

float Vector3::dot_product ( Vector3 vt)

Dot product of this vector and another vector vt

Parameters
vtOther vector to calculate dot product with
Returns
Result of dot product

◆ get_magnitude()

float Vector3::get_magnitude ( )

Returns length of Vector3

Returns
Length of Vector3

◆ normalize()

Vector3 Vector3::normalize ( )

Returns normalized vector (scales length to 1) if its length is not zero

Returns
Normalized vector

◆ rad_to_deg()

Vector3 Vector3::rad_to_deg ( )

Returns conversion of Vector3 xyz radian components to degrees

Returns
Converted Vector3

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