62 lines
1.3 KiB
C
62 lines
1.3 KiB
C
#pragma once
|
|
|
|
#include "defines.h"
|
|
#include <d3d9.h>
|
|
#include <d3dx9math.h>
|
|
|
|
struct Boid
|
|
{
|
|
int m_iTimeOffset;
|
|
int m_iLength;
|
|
float m_fRotOffset;
|
|
D3DXVECTOR3 m_RotFunc;
|
|
D3DXVECTOR3 m_DistFunc;
|
|
float m_fWidth;
|
|
float m_fColor;
|
|
};
|
|
|
|
struct Flock
|
|
{
|
|
static const int m_iTimeResolution= 128;
|
|
D3DXVECTOR3* m_vecSplineData;
|
|
D3DXVECTOR3* m_vecSplineDataUp;
|
|
D3DXVECTOR3* m_vecSplineDataRight;
|
|
int m_iSplineLength;
|
|
|
|
static const int m_iMaxBoidCount= 256;
|
|
Boid m_BoidData[ m_iMaxBoidCount ];
|
|
int m_iBoidCount;
|
|
|
|
float m_fTimeOffset;
|
|
float m_fMaxTimeAdd;
|
|
|
|
float m_fColorIncrement;
|
|
int m_iTesselation;
|
|
|
|
void Init();
|
|
|
|
void GeneratePreSpline( D3DXVECTOR3* pBase,
|
|
int iCountpoints,
|
|
float fDistStep,
|
|
float fMaxOffset);
|
|
void GenerateUpVectors();
|
|
void GenerateSplinePoints( int iTicksPerPrePoint );
|
|
void GenerateBoids01( int iCount );
|
|
void GenerateBoids02( int iCount );
|
|
void GenerateBoids03( int iCount );
|
|
void GenerateBoidsText( int iCount );
|
|
bool IsActive( float fTime );
|
|
void AddToScene( float fTime, int iObject );
|
|
|
|
static int GenerateSplineBands();
|
|
|
|
static void CreateBaseUpVector( D3DXVECTOR3& vec3In, D3DXVECTOR3& vec3Out );
|
|
};
|
|
|
|
static const int g_iFlockCount= 1024;
|
|
extern Flock g_Flocks[ g_iFlockCount ];
|
|
|
|
void PrepareFlockObjects();
|
|
|
|
void AddFlockObjectsToScene( float fTime );
|