コード例 #1
0
void DialogObjProp::OP_OBJNME()
{
	CListBox*	pObjList	= (CListBox*)parentWnd->GetObjList()->GetDlgItem(IDC_OBJLIST);
	CEdit*		pObjNme		= (CEdit*)GetDlgItem(IDC_OBJNME);
	int ID = pObjList->GetCurSel();

	char name[512];
	pObjNme->GetWindowTextA(name, 512);
	parentWnd->theApp->curProject->GetScene()->SetObjectName(name, ID);
	if (!parentWnd->UpdateObjectList())
		MessageBox("Failed To Update Object List After Name Change!", "Error!");
}
コード例 #2
0
void DialogObjProp::OP_XROT()
{
	CListBox* pObjList = (CListBox*)parentWnd->GetObjList()->GetDlgItem(IDC_OBJLIST);
	if (pObjList->GetCurSel() == LB_ERR)
	{
		MessageBox("No Object Selected.", "Notice.");
		return;
	}

	int ID = pObjList->GetCurSel();

	Transform* objtransform = parentWnd->theApp->curProject->GetScene()->GetSceneObject(ID)->GetTransform();
	CEdit* pXPos = (CEdit*)GetDlgItem(IDC_XROT);
	char s_xrot[512];
	pXPos->GetWindowTextA(s_xrot, 512);
	float xRot = atof(s_xrot);
	float yRot = objtransform->GetRotation().y;
	float zRot = objtransform->GetRotation().z;

	objtransform->SetRotation(xRot, yRot, zRot);
}
コード例 #3
0
void DialogObjProp::OP_ZPOS()
{
	CListBox* pObjList = (CListBox*)parentWnd->GetObjList()->GetDlgItem(IDC_OBJLIST);
	if (pObjList->GetCurSel() == LB_ERR)
	{
		MessageBox("No Object Selected.", "Notice.");
		return;
	}

	int ID = pObjList->GetCurSel();

	Transform* objtransform = parentWnd->theApp->curProject->GetScene()->GetSceneObject(ID)->GetTransform();
	CEdit* pXPos = (CEdit*)GetDlgItem(IDC_ZPOS);
	char s_zpos[512];
	pXPos->GetWindowTextA(s_zpos, 512);
	float xPos = objtransform->GetTranslation().x;
	float yPos = objtransform->GetTranslation().y;
	float zPos = atof(s_zpos);

	objtransform->SetTranslation(xPos, yPos, zPos);
}
コード例 #4
0
void DialogObjProp::OP_ZSCL()
{
	CListBox* pObjList = (CListBox*)parentWnd->GetObjList()->GetDlgItem(IDC_OBJLIST);
	if (pObjList->GetCurSel() == LB_ERR)
	{
		MessageBox("No Object Selected.", "Notice.");
		return;
	}

	int ID = pObjList->GetCurSel();

	Transform* objtransform = parentWnd->theApp->curProject->GetScene()->GetSceneObject(ID)->GetTransform();
	CEdit* pXPos = (CEdit*)GetDlgItem(IDC_ZSCL);
	char s_zscl[512];
	pXPos->GetWindowTextA(s_zscl, 512);
	float xScl = objtransform->GetScale().x;
	float yScl = objtransform->GetScale().y;
	float zScl = atof(s_zscl);

	objtransform->SetScale(xScl, yScl, zScl);
}