raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
raylib::Vector3 Class Reference

Vector3 type. More...

Public Member Functions

 Vector3 (::Color color)
 
 Vector3 (const ::Vector3 &vec)
 
 Vector3 (float x)
 
 Vector3 (float x, float y)
 
 Vector3 (float x, float y, float z)
 
Vector3 Add (const ::Vector3 &vector3) const
 Add two vectors.
 
Vector3 Barycenter (const ::Vector3 &a, const ::Vector3 &b, const ::Vector3 &c) const
 
bool CheckCollision (float radius1, const ::Vector3 &center2, float radius2) const
 Detect collision between two spheres.
 
Vector3 CrossProduct (const ::Vector3 &vector3) const
 
float Distance (const ::Vector3 &vector3) const
 
Vector3 Divide (const ::Vector3 &vector3) const
 Divide vector by vector.
 
Vector3 Divide (const float div) const
 Divide a vector by a value.
 
float DotProduct (const ::Vector3 &vector3) const
 
void DrawCircle3D (float radius, const ::Vector3 &rotationAxis, float rotationAngle, Color color) const
 
void DrawCube (const ::Vector3 &size, ::Color color) const
 
void DrawCube (float width, float height, float length, ::Color color) const
 
void DrawCubeWires (const ::Vector3 &size, ::Color color) const
 
void DrawCubeWires (float width, float height, float length, ::Color color) const
 
void DrawCylinder (float radiusTop, float radiusBottom, float height, int slices, ::Color color) const
 
void DrawCylinderWires (float radiusTop, float radiusBottom, float height, int slices, ::Color color) const
 
void DrawLine3D (const ::Vector3 &endPos, ::Color color) const
 
void DrawPlane (const ::Vector2 &size, ::Color color) const
 
void DrawPoint3D (::Color color) const
 
void DrawSphere (float radius, ::Color color) const
 
void DrawSphere (float radius, int rings, int slices, ::Color color) const
 
void DrawSphereWires (float radius, int rings, int slices, ::Color color) const
 
float GetX () const
 Retrieves the x value for the object. More...
 
float GetY () const
 Retrieves the y value for the object. More...
 
float GetZ () const
 Retrieves the z value for the object. More...
 
float Length () const
 Calculate vector length.
 
float LengthSqr () const
 Calculate vector square length.
 
Vector3 Lerp (const ::Vector3 &vector3, const float amount) const
 
Vector3 Max (const ::Vector3 &vector3) const
 
Vector3 Min (const ::Vector3 &vector3) const
 
Vector3 Multiply (const ::Vector3 &vector3) const
 Multiply vector by vector.
 
Vector3 Negate () const
 Negate provided vector (invert direction)
 
Vector3 Normalize () const
 
 operator std::string () const
 
bool operator!= (const ::Vector3 &other) const
 
Vector3 operator* (const ::Vector3 &vector3) const
 Multiply vector by vector.
 
Vector3 operator* (const float scaler) const
 Multiply vector by scalar.
 
Vector3operator*= (const ::Vector3 &vector3)
 Multiply vector by vector.
 
Vector3operator*= (const float scaler)
 Multiply vector by scalar.
 
Vector3 operator+ (const ::Vector3 &vector3) const
 Add two vectors.
 
Vector3operator+= (const ::Vector3 &vector3)
 
Vector3 operator- () const
 Negate provided vector (invert direction)
 
Vector3 operator- (const ::Vector3 &vector3) const
 Subtract two vectors.
 
Vector3operator-= (const ::Vector3 &vector3)
 
Vector3 operator/ (const ::Vector3 &vector3) const
 Divide vector by vector.
 
Vector3 operator/ (const float div) const
 Divide a vector by a value.
 
Vector3operator/= (const ::Vector3 &vector3)
 Divide vector by vector.
 
Vector3operator/= (const float div)
 Divide a vector by a value.
 
Vector3operator= (const ::Vector3 &vector3)
 
bool operator== (const ::Vector3 &other) const
 
void OrthoNormalize (::Vector3 *vector3)
 
Vector3 Perpendicular () const
 
Vector3 Project (const ::Vector3 &vector3) const
 
Vector3 Reflect (const ::Vector3 &normal) const
 
Vector3 Reject (const ::Vector3 &vector3) const
 
Vector3 RotateByQuaternion (const ::Quaternion &quaternion) const
 
Vector3 Scale (const float scaler) const
 Multiply vector by scalar.
 
void SetX (float value)
 Sets the x value for the object. More...
 
void SetY (float value)
 Sets the y value for the object. More...
 
void SetZ (float value)
 Sets the z value for the object. More...
 
Vector3 Subtract (const ::Vector3 &vector3) const
 Subtract two vectors.
 
std::string ToString () const
 
Vector3 Transform (const ::Matrix &matrix) const
 

Static Public Member Functions

static Vector3 One ()
 
static Vector3 Zero ()
 

Protected Member Functions

void set (const ::Vector3 &vec)
 

Detailed Description

Vector3 type.

Definition at line 18 of file Vector3.hpp.

Member Function Documentation

◆ GetX()

float raylib::Vector3::GetX ( ) const
inline

Retrieves the x value for the object.

Returns
The x value of the object.

Definition at line 29 of file Vector3.hpp.

◆ GetY()

float raylib::Vector3::GetY ( ) const
inline

Retrieves the y value for the object.

Returns
The y value of the object.

Definition at line 30 of file Vector3.hpp.

◆ GetZ()

float raylib::Vector3::GetZ ( ) const
inline

Retrieves the z value for the object.

Returns
The z value of the object.

Definition at line 31 of file Vector3.hpp.

◆ SetX()

void raylib::Vector3::SetX ( float  value)
inline

Sets the x value for the object.

Parameters
valueThe value of which to set x to.

Definition at line 29 of file Vector3.hpp.

◆ SetY()

void raylib::Vector3::SetY ( float  value)
inline

Sets the y value for the object.

Parameters
valueThe value of which to set y to.

Definition at line 30 of file Vector3.hpp.

◆ SetZ()

void raylib::Vector3::SetZ ( float  value)
inline

Sets the z value for the object.

Parameters
valueThe value of which to set z to.

Definition at line 31 of file Vector3.hpp.