这篇教程C++ APoint类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中APoint类的典型用法代码示例。如果您正苦于以下问题:C++ APoint类的具体用法?C++ APoint怎么用?C++ APoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了APoint类的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PointWorldToViewPort//----------------------------------------------------------------------------Vector2f RenderStep::PointWorldToViewPort(const APoint &point, bool *isInBack){ Rectf viewPort = mViewPort; if (viewPort.IsEmpty()) viewPort = Rectf(0.0f, 0.0f, mSize.Width, mSize.Height); HMatrix matProjView = mCamera->GetProjectionMatrix() * mCamera->GetViewMatrix(); HPoint hPoint(point.X(), point.Y(), point.Z(), point.W()); HPoint tempPoint = matProjView * hPoint; if (isInBack) { if (tempPoint.Z() <= 0) *isInBack = true; else *isInBack = false; } float wInv = 1.0f / tempPoint.W(); //投影坐标范围为[-1,1]要变成[0,1] Vector2f screenPoint; screenPoint.X() = (1.0f + tempPoint.X()*wInv) / 2.0f; screenPoint.Y() = (1.0f + tempPoint.Y()*wInv) / 2.0f; //投影坐标范围为[0,1]要变成视口内坐标 screenPoint.X() = viewPort.Left + screenPoint.X()*viewPort.Width(); screenPoint.Y() = viewPort.Bottom + screenPoint.Y()*viewPort.Height(); return screenPoint;}
开发者ID:bobbyzhu,项目名称:Phoenix3D,代码行数:33,
示例2: OnLeftUp//----------------------------------------------------------------------------void EU_CanvasStage::OnLeftUp(const APoint &worldPos){ if (!IsEnable()) return; const Rectf &rectWorld = GetWorldRect(); if (!rectWorld.IsInsize(worldPos.X(), worldPos.Z())) return; UICanvas::OnLeftUp(worldPos); if (IsCameraDraging()) { SetCameraDraging(false); } else { Camera *camera = mSceneNodeCtrlCanvas->GetOverCamera(); if (mSceneNodeCtrl) mSceneNodeCtrl->OnLeftUp(camera, worldPos, GetSize()); Edit::EditMode em = PX2_EDIT.GetEditMode(); if ((Edit::EM_TRANSLATE == em || Edit::EM_ROTATE == em || Edit::EM_SCALE == em) && mIsSelectMovableTransChanged) { PX2_URDOM.PushUnDo(mURDoCommand); mIsSelectMovableTransChanged = false; } }}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:32,
示例3: _TrySelectCurveCtrlPoint//----------------------------------------------------------------------------void EditRenderView_TimeLine::_TrySelectCurveCtrlPoint(const APoint &pos){ APoint origin; AVector direction; mRenderStep->GetPickRay(pos.X(), pos.Z(), origin, direction); Node *gridNode = PX2_EDIT.GetTimeLineEdit()->GetCurveEditNode_Grid(); Picker picker; picker.Execute(gridNode, origin, direction, 0.0f, Mathf::MAX_REAL); if ((int)(picker.Records.size()) > 0) { Movable *mov = picker.GetClosestNonnegative().Intersected; CurveCtrl *ctrl = PX2_EDIT.GetTimeLineEdit()->TrySelectCurve(mov); if (ctrl) { //UnToggleAllInterps(); //EnableInterps(true); //ToggleInterp(ctrl->GetInterpCurveMode()); PX2_EDIT.GetTimeLineEdit()->SetSelectedCurveCtrl(ctrl); } else { PX2_EDIT.GetTimeLineEdit()->SetSelectedCurveCtrl(0); } } else { PX2_EDIT.GetTimeLineEdit()->SetSelectedCurveCtrl(0); }}
开发者ID:bobbyzhu,项目名称:Phoenix3D,代码行数:36,
示例4: rect//----------------------------------------------------------------------------void EditRenderView_TimeLine::OnLeftDClick(const APoint &pos){ EditRenderView::OnLeftDClick(pos); Rectf rect(0, 0, mLeftWidth, mSize.Height); bool leftContain = rect.IsInsize(Float2(pos.X(), pos.Z())); bool isCtrlDown = PX2_EDIT.IsCtrlDown; if (!leftContain && isCtrlDown) { UICurveGroup *uiCurveGroup = PX2_EDIT.GetTimeLineEdit()->GetSelectedUICurveGroup(); if (!uiCurveGroup) return; Camera *camera = PX2_EDIT.GetTimeLineEdit()->GetTimeLineRenderStep_Grid()->GetCamera(); APoint camPos = camera->GetPosition(); Vector2f camScreenPos = mUIViewGrid->PointWorldToViewPort(camPos); float xDissCam = pos.X() - camScreenPos.X(); float zDissCam = pos.Z() - camScreenPos.Y(); float xDissCamReal = xDissCam / mPixelOverCamIn; float zDissCamReal = zDissCam / mPixelOverCamOut; APoint pointPos = camPos + AVector(xDissCamReal, 0.0f, zDissCamReal); CurveGroup *curveGroup = uiCurveGroup->GetCurveGroup(); curveGroup->AddPoint(pointPos); }}
开发者ID:bobbyzhu,项目名称:Phoenix3D,代码行数:28,
示例5: GetSize//----------------------------------------------------------------------------void EU_CanvasStage::_UpdateBrushPos(const APoint &scrPos){ Project *proj = Project::GetSingletonPtr(); if (!proj) return; Scene *scene = proj->GetScene(); if (!scene) return; Terrain *terrain = scene->GetTerrain(); if (!terrain) return; Movable *pickObject = terrain;#ifdef _DEBUG pickObject = PX2_GR.GetXYPlane(); pickObject->WorldTransform.SetTranslate(APoint::ORIGIN);#endif Camera *camera = mStageCameraNode->GetCamera(); APoint origin; AVector direction; camera->GetPickRay(scrPos.X(), scrPos.Z(), GetSize(), origin, direction); Picker picker; picker.Execute(pickObject, origin, direction, 0.0f, Mathf::MAX_REAL); if ((int)picker.Records.size() > 0) { PX2::PickRecord pickRecord = picker.GetClosestToZero(); PX2::APoint dest = origin + direction*pickRecord.T; PX2_EDIT.GetTerrainEdit()->GetBrush()->SetPos(dest); }}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:34,
示例6: OnProjectSize//----------------------------------------------------------------------------void ApplicationBase::OnProjectSize (int width, int height){ mUIManager->GetDefaultView()->SetSize((float)width, (float)height); APoint curPos = mUIManager->GetDefaultView()->GetCamera()->GetPosition(); mUIManager->GetDefaultView()->GetCamera()->SetPosition(APoint((float)width/2.0f, curPos.Y(), (float)height/2.0f));}
开发者ID:SylviaTanenbaum,项目名称:3d-simulation-and-game,代码行数:8,
示例7: PointWorldToViewPort//----------------------------------------------------------------------------Vector2f Renderer::PointWorldToViewPort (const APoint &point, bool *isInBack){ HMatrix matProjView = GetProjectionMatrix() * GetViewMatrix(); HPoint hPoint(point.X(), point.Y(), point.Z(), point.W()); HPoint tempPoint = matProjView * hPoint; if (isInBack) { if (tempPoint.Z() <= 0) *isInBack = true; else *isInBack = false; } float wInv = 1.0f / tempPoint.W(); //投影坐标范围为[-1,1]要变成[0,1] Vector2f screenPoint; screenPoint.X() = (1.0f + tempPoint.X()*wInv)/2.0f; screenPoint.Y() = (1.0f + tempPoint.Y()*wInv)/2.0f; //投影坐标范围为[0,1]要变成视口内坐标 int viewX, viewY, viewW, viewH; GetViewport(viewX, viewY, viewW, viewH); screenPoint.X() = viewX + screenPoint.X()*viewW; screenPoint.Y() = viewY + screenPoint.Y()*viewH; return screenPoint;}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:31,
示例8: OnRightUp//----------------------------------------------------------------------------void EU_CanvasStage::OnRightUp(const APoint &worldPos){ if (!IsEnable()) return; const Rectf &rectWorld = GetWorldRect(); if (!rectWorld.IsInsize(worldPos.X(), worldPos.Z())) return; Project *proj = Project::GetSingletonPtr(); if (!proj) return; if (IsCameraDraging()) { SetCameraDraging(false); } else { if (mIsRightPressed) { CreateMenuOnSelect(worldPos); } } UICanvas::OnRightUp(worldPos);}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:28,
示例9: _ClickSelectPos//----------------------------------------------------------------------------void EditRenderView_Scene::_ClickSelectPos(const APoint &scrPos){ Scene *scene = PX2_PROJ.GetScene(); RenderStep *renderStep = PX2_PROJ.GetSceneRenderStep(); APoint origin; AVector direction; renderStep->GetPickRay(scrPos.X(), scrPos.Z(), origin, direction); ActorPicker actorPicker; actorPicker.Execute(scene, origin, direction, 0.0f, Mathf::MAX_REAL); if (actorPicker.Records.size() > 0) { const ActorPickRecord &record = actorPicker.GetClosestToZero(); mSelectPoint = origin + direction*record.T; PX2_EDIT.SetPickPos(mSelectPoint); } else { PX2::TriMesh *xyPlane = PX2_GR.GetXYPlane(); xyPlane->WorldTransform.SetTranslate(APoint::ORIGIN); Picker picker; picker.Execute(xyPlane, origin, direction, 0.0f, Mathf::MAX_REAL); if ((int)picker.Records.size() > 0) { const PickRecord &rec = picker.GetClosestToZero(); mSelectPoint = origin + direction*rec.T; PX2_EDIT.SetPickPos(mSelectPoint); } }}
开发者ID:zhangf911,项目名称:Phoenix3D,代码行数:34,
示例10: _ClickSelectScene//----------------------------------------------------------------------------void EU_CanvasStage::_ClickSelectScene(const APoint &scrPos){ if (!Project::GetSingletonPtr()) return; Scene *scene = PX2_PROJ.GetScene(); if (!scene) return; SelectMode mode = SM_SINGLE; if (PX2_EDIT.IsCtrlDown) mode = SM_MULTI; Camera *camera = mStageCameraNode->GetCamera(); APoint origin; AVector direction; camera->GetPickRay(scrPos.X(), scrPos.Z(), GetSize(), origin, direction); Picker picker; picker.Execute(scene, origin, direction, 0.0f, Mathf::MAX_REAL); if ((int)picker.Records.size() > 0) { const PickRecord &record = picker.GetClosestToZero(); Object *recordObj = record.Intersected; mSelectPoint = origin + direction*record.T; PX2_EDIT.SetPickPos(mSelectPoint); if (SM_SINGLE == mode) { int numObjs = PX2_SELECTM_E->GetNumObjects(); if (1 == numObjs && recordObj == PX2_SELECTM_E->GetFirstObject()) { PX2_SELECTM_E->Clear(); } else { PX2_SELECTM_E->Clear(); PX2_SELECTM_E->AddObject(recordObj); } } else if (SM_MULTI == mode) { if (PX2_SELECTM_E->IsObjectIn(recordObj)) { PX2_SELECTM_E->RemoveObject(recordObj); } else { PX2_SELECTM_E->AddObject(recordObj); } } } else { if (SM_SINGLE == mode) { PX2_SELECTM_E->Clear(); } }}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:60,
示例11: SetRotation//----------------------------------------------------------------------------void Actor::SetRotation (APoint &rolate){ mRotation = rolate; if (mMovable) { mMovable->LocalTransform.SetRotate(Matrix3f().MakeEulerXYZ( rolate.X(), rolate.Y(), rolate.Z())); }}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:11,
示例12: GetWorldRect//----------------------------------------------------------------------------APoint SizeNode::WorldPosToViewPortPos(const APoint &worldPos){ Rectf worldRect = GetWorldRect(); APoint viewPortPos; viewPortPos.X() = worldPos.X() - worldRect.Left; viewPortPos.Z() = worldPos.Z() - worldRect.Bottom; return viewPortPos;}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:11,
示例13: wxPGProperty//-----------------------------------------------------------------------------wxAPoint3Property::wxAPoint3Property (const wxString &label, const wxString &name, const APoint &value) :wxPGProperty(label, name){ SetValue(APointToVariant(value)); AddPrivateChild(new wxFloatProperty(wxT("X"),wxPG_LABEL,value.X())); AddPrivateChild(new wxFloatProperty(wxT("Y"),wxPG_LABEL,value.Y())); AddPrivateChild(new wxFloatProperty(wxT("Z"),wxPG_LABEL,value.Z()));}
开发者ID:ascetic85,项目名称:Phoenix3d,代码行数:11,
示例14: SetPosition//----------------------------------------------------------------------------void FMODSound::SetPosition (const APoint &position){ FMOD_VECTOR pos; pos.x = position.X(); pos.y = position.Y(); pos.z = position.Z(); if (mChannel) mChannel->set3DAttributes(&pos, 0);}
开发者ID:whztt07,项目名称:Phoenix3D_2.0,代码行数:11,
示例15: GetLocalRect//----------------------------------------------------------------------------Rectf SizeNode::GetWorldRect() const{ Rectf rect = GetLocalRect(); const APoint worldPos = WorldTransform.GetTranslate(); rect.Left += worldPos.X(); rect.Right += worldPos.X(); rect.Bottom += worldPos.Z(); rect.Top += worldPos.Z(); return rect;}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:13,
示例16: PropertyMovableTransProperty::MovableTransProperty (PropertyPage *parent, const std::string &name, const std::string &tag, Transform *trans, Object *obj) :Property(parent, name, tag, Property::PT_TRANSFORM, 0), mIsRSMatrix(0), mPropertyTranslate(0), mPropertyRotation(0), mPropertyScale(0), mPropertyIsUniformScale(0), mTrans(trans), mObject(obj){ APoint position; APoint rotation; APoint scale(1.0f, 1.0f, 1.0f); bool isRSMatrix = mTrans->IsRSMatrix(); if (isRSMatrix) { position = mTrans->GetTranslate(); Matrix3f mat = mTrans->GetRotate(); mat.ExtractEulerXYZ(rotation.X(), rotation.Y(), rotation.Z()); scale = mTrans->GetScale(); bool isUniformScale = mTrans->IsUniformScale(); mProperty = parent->mPage->Append(new wxStringProperty( name, tag, wxT("<composed>")) ); mPropertyTranslate = parent->mPage->AppendIn(mProperty, new wxAPoint3Property("Translate", tag+"Translate", position)); mPropertyRotation = parent->mPage->AppendIn(mProperty, new wxAPoint3Property("Rotate", tag+"Rotate", rotation)); mPropertyScale = parent->mPage->AppendIn(mProperty, new wxAPoint3Property("Scale", tag+"Scale", scale)); mPropertyIsUniformScale = parent->mPage->AppendIn(mProperty, new wxBoolProperty("IsUniformScale", tag+"IsUniformScale", isUniformScale)); mPropertyIsUniformScale->Enable(false); } else { mProperty = parent->mPage->Append(new wxStringProperty( name, tag, wxT("<composed>")) ); mIsRSMatrix = parent->mPage->AppendIn(mProperty, new wxBoolProperty("IsRSMatrix", tag+"IsRSMatrix", false)); mIsRSMatrix->Enable(false); }}
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:51,
示例17: GetWorldRect//----------------------------------------------------------------------------void EU_CanvasStage::OnRightDown(const APoint &worldPos){ if (!IsEnable()) return; const Rectf &rectWorld = GetWorldRect(); if (!rectWorld.IsInsize(worldPos.X(), worldPos.Z())) return; UICanvas::OnRightDown(worldPos); APoint viewPortPos = WorldPosToViewPortPos(worldPos); _ClickSelectPos(viewPortPos);}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:15,
示例18: GetPage//----------------------------------------------------------------------------void Terrain::AddJunglers (Texture2D *tex, APoint center, float radius, int num, float width, float height, float lower){ if (!tex) return; for (int i=0; i<mNumRows; i++) { for (int j=0; j<mNumCols; j++) { GetPage(i, j)->mAddingJObjs.clear(); } } for (int i=0; i<num; i++) { float unitRadius = Mathf::UnitRandom(); float fX0 = Mathf::SymmetricRandom(); float fY0 = Mathf::SymmetricRandom(); AVector normal0(fX0, fY0, 0.0f); normal0.Normalize(); float fX1 = Mathf::SymmetricRandom(); float fY1 = Mathf::SymmetricRandom(); AVector normal1(fX1, fY1, 0.0f); normal1.Normalize(); APoint pos = center + normal0*unitRadius*radius; pos.Z() = GetHeight(pos.X(), pos.Y()) - lower; JObj obj; obj.Pos = pos; obj.Normal = normal1; obj.Width = width; obj.Height = height; TerrainPage *page = GetCurrentPage(obj.Pos.X(), obj.Pos.Y()); page->mAddingJObjs.push_back(obj); } for (int i=0; i<mNumRows; i++) { for (int j=0; j<mNumCols; j++) { TerrainPage *page = GetPage(i, j); page->AddJunglers(tex, page->mAddingJObjs); } }}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:50,
示例19: GetChild//----------------------------------------------------------------------------int UIGridFrame::_UpdateAlignItems(){ int numValidChild = 0; for (int i = 0; i < GetNumChildren(); i++) { Movable *mov = GetChild(i); if (mov) { APoint pos; if (ATT_SIZE_WIDTH == mAlignItemType) { int numWidth = (int)((mSize.Width - mBorderSize.Width*2.0f) / mItemSize.Width); if (0 == numWidth) numWidth = 1; int xIndex = numValidChild % numWidth; int zIndex = numValidChild / numWidth; pos.X() = mBorderSize.Width + mItemSize.Width / 2.0f + mItemSize.Width*xIndex; pos.Z() = mSize.Height - mBorderSize.Height - mItemSize.Height / 2.0f - mItemSize.Height*zIndex; } else if (ATT_NUM_WIDTH == mAlignItemType) { assertion(0.0f != mAlignItemNum[0], ""); assertion(0.0f != mAlignItemNum[1], ""); mItemSize.Width = (mSize.Width - mBorderSize.Width*2.0f) / mAlignItemNum[0]; mItemSize.Height = (mSize.Height - mBorderSize.Height*2.0f) / mAlignItemNum[1]; int numWidth = (int)mAlignItemNum[0]; int xIndex = numValidChild%numWidth; int zIndex = numValidChild / numWidth; pos.X() = mBorderSize.Width + mItemSize.Width / 2.0f + mItemSize.Width*xIndex; pos.Z() = mSize.Height - mBorderSize.Height - mItemSize.Height / 2.0f - mItemSize.Height*zIndex; } mov->LocalTransform.SetTranslate(pos); numValidChild++; } } return numValidChild;}
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:49,
示例20: MakePerspectiveProjection//----------------------------------------------------------------------------void HMatrix::MakePerspectiveProjection (const APoint& origin, const AVector& normal, const APoint& eye){ // +- -+ // M = | Dot(N,E-P)*I - E*N^T -(Dot(N,E-P)*I - E*N^T)*E | // | -N^t Dot(N,E) | // +- -+ // // where E is the eye point, P is a point on the plane, and N is a // unit-length plane normal. float dotND = normal.Dot(eye - origin); mEntry[ 0] = dotND - eye[0]*normal[0]; mEntry[ 1] = -eye[0]*normal[1]; mEntry[ 2] = -eye[0]*normal[2]; mEntry[ 3] = -(mEntry[0]*eye[0] + mEntry[1]*eye[1] + mEntry[2]*eye[2]); mEntry[ 4] = -eye[1]*normal[0]; mEntry[ 5] = dotND - eye[1]*normal[1]; mEntry[ 6] = -eye[1]*normal[2]; mEntry[ 7] = -(mEntry[4]*eye[0] + mEntry[5]*eye[1] + mEntry[6]*eye[2]); mEntry[ 8] = -eye[2]*normal[0]; mEntry[ 9] = -eye[2]*normal[1]; mEntry[10] = dotND- eye[2]*normal[2]; mEntry[11] = -(mEntry[8]*eye[0] + mEntry[9]*eye[1] + mEntry[10]*eye[2]); mEntry[12] = -normal[0]; mEntry[13] = -normal[1]; mEntry[14] = -normal[2]; mEntry[15] = eye.Dot(normal);}
开发者ID:evanw,项目名称:cs224final,代码行数:31,
示例21: PositionToIndex//-----------------------------------------------------------------------------int CellSpace::PositionToIndex(const APoint &pos) const{ float posA = pos.X(); float posB = pos.Y(); int index = (int)(posA / mCellLength) + ((int)(posB / mCellWidth) * mNumCellsLength); if (index > (int)mCells.size() - 1) index = (int)mCells.size() - 1; if (index < 0) index = 0; return index;}
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:17,
示例22: MakeReflection//----------------------------------------------------------------------------void HMatrix::MakeReflection (const APoint& origin, const AVector& normal){ // +- -+ // M = | I-2*N*N^T 2*Dot(N,P)*N | // | 0^T 1 | // +- -+ // // where P is a point on the plane and N is a unit-length plane normal. float twoDotNO = 2.0f*origin.Dot(normal); mEntry[ 0] = 1.0f - 2.0f*normal[0]*normal[0]; mEntry[ 1] = -2.0f*normal[0]*normal[1]; mEntry[ 2] = -2.0f*normal[0]*normal[2]; mEntry[ 3] = twoDotNO*normal[0]; mEntry[ 4] = -2.0f*normal[1]*normal[0]; mEntry[ 5] = 1.0f - 2.0f*normal[1]*normal[1]; mEntry[ 6] = -2.0f*normal[1]*normal[2]; mEntry[ 7] = twoDotNO*normal[1]; mEntry[ 8] = -2.0f*normal[2]*normal[0]; mEntry[ 9] = -2.0f*normal[2]*normal[1]; mEntry[10] = 1.0f - 2.0f*normal[2]*normal[2]; mEntry[11] = twoDotNO*normal[2]; mEntry[12] = 0.0f; mEntry[13] = 0.0f; mEntry[14] = 0.0f; mEntry[15] = 1.0f;}
开发者ID:evanw,项目名称:cs224final,代码行数:29,
示例23: //----------------------------------------------------------------------------HPlane::HPlane (const AVector& normal, const APoint& p){ mTuple[0] = normal[0]; mTuple[1] = normal[1]; mTuple[2] = normal[2]; mTuple[3] = -p.Dot(normal);}
开发者ID:SylviaTanenbaum,项目名称:3d-simulation-and-game,代码行数:8,
示例24: IsPointIn//----------------------------------------------------------------------------bool TriggerActor::IsPointIn(const PX2::APoint &point) const{ Transform trans = WorldTransform; APoint localPoint = trans.Inverse() * point; if (mAreaType == AT_SPHERE) { Sphere3f sphere; sphere.Radius = mAreaParam[0]; if (InSphere<float>(localPoint, sphere)) return true; } else if (mAreaType == AT_BOX) { Box3f box; box.Extent[0] = mAreaParam[0]; box.Extent[1] = mAreaParam[1]; box.Extent[2] = mAreaParam[2]; if (localPoint.X() >= -box.Extent[0] && localPoint.Y() >= -box.Extent[1] && localPoint.Z() >= -box.Extent[2] && localPoint.X() <= box.Extent[0] && localPoint.Y() <= box.Extent[1] && localPoint.Z() <= box.Extent[2]) return true; } return false;}
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:32,
示例25: FitViewHorizontally//----------------------------------------------------------------------------void EditRenderView_TimeLine::FitViewHorizontally(){ if (!mRenderStep) return; Camera *camera = mRenderStep->GetCamera(); float inMin = Mathf::MAX_REAL; float inMax = -Mathf::MAX_REAL; PX2_EDIT.GetTimeLineEdit()->GetInRange(inMin, inMax); float inLength = inMax - inMin; bool inLenghtZero = false; if (inLength == 0.0f) { inLength = 10.0f; inLenghtZero = true; } float rightWidth = (float)mSize.Width - mLeftWidth; float leftOverWidth = (float)mLeftWidth / (float)mSize.Width; float allOverRight = (float)mSize.Width / rightWidth; inLength *= allOverRight; float dMin = 0.0f; float dMax = 0.0f; float uMin = 0.0f; float uMax = 0.0f; float rMin = 0.0f; float rMax = 0.0f; camera->GetFrustum(dMin, dMax, uMin, uMax, rMin, rMax); rMax = inLength / 2.0f * 1.5f; rMin = -rMax; camera->SetFrustum(dMin, dMax, uMin, uMax, rMin, rMax); APoint pos = camera->GetPosition(); if (inLenghtZero) pos.X() = inMin; else pos.X() = inMin + inLength / 2.0f - inLength*leftOverWidth; mUIViewGrid->GetCameraNode()->LocalTransform.SetTranslate(pos); mUIViewGrid->GetCameraNode()->Update(GetTimeInSeconds(), 0.0f); _RefreshGrid(true);}
开发者ID:bobbyzhu,项目名称:Phoenix3D,代码行数:46,
示例26: SetScale//----------------------------------------------------------------------------void Transform::SetScale (const APoint& scale){ if (scale.X()==scale.Y() && scale.Y()==scale.Z()) { SetUniformScale(scale.X()); } else { assertion(mIsRSMatrix, "Matrix is not a rotation/n"); assertion(scale[0] != 0.0f && scale[1] != 0.0f && scale[2] != 0.0f, "Scales must be nonzero/n"); mScale = scale; mIsIdentity = false; mIsUniformScale = false; UpdateHMatrix(); }}
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:19,
示例27: dlg//----------------------------------------------------------------------------void E_MainFrame::TimeLine_SelectCtrl_OutValue(){ CurveCtrl *ctrl = PX2_EDIT.GetTimeLineEdit()->GetSelectedCurveCtrl(); if (!ctrl) return; DlgSetCurveVal dlg(mTimeLineView); dlg.SetVal(ctrl->GetOutVal().Z()); dlg.SetTitle(PX2_LM.GetValue("SetOutValue")); dlg.SetLabel(PX2_LM.GetValue("NewOutValue")); if (dlg.ShowModal() == wxID_OK) { float val = dlg.GetVal(); APoint outVal = ctrl->GetOutVal(); outVal.Z() = val; ctrl->SetOutVal(outVal); }}
开发者ID:gstariarch,项目名称:Phoenix3D,代码行数:19,
示例28: OnMouseWheel//----------------------------------------------------------------------------void EU_CanvasStage::OnMouseWheel(const APoint &worldPos, float delta){ if (!IsEnable()) return; const Rectf &rectWorld = GetWorldRect(); if (!rectWorld.IsInsize(worldPos.X(), worldPos.Z())) return; UICanvas::OnMouseWheel(worldPos, delta); float delta1 = delta * 0.003f * PX2_EDIT.GetCameraMoveSpeed(); _ZoomCamera(delta1); if (mSceneNodeCtrl) { Camera *camera = mSceneNodeCtrlCanvas->GetOverCamera(); mSceneNodeCtrl->OnMouseWheel(camera, delta1, GetSize()); }}
开发者ID:PhoenixSteam,项目名称:Phoenix3D,代码行数:21,
注:本文中的APoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ARDrone类代码示例 C++ APlayerController类代码示例 |