EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GPoint Class Reference

#include "gpoint.h"

Inheritance diagram for GPoint:
Collaboration diagram for GPoint:

Public Member Functions

 GPoint ()
 
 GPoint (Ga::GaFloat v)
 
 GPoint (const Ga::GaFloat *v)
 
 GPoint (Ga::GaFloat X, Ga::GaFloat Y, Ga::GaFloat Z)
 
 GPoint (const GPoint &oth)
 
 GPoint (const Ga::GaVec3 &oth)
 
void MakeRandomPointOnSphere (double radius)
 
void MakeRandomPointOnSphereLayer (double radiusInner, double radiusOuter)
 
- Public Member Functions inherited from Ga::GaVec3
 GaVec3 (const Parameter &oth)
 
GaExpInl GaVec3 ()
 
GaExpInl GaVec3 (GaFloat v)
 
GaExpInl GaVec3 (const GaFloat *v)
 
GaExpInl GaVec3 (GaFloat X, GaFloat Y, GaFloat Z)
 
GaExpInl GaVec3 (const GaVec3 &oth)
 
GaExpInl GaVec3 operator- (const GaVec3 &oth) const
 
GaExpInl GaVec3 operator* (GaFloat s) const
 
GaExpInl GaVec3 operator/ (GaFloat s) const
 
GaExpInl GaVec3 operator* (const GaVec3 &oth) const
 
GaExpInl GaVec3operator= (const GaVec3 &oth)
 
GaExpInl bool operator!= (const GaVec3 &oth) const
 
GaExpInl bool operator== (const GaVec3 &oth) const
 
GaExpInl GaVec3 operator+ (const GaVec3 &oth) const
 
GaExpInl GaVec3operator+= (const GaVec3 &oth)
 
GaExpInl GaVec3operator-= (const GaVec3 &oth)
 
GaExpInl GaVec3operator*= (GaFloat f)
 
GaExpInl GaVec3operator/= (GaFloat f)
 
GaExpInl GaVec3operator*= (const GaVec3 &oth)
 
GaExpInl GaVec3 crossProduct (const GaVec3 &oth) const
 
GaExpInl GaFloat dotProduct (const GaVec3 &oth) const
 
GaExpInl GaFloat lengthSquared () const
 
GaExpInl GaFloat length () const
 
GaExpInl GaFloat distance (const GaVec3 &oth) const
 
GaExpInl GaFloat normalize ()
 
GaFloat angle (float ax, float ay, float bx, float by)
 
GaExpInl GaFloat angle (const Ga::GaVec3 oth) const
 
GaVec3 slerp (Ga::GaVec3 v0, Ga::GaVec3 v1, double t)
 
GaExpInl bool isZero () const
 
GaExpInl bool isNotZero () const
 
GaExpInl bool isNaN () const
 
GaExpInl bool isInf () const
 
GaVec3 rotationTo (const Ga::GaVec3 &pos) const
 
GaVec3operator= (const Parameter &oth)
 

Additional Inherited Members

- Public Attributes inherited from Ga::GaVec3
GaFloat x
 
GaFloat y
 
GaFloat z
 

Detailed Description

Definition at line 33 of file gpoint.h.

Constructor & Destructor Documentation

GPoint::GPoint ( )
inline

Definition at line 35 of file gpoint.h.

35 :Ga::GaVec3(){}
GPoint::GPoint ( Ga::GaFloat  v)
inline

Definition at line 36 of file gpoint.h.

36 :Ga::GaVec3(v){}
GPoint::GPoint ( const Ga::GaFloat v)
inline

Definition at line 37 of file gpoint.h.

37 :Ga::GaVec3(v){}
GPoint::GPoint ( Ga::GaFloat  X,
Ga::GaFloat  Y,
Ga::GaFloat  Z 
)
inline

Definition at line 38 of file gpoint.h.

38 :Ga::GaVec3(X, Y, Z){}
GPoint::GPoint ( const GPoint oth)
inline

Definition at line 39 of file gpoint.h.

39 :Ga::GaVec3(oth){}
GPoint::GPoint ( const Ga::GaVec3 oth)
inline

Definition at line 40 of file gpoint.h.

40 :Ga::GaVec3(oth){}

Member Function Documentation

void GPoint::MakeRandomPointOnSphere ( double  radius)
inline

Definition at line 46 of file gpoint.h.

References MakeRandomFloat(), Ga::GaVec3::x, Ga::GaVec3::y, and Ga::GaVec3::z.

Referenced by Command_spawn(), Command_spawnn(), Command_tr(), CynoModule::CreateCyno(), Client::Eject(), ShipSE::Killed(), Colony::LaunchCommodities(), ShipSE::LaunchDrone(), ActiveModule::LaunchProbe(), and SpawnMgr::MakeSpawn().

47  {
48  double theta = MakeRandomFloat( 0.0, (2*M_PI) );
49  double phi = MakeRandomFloat( 0.0, (2*M_PI) );
50  x += radius * sin(theta) * cos(phi);
51  z += radius * sin(theta) * sin(phi);
52  y += radius * cos(theta);
53  }
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
Definition: misc.cpp:114
GaFloat x
Definition: GaTypes.h:207
GaFloat y
Definition: GaTypes.h:207
GaFloat z
Definition: GaTypes.h:207

Here is the call graph for this function:

Here is the caller graph for this function:

void GPoint::MakeRandomPointOnSphereLayer ( double  radiusInner,
double  radiusOuter 
)
inline

Definition at line 59 of file gpoint.h.

References MakeRandomFloat(), Ga::GaVec3::x, Ga::GaVec3::y, and Ga::GaVec3::z.

Referenced by Client::CynoJump(), SystemGPoint::GetAnomalyPoint(), and Client::StargateJump().

60  {
61  double theta = MakeRandomFloat( 0.0, (2*M_PI) );
62  double phi = MakeRandomFloat( 0.0, (2*M_PI) );
63  double intermediateRadius = MakeRandomFloat( radiusInner, radiusOuter );
64  x += intermediateRadius * sin(theta) * cos(phi);
65  z += intermediateRadius * sin(theta) * sin(phi);
66  y += intermediateRadius * cos(theta);
67  }
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
Definition: misc.cpp:114
GaFloat x
Definition: GaTypes.h:207
GaFloat y
Definition: GaTypes.h:207
GaFloat z
Definition: GaTypes.h:207

Here is the call graph for this function:

Here is the caller graph for this function:


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