- Main Page
- Classes
- Files

# My Documents/TS2/inc/LevelUtils.h File Reference

This file contains some level helper functions calculating various algorithms. Basicly it is created to reduce the huge size of Level.cpp. More...

`#include "d3dx9.h"`

Include dependency graph for LevelUtils.h:

This graph shows which files directly or indirectly include this file:

## Functions
float | distance2 (D3DXVECTOR3 p, D3DXVECTOR3 s)
| Useful function for calculating float distance between two vector points.
float | facePoint (D3DXVECTOR3 objpoint, D3DXVECTOR3 point)
| angle for object to face toward given point
bool | CloseToSheep (D3DXVECTOR3 from, D3DXVECTOR3 to)
| determines if object is close to another object (sheep)
bool | ReachedSheep (D3DXVECTOR3 from, D3DXVECTOR3 to)
| determines if object is touching close to another object (sheep)
void | GetRandomVectorCircle (D3DXVECTOR3 *out, float radius)
| Returns random 3D vector in the circle on the floor with given radius.
float | GetRandomFloat (float lowBound, float highBound)
| Returns random float between given bounds.

## Detailed Description

This file contains some level helper functions calculating various algorithms. Basicly it is created to reduce the huge size of Level.cpp.

Author:
  Petar Bajic, MPE (C) All Rights Reserved, Homepage: www.mystic-peanut.com

Date:
  January, 16 2007.

## Function Documentation

bool CloseToSheep | ( | D3DXVECTOR3 | from,
|  | D3DXVECTOR3 | to |
| ) |  |  |

determines if object is close to another object (sheep)

Author:
  Petar Bajic

Date:
  January, 16 2007.

float distance2 | ( | D3DXVECTOR3 | p,
|  | D3DXVECTOR3 | s |
| ) |  |  |

Useful function for calculating float distance between two vector points.

Author:
  Petar Bajic

Date:
  January, 16 2007.

float facePoint | ( | D3DXVECTOR3 | objpoint,
|  | D3DXVECTOR3 | point |
| ) |  |  |

angle for object to face toward given point

Parameters:

  | objpoint | position of object
  | point | point where object is looking at

Author:
  Petar Bajic

Date:
  January, 16 2007.

float GetRandomFloat | ( | float | lowBound,
|  | float | highBound |
| ) |  |  |

Returns random float between given bounds.

Author:
  Petar Bajic

Date:
  January, 16 2007.

void GetRandomVectorCircle | ( | D3DXVECTOR3 * | out,
|  | float | radius |
| ) |  |  |

Returns random 3D vector in the circle on the floor with given radius.

Author:
  Petar Bajic

Date:
  January, 16 2007.

bool ReachedSheep | ( | D3DXVECTOR3 | from,
|  | D3DXVECTOR3 | to |
| ) |  |  |

determines if object is touching close to another object (sheep)

Author:
  Petar Bajic

Date:
  January, 16 2007.