本文整理汇总了C++中CEntity::GetPlacement方法的典型用法代码示例。如果您正苦于以下问题:C++ CEntity::GetPlacement方法的具体用法?C++ CEntity::GetPlacement怎么用?C++ CEntity::GetPlacement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEntity
的用法示例。
在下文中一共展示了CEntity::GetPlacement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectEntityOnRender
// check if all of the corners of entity's bounding box are influenced by current select-on-render selection
void SelectEntityOnRender(CProjection3D &prProjection, CEntity &en)
{
FLOATaabbox3D bbox;
FLOATmatrix3D mOne = FLOATmatrix3D(0.0f);
mOne.Diagonal(1.0f);
FLOATmatrix3D *pmR;
FLOAT3D vOffset;
// if this entity is model
if (en.en_RenderType==CEntity::RT_MODEL || en.en_RenderType==CEntity::RT_EDITORMODEL)
{
// get bbox of current frame
CModelObject *pmo = en.GetModelObject();
pmo->GetCurrentFrameBBox( bbox);
pmR = &en.en_mRotation;
vOffset = en.GetPlacement().pl_PositionVector;
}
// if it is ska model
else if(en.en_RenderType==CEntity::RT_SKAMODEL || en.en_RenderType==CEntity::RT_SKAEDITORMODEL)
{
en.GetModelInstance()->GetCurrentColisionBox( bbox);
pmR = &en.en_mRotation;
vOffset = en.GetPlacement().pl_PositionVector;
}
// if it is brush
else
{
// get bbox of brush's first mip
CBrush3D *pbr = en.GetBrush();
CBrushMip *pbrmip = pbr->GetFirstMip();
bbox = pbrmip->bm_boxBoundingBox;
pmR = &mOne;
vOffset = FLOAT3D( 0.0f, 0.0f, 0.0f);
}
if( IsBoundingBoxInLasso( prProjection, bbox, pmR, vOffset))
{
if( _bSelectAlternative)
{
// deselect
if (en.IsSelected(ENF_SELECTED))
{
_pselenSelectOnRender->Deselect(en);
}
}
else
{
// select
if (!en.IsSelected(ENF_SELECTED))
{
_pselenSelectOnRender->Select(en);
}
}
}
}
示例2: Reset
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CUICreateChar::Reset()
{
Lock(FALSE);
m_iSelectedJob = 0;
m_fZDelta = 0.0f;
m_fRotDelta = 0.0f;
m_ebCharName.ResetString();
// 카메라 설정, 캐릭터 위치 설정.
for(int i = 0; i < MAXJOB; ++i)
{
const int iMarker = _aiMarkerEntities[i];
CEntity *penMarker = m_pWorld->EntityFromID(iMarker);
penMarker->SetSkaModel(JobInfo().GetFileName(i));
g_CharacterAngle[i] = penMarker->GetPlacement().pl_OrientationAngle(1);
CModelInstance* pMI = penMarker->GetModelInstance();
if(pMI)
{
INDEX idAttackIdle = ska_GetIDFromStringTable( JobInfo().GetAnimationName( i, ANIM_IDLE ) );
pMI->AddAnimation(idAttackIdle, AN_LOOPING|AN_NORESTART|AN_CLEAR, 1, 0);
}
}
#if defined(G_BRAZIL)
CharWearing();
#endif
ChangeSelJob();
m_bIsShowMessageInfo = _pGameState->IsCreatableNightShadow();
}
示例3: DoDataExchange
void CDlgPgPosition::DoDataExchange(CDataExchange* pDX)
{
if( theApp.m_bDisableDataExchange) return;
CPropertyPage::DoDataExchange(pDX);
SetModified( TRUE);
// obtain document
CWorldEditorDoc* pDoc = theApp.GetDocument();
// if document doesn't exist, return
if( pDoc == NULL) return;
// get active view
CWorldEditorView *pWorldEditorView = theApp.GetActiveView();
// if dialog is recieving data
if( pDX->m_bSaveAndValidate == FALSE)
{
// is CSG on?
if( pDoc->m_pwoSecondLayer != NULL)
{
// yes, pick up coordinates for editting from second layer
m_fHeading = DegAngle( pDoc->m_plSecondLayer.pl_OrientationAngle(1));
m_fPitch = DegAngle( pDoc->m_plSecondLayer.pl_OrientationAngle(2));
m_fBanking = DegAngle( pDoc->m_plSecondLayer.pl_OrientationAngle(3));
m_fX = pDoc->m_plSecondLayer.pl_PositionVector(1);
m_fY = pDoc->m_plSecondLayer.pl_PositionVector(2);
m_fZ = pDoc->m_plSecondLayer.pl_PositionVector(3);
}
// otherwise if we are in entity mode and there is only one entity selected
else if( (pDoc->m_iMode == ENTITY_MODE) && ( pDoc->m_selEntitySelection.Count() == 1) )
{
// lock selection's dynamic container
pDoc->m_selEntitySelection.Lock();
// get first entity
CEntity *penEntityOne = pDoc->m_selEntitySelection.Pointer(0);
// unlock selection's dynamic container
pDoc->m_selEntitySelection.Unlock();
// get placement of first entity
CPlacement3D plEntityOnePlacement = penEntityOne->GetPlacement();
m_fHeading = DegAngle( plEntityOnePlacement.pl_OrientationAngle(1));
m_fPitch = DegAngle( plEntityOnePlacement.pl_OrientationAngle(2));
m_fBanking = DegAngle( plEntityOnePlacement.pl_OrientationAngle(3));
m_fX = plEntityOnePlacement.pl_PositionVector(1);
m_fY = plEntityOnePlacement.pl_PositionVector(2);
m_fZ = plEntityOnePlacement.pl_PositionVector(3);
}
m_udSelection.MarkUpdated();
}
//{{AFX_DATA_MAP(CDlgPgPosition)
DDX_Text(pDX, IDC_EDIT_BANKING, m_fBanking);
DDX_Text(pDX, IDC_EDIT_HEADING, m_fHeading);
DDX_Text(pDX, IDC_EDIT_PITCH, m_fPitch);
DDX_Text(pDX, IDC_EDIT_X, m_fX);
DDX_Text(pDX, IDC_EDIT_Y, m_fY);
DDX_Text(pDX, IDC_EDIT_Z, m_fZ);
//}}AFX_DATA_MAP
// if dialog is giving data
if( pDX->m_bSaveAndValidate != FALSE)
{
// is CSG on?
if( pDoc->m_pwoSecondLayer != NULL)
{
// yes, copy coordinates from editting controls into second layer
pDoc->m_plSecondLayer.pl_OrientationAngle(1) = AngleDeg( m_fHeading);
pDoc->m_plSecondLayer.pl_OrientationAngle(2) = AngleDeg( m_fPitch);
pDoc->m_plSecondLayer.pl_OrientationAngle(3) = AngleDeg( m_fBanking);
pDoc->m_plSecondLayer.pl_PositionVector(1) = m_fX;
pDoc->m_plSecondLayer.pl_PositionVector(2) = m_fY;
pDoc->m_plSecondLayer.pl_PositionVector(3) = m_fZ;
// snap values to grid
pDoc->SnapToGrid( pDoc->m_plSecondLayer, SNAP_FLOAT_12);
theApp.m_vfpCurrent.vfp_plPrimitive = pDoc->m_plSecondLayer;
// update all document's views
pDoc->UpdateAllViews( NULL);
}
// otherwise if we are in entity mode
else if( pDoc->m_iMode == ENTITY_MODE)
{
// there must be only one entity selected
ASSERT( pDoc->m_selEntitySelection.Count() == 1);
// lock selection's dynamic container
pDoc->m_selEntitySelection.Lock();
// get first entity
CEntity *penEntityOne = pDoc->m_selEntitySelection.Pointer(0);
// unlock selection's dynamic container
pDoc->m_selEntitySelection.Unlock();
// get placement of first entity
CPlacement3D plEntityOnePlacement = penEntityOne->GetPlacement();
plEntityOnePlacement.pl_OrientationAngle(1) = AngleDeg( m_fHeading);
plEntityOnePlacement.pl_OrientationAngle(2) = AngleDeg( m_fPitch);
//.........这里部分代码省略.........