Enki  1.9
Classes | Typedefs | Functions
Some software bricks extracted from the An support library.

Classes

struct  Enki::Vector
 A vector in a 2D space. More...
 
struct  Enki::Matrix22
 A 2x2 matrix. More...
 
struct  Enki::Segment
 A segment in a 2D space, basically two points. More...
 
struct  Enki::Polygone
 Polygone, which is a vector of points. Anti-clockwise, standard trigonometric orientation. More...
 
class  Enki::FastRandom
 A fast random generator. More...
 

Typedefs

typedef Vector Enki::Point
 A point in a 2D space, another name for a vector. More...
 

Functions

std::ostream & Enki::operator<< (std::ostream &outs, const Polygone &polygone)
 Print a polygone to a stream. More...
 
double Enki::normalizeAngle (double angle)
 Normlize an angle to be between -PI and +PI. More...
 
Point Enki::getIntersection (const Segment &s1, const Segment &s2)
 get the intersection point between two line segments returns Point(HUGE_VAL, HUGE_VAL) if there's no intersection added by yvan..nosp@m.bour.nosp@m.quin@.nosp@m.epfl.nosp@m..ch More...
 
double Enki::getTriangleAreaTwice (const Point &a, const Point &b, const Point &c)
 Returns 2 times the signed triangle area. More...
 
double Enki::getTriangleHeight (const Point &a, const Point &b, const Point &c)
 Returns signed height of triangle abc with base ab. More...
 
double Enki::uniformRand (void)
 Return a number in [0;1[ in a uniform distribution. More...
 
unsigned Enki::intRand (unsigned max)
 Return a number between [0;max[ in integer in a uniform distribution. More...
 
bool Enki::boolRand (double prob=0.5)
 Return true with a probability prob. If no argument is given, prob = 0.5. More...
 
double Enki::gaussianRand (double mean, double sigm)
 Return a random number with a gaussian distribution of a certain mean and standard deviation. More...
 

Detailed Description

This includes the Color type, a collection of several random distributions and some geometric primitives.

Typedef Documentation

typedef Vector Enki::Point

A point in a 2D space, another name for a vector.

Function Documentation

bool Enki::boolRand ( double  prob = 0.5)
inline

Return true with a probability prob. If no argument is given, prob = 0.5.

References Enki::uniformRand().

double Enki::gaussianRand ( double  mean,
double  sigm 
)
inline

Return a random number with a gaussian distribution of a certain mean and standard deviation.

References Enki::uniformRand().

Referenced by Enki::IRSensor::finalize(), Enki::GroundSensor::init(), and Enki::ActiveSoundSource::realisticSetSound().

Point Enki::getIntersection ( const Segment s1,
const Segment s2 
)
inline

get the intersection point between two line segments returns Point(HUGE_VAL, HUGE_VAL) if there's no intersection added by yvan..nosp@m.bour.nosp@m.quin@.nosp@m.epfl.nosp@m..ch

References Enki::Segment::a, Enki::Segment::b, Enki::Vector::x, and Enki::Vector::y.

double Enki::getTriangleAreaTwice ( const Point a,
const Point b,
const Point c 
)
inline

Returns 2 times the signed triangle area.

positive if abc winds counter-clockwise, negative if abc winds clockwise, zero if abc is degenerate. See: Real-time collision detection, C. Ericson, Page 152

References Enki::Vector::x, and Enki::Vector::y.

Referenced by Enki::getTriangleHeight(), and Enki::World::isPointInside().

double Enki::getTriangleHeight ( const Point a,
const Point b,
const Point c 
)
inline

Returns signed height of triangle abc with base ab.

positive if abc winds counter-clockwise negative if abc winds clockwise, zero if abc is degenerate.

References Enki::getTriangleAreaTwice(), and Enki::Vector::norm().

Referenced by Enki::World::isPointInside().

unsigned Enki::intRand ( unsigned  max)
inline

Return a number between [0;max[ in integer in a uniform distribution.

double Enki::normalizeAngle ( double  angle)
inline

Normlize an angle to be between -PI and +PI.

References Enki::Vector::angle(), Enki::Vector::x, and Enki::Vector::y.

Referenced by Enki::PhysicalObject::finalizePhysicsInteractions(), and Enki::CircularCam::objectStep().

std::ostream & Enki::operator<< ( std::ostream &  outs,
const Polygone polygone 
)

Print a polygone to a stream.

double Enki::uniformRand ( void  )
inline

Return a number in [0;1[ in a uniform distribution.

Referenced by Enki::boolRand(), Enki::gaussianRand(), and Enki::UniformRand::operator()().