GR Engine
A physics engine in curved space-time
 All Classes Files Functions Variables
Public Member Functions | List of all members
Entity Class Reference

Class representing an entity with defined position and local basis, consisting of 4-velocity and 3 spatial directions. More...

#include <entity.h>

Inheritance diagram for Entity:
Particle DiffEq

Public Member Functions

 Entity (Manifold *_m, Point _p, vector4 _u, vector4 _x, vector4 _y, vector4 _z)
 Constructor. More...
 
 ~Entity ()
 Destructor.
 
vector4 getStateVector (int i)
 Returns a component of the local basis. More...
 
vector4 getX ()
 Returns the local X direction.
 
vector4 getY ()
 Returns the local Y direction.
 
vector4 getZ ()
 Returns the local Z direction.
 
StateVector derivative (StateVector v)
 Overloaded method from DiffEq. More...
 
void setCoordSystem (int)
 Overloaded method changing the coordinate system in use.
 
void setPosVel (Point, vector4)
 Changes the position and 4-velocity. More...
 
void setVel (vector4)
 Changes the 4-velocity. More...
 
void applyForce (double x, double y, double z)
 Adds an acceleration to the entity. More...
 
void applyAngVel (double x, double y, double z)
 Adds angular velocity to the entity. More...
 
void rotate (double pitch, double yaw, double roll)
 Rotates the entity. More...
 
- Public Member Functions inherited from Particle
 Particle (Manifold *_m)
 Constructor. More...
 
 Particle (Manifold *_m, Point _p, vector4 _u)
 Constructor. More...
 
virtual ~Particle ()
 Destructor.
 
void setIntegrator (Integrator *)
 Sets the integrator to be used for propagation.
 
StateVector derivative (StateVector v)
 Overloaded method from DiffEq. More...
 
void propagate (double step=0.0)
 Propagates the particle. More...
 
int getCoordSystem ()
 Returns the current coordinate system in use.
 
Point getPos ()
 Returns the position.
 
vector4 getVel ()
 Returns the 4-velocity.
 
- Public Member Functions inherited from DiffEq
 DiffEq ()
 Constructor.
 
virtual ~DiffEq ()
 Virtual destructor.
 

Additional Inherited Members

- Protected Attributes inherited from Particle
Point p
 
vector4 u
 
Manifoldm
 
Integratorintegrator
 

Detailed Description

Class representing an entity with defined position and local basis, consisting of 4-velocity and 3 spatial directions.

The entity can be accelerated and rotated. Inherits Particle.

Constructor & Destructor Documentation

Entity::Entity ( Manifold _m,
Point  _p,
vector4  _u,
vector4  _x,
vector4  _y,
vector4  _z 
)

Constructor.

Initializes the entity with the manifold, position and local basis. The local basis is then orthonormalized (preserving the direction of the 4-velocity).

Parameters
_mThe manifold to be used
_pInitial position
_uInitial 4-velocity
_xInitial local X direction
_yInitial local Y direction
_zInitial local Z direction

Member Function Documentation

void Entity::applyAngVel ( double  x,
double  y,
double  z 
)

Adds angular velocity to the entity.

Parameters
xLocal X component
yLocal Y component
zLocal Z component
void Entity::applyForce ( double  x,
double  y,
double  z 
)

Adds an acceleration to the entity.

Parameters
xLocal X component
yLocal Y component
zLocal Z component
StateVector Entity::derivative ( StateVector  v)
virtual

Overloaded method from DiffEq.

Parameters
vCurrent state
Returns
The derivative of the current state as given by the Fermi-Walker transport.

Implements DiffEq.

vector4 Entity::getStateVector ( int  i)

Returns a component of the local basis.

Parameters
iThe number of the component (0 - 4-velocity etc, 1 - local X, 2 - local Y, 3 - local Z)
void Entity::rotate ( double  pitch,
double  yaw,
double  roll 
)

Rotates the entity.

Parameters
pitchRotation pitch angle
yawRotation yaw angle
rollRotation roll angle
void Entity::setPosVel ( Point  _p,
vector4  _u 
)
virtual

Changes the position and 4-velocity.

Parameters
_pThe new position
_uThe new 4-velocity

Reimplemented from Particle.

void Entity::setVel ( vector4  _u)
virtual

Changes the 4-velocity.

Parameters
_uThe new 4-velocity

Reimplemented from Particle.


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