Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
117 lines
3.0 KiB
C++
117 lines
3.0 KiB
C++
// DlgBoid.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "worldcreator.h"
|
|
#include "DlgBoid.h"
|
|
#include "SceneManager.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CDlgBoid dialog
|
|
|
|
|
|
CDlgBoid::CDlgBoid(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CDlgBoid::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CDlgBoid)
|
|
m_fAngle = 0.0f;
|
|
m_fFraction = 0.0f;
|
|
m_fRadius = 0.0f;
|
|
m_fRatio = 0.0f;
|
|
m_fSpeed = 0.0f;
|
|
m_nBoid = 0;
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
|
|
void CDlgBoid::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CDlgBoid)
|
|
DDX_Text(pDX, IDC_EDIT_ANGLE, m_fAngle);
|
|
DDX_Text(pDX, IDC_EDIT_FRACTION, m_fFraction);
|
|
DDX_Text(pDX, IDC_EDIT_RADIUS, m_fRadius);
|
|
DDX_Text(pDX, IDC_EDIT_RATIO, m_fRatio);
|
|
DDX_Text(pDX, IDC_EDIT_SPEED, m_fSpeed);
|
|
DDX_Text(pDX, IDC_EDIT_OBJECTCOUNT, m_nBoid);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CDlgBoid, CDialog)
|
|
//{{AFX_MSG_MAP(CDlgBoid)
|
|
ON_BN_CLICKED(IDC_BUTTON_BUFFERFLY, OnButtonBufferfly)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CDlgBoid message handlers
|
|
|
|
BOOL CDlgBoid::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
/* m_fAngle=CSceneManager::m_Boid.m_AngleTweak;
|
|
m_fFraction=CSceneManager::m_Boid.m_CollisionFraction;
|
|
m_fRadius=CSceneManager::m_Boid.m_InfluenceRadius;
|
|
m_fRatio=CSceneManager::m_Boid.m_PitchToSpeedRatio;
|
|
m_fSpeed=CSceneManager::m_Boid.m_NormalSpeed;
|
|
*/
|
|
UpdateData(FALSE);
|
|
|
|
// TODO: Add extra initialization here
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CDlgBoid::OnOK()
|
|
{
|
|
// TODO: Add extra validation here
|
|
UpdateData();
|
|
/* CSceneManager::m_Boid.DeleteBoid();
|
|
CSceneManager::m_Boid.Create(m_nBoid,0);
|
|
|
|
CSceneManager::m_Boid.m_AngleTweak=m_fAngle;
|
|
CSceneManager::m_Boid.m_CollisionFraction=m_fFraction;
|
|
CSceneManager::m_Boid.m_InfluenceRadius=m_fRadius;
|
|
CSceneManager::m_Boid.m_PitchToSpeedRatio=m_fRatio;
|
|
CSceneManager::m_Boid.m_NormalSpeed=m_fSpeed;
|
|
|
|
CSceneManager::m_Boid.m_InfluenceRadiusSquared=
|
|
CSceneManager::m_Boid.m_InfluenceRadius*CSceneManager::m_Boid.m_InfluenceRadius;
|
|
|
|
CSceneManager::m_Boid.m_InvCollisionFraction=1.0f/(1.0f-CSceneManager::m_Boid.m_CollisionFraction);
|
|
|
|
for(int i=0;i<CSceneManager::m_Boid.m_nBoids;i++)
|
|
{
|
|
CSceneManager::m_Boid.m_pBoids[i].m_vecLoc=vector3(i+10,i+10+150,i+10);
|
|
CSceneManager::m_Boid.m_pBoids[i].m_vecDir=vector3(1.0f,0.0f,0.0f);
|
|
CSceneManager::m_Boid.m_pBoids[i].m_fYaw=0.0f;
|
|
CSceneManager::m_Boid.m_pBoids[i].m_fPitch=0.0f;
|
|
CSceneManager::m_Boid.m_pBoids[i].m_fRoll=0.0f;
|
|
CSceneManager::m_Boid.m_pBoids[i].m_fDYaw=0.0f;
|
|
CSceneManager::m_Boid.m_pBoids[i].m_fSpeed=0.1f;
|
|
}
|
|
*/
|
|
CDialog::OnOK();
|
|
}
|
|
|
|
void CDlgBoid::OnButtonBufferfly()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
m_fRadius=200.0f;
|
|
m_fFraction=0.5f;
|
|
m_fSpeed=0.4f;
|
|
m_fAngle=0.001f;
|
|
m_fRatio=10.0f;
|
|
m_nBoid=10;
|
|
UpdateData(FALSE);
|
|
}
|