这篇教程C++ GetTransform函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetTransform函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTransform函数的具体用法?C++ GetTransform怎么用?C++ GetTransform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetTransform函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetClientRectvoid CTinyCadView::SetScrollCentre(CDPoint c){ CRect rect; CDPoint p; GetClientRect(rect); p = GetTransform().DeScale(GetCurrentDocument()->m_snap, CPoint(rect.right / 2, rect.bottom / 2)); SetScroll(GetTransform().GetOrigin().x + c.x - p.x, GetTransform().GetOrigin().y + c.y - p.y);}
开发者ID:soloveyhappy,项目名称:tiny,代码行数:9,
示例2: GetTransformvoid VelocityRotator::Update(float dt){ if (body != nullptr) { XMFLOAT3 rot = GetTransform().GetRotation(); XMFLOAT4 velo = body->GetVelocity(); rot.z -= velo.x * speedScale * dt; rot.x += velo.z * speedScale * dt; GetTransform().SetRotation(rot); }}
开发者ID:QRayarch,项目名称:ShootyBally,代码行数:11,
示例3: CameraComponentvoid FixedCamera::Initialize(){ //Camera Component m_pCamera = new CameraComponent(); AddComponent(m_pCamera); GetTransform()->Translate(2.5, -2, -2.5f); GetTransform()->RotateEuler(0, glm::radians(45.f), 0); GetTransform()->RotateEuler(glm::radians(20.f), 0, glm::radians(20.f));}
开发者ID:Illation,项目名称:GLFramework,代码行数:11,
示例4: GetTransformMatrix4f Camera::GetViewProjection() const{ //This comes from the conjugate rotation because the world should appear to rotate //opposite to the camera's rotation. Matrix4f cameraRotation = GetTransform().GetTransformedRot().Conjugate().ToRotationMatrix(); //Similarly, the translation is inverted because the world appears to move opposite //to the camera's movement. Matrix4f cameraTranslation = Matrix4f().InitTranslation(GetTransform().GetTransformedPos() * -1); return m_projection * cameraRotation * cameraTranslation;}
开发者ID:MrShedman,项目名称:GL-Dev,代码行数:12,
示例5: GetTransformvoid FreeLook::ProcessInput(const Input& input, float delta){ if (input.GetKeyUp(Input::KEY_LEFT)) { GetTransform()->Rotate(PxQuat(ToRadians(-90.0f), PxVec3(0, 1, 0))); } if (input.GetKeyUp(Input::KEY_RIGHT)) { GetTransform()->Rotate(PxQuat(ToRadians(90.0f), PxVec3(0, 1, 0))); }}
开发者ID:KumaKing,项目名称:Sem5AliMaze,代码行数:13,
示例6: GetTransformvoid TransformNDOF::GetJacobian(const scalarArray &q, se3Array &J){ SE3 T = GetTransform(q); scalarArray dq(m_iDOF); for ( int i = 0; i < m_iDOF; i++ ) dq[i] = q[i]; for ( int i = 0; i < m_iDOF; i++ ) { dq[i] += m_rEPS; J[i] = (SCALAR_1 / m_rEPS) * Linearize(T % GetTransform(dq)); dq[i] -= m_rEPS; }}
开发者ID:snumrl,项目名称:DataDrivenBipedController,代码行数:13,
示例7: GetTransformvoid ABaseCharacter::CheckAttackOverlap(){ //Overlapping actors for each box spawned will be stored here TArray<struct FOverlapResult> OutActorOverlaps; //Hit other actors only once TArray<AActor*> ProcessedActors; //The initial rotation of our box is the same as our character rotation FQuat Rotation = GetTransform().GetRotation(); FVector Start = GetTransform().GetLocation() + Rotation.Rotator().Vector() * 100.0f; FCollisionShape CollisionHitShape; FCollisionQueryParams CollisionParams; //We do not want the character to hit itself, don't store this character in the array, to ignore it's collision CollisionParams.AddIgnoredActor(this); //Set the channels that will respond to the collision FCollisionObjectQueryParams CollisionObjectTypes; CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_PhysicsBody); CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_Pawn); //CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_WorldStatic); // uncomment to enable bashing objects //Create the box and get the overlapping actors CollisionHitShape = FCollisionShape::MakeBox(AttackBox); GetWorld()->OverlapMulti(OutActorOverlaps, Start, Rotation, CollisionHitShape, CollisionParams, CollisionObjectTypes); AActor* ActorToProcess; //Process all hit actors for (int i = 0; i < OutActorOverlaps.Num(); ++i) { ActorToProcess = OutActorOverlaps[i].GetActor(); //We process each actor only once per Attack execution if (ActorToProcess && !ProcessedActors.Contains(ActorToProcess)) { //Add this actor to the array because we are spawning one box per tick and we don't want to hit the same actor twice during the same attack animation ProcessedActors.AddUnique(ActorToProcess); if ( dynamic_cast<APatrollingEnemyCharacter*>(ActorToProcess) ){ APatrollingEnemyCharacter* ennemy = (APatrollingEnemyCharacter*)ActorToProcess; ennemy->OnHit(this); } } }}
开发者ID:trinitea,项目名称:NightmareNeverEnds,代码行数:49,
示例8: GetTransformvoid ABomb::SimulateExplosionFX_Implementation(){ if (ExplosionFX) { UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ExplosionFX, GetTransform(), true); }}
开发者ID:orfeasel,项目名称:UE4-Game-Systems,代码行数:7,
示例9: GetOpenGLContext//TODO: need refine!!!void ctLineBorders::Draw(){ //if(!rectDotIndexes) return; //glDisable(GL_DEPTH_TEST); GetOpenGLContext()->functions()->glBindBuffer(GL_ARRAY_BUFFER, meshVBO); if (posAtribLoc != -1) { GetOpenGLContext()->functions()->glVertexAttribPointer(posAtribLoc, 3, GL_FLOAT, GL_FALSE, (3 * sizeof(GLfloat)), (const GLvoid*)0); GetOpenGLContext()->functions()->glEnableVertexAttribArray(posAtribLoc); } else {qDebug()<<"isShit pos!!!";} m_currentShader->bind(); m_currentShader->setUniformValue(matrixUniform, GetProjectionMatrix().GetMatrix()); m_currentShader->setUniformValue(materialUniform, GetMaterial()->GetRGBA()); m_currentShader->setUniformValue(transformMatrixUniform, GetTransform()->GetGlobalTransformMatrix().GetMatrix()); glDrawElements(GL_LINE_LOOP, m_dots.count(), GL_UNSIGNED_SHORT, planeIndexes); GetOpenGLContext()->functions()->glBindBuffer(GL_ARRAY_BUFFER, 0); m_currentShader->release();}
开发者ID:vdoom,项目名称:TestAssignment,代码行数:27,
示例10: GetTransformvoidGeometryGroup::Draw (cairo_t *cr){ Transform *transform = GetTransform (); cairo_matrix_t saved; cairo_get_matrix (cr, &saved); if (transform) { cairo_matrix_t matrix; transform->GetTransform (&matrix); cairo_transform (cr, &matrix); } GeometryCollection *children = GetChildren (); Geometry *geometry; // GeometryGroup is used for Clip (as a Geometry) so Fill (normally setting the fill rule) is never called cairo_set_fill_rule (cr, convert_fill_rule (GetFillRule ())); int children_count = children->GetCount (); for (int i = 0; i < children_count; i++) { geometry = children->GetValueAt (i)->AsGeometry (); geometry->Draw (cr); } cairo_set_matrix (cr, &saved);}
开发者ID:kangaroo,项目名称:moon,代码行数:28,
示例11: UNREFERENCED_PARAMETERvoid Iglo::Initialize(const GameContext& gameContext){ UNREFERENCED_PARAMETER(gameContext); // ADD MODEL auto physX = PhysxManager::GetInstance()->GetPhysics(); auto igloModelComponent = new ModelComponent(L"./Resources/Meshes/Iglo.ovm"); auto igloMaterial = new DiffuseMaterial(); igloMaterial->SetDiffuseTexture(L"./Resources/Textures/Iglo.jpg"); gameContext.pMaterialManager->AddMaterial(igloMaterial, 1); igloModelComponent->SetMaterial(1); AddComponent(igloModelComponent); auto rigidbody = new RigidBodyComponent(); rigidbody->SetKinematic(true); AddComponent(rigidbody); auto defaultMaterial = physX->createMaterial(0.5f, 0.5f, 0.1f); auto igloMesh = ContentManager::Load<PxTriangleMesh>(L"./Resources/Meshes/Iglo.ovpt"); shared_ptr<PxGeometry> igloGeo(new PxTriangleMeshGeometry(igloMesh)); auto IgloCollider = new ColliderComponent(igloGeo, *defaultMaterial); AddComponent(IgloCollider); GetTransform()->Translate(m_Position);}
开发者ID:BartyTurbo,项目名称:Arctic-Defence-3D-,代码行数:30,
示例12: LoadTexturevoid Cube::Render(LPDIRECT3DDEVICE9 pd3dDevice, DWORD dwAttribId) { // Set texture if (!m_pTexture) { m_pTexture = LoadTexture(pd3dDevice, "snow.bmp"); } std::map<int, DWORD> mDwRenderState; pd3dDevice->SetTransform(D3DTS_WORLD, GetTransform()); if (m_bBlending) { DWORD dwState; pd3dDevice->GetRenderState(D3DRS_ALPHABLENDENABLE, &dwState); mDwRenderState[D3DRS_SRCBLEND] = dwState; pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); pd3dDevice->GetRenderState(D3DRS_SRCBLEND, &dwState); mDwRenderState[D3DRS_SRCBLEND] = dwState; pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); pd3dDevice->GetRenderState(D3DRS_DESTBLEND, &dwState); mDwRenderState[D3DRS_DESTBLEND] = dwState; pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); } /*else { pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); pd3dDevice->SetRenderState(D3DRS_ZENABLE, TRUE); } */ pd3dDevice->SetMaterial(&m_d3dMaterial); pd3dDevice->SetTexture(0, m_pTexture); m_pMesh->DrawSubset(dwAttribId); if (m_bBlending) { for (auto &it : mDwRenderState) { pd3dDevice->SetRenderState((D3DRENDERSTATETYPE)it.first, it.second); } }}
开发者ID:H56,项目名称:Snowman,代码行数:34,
示例13: OnTick void AudioListener::OnTick() { if (!m_audio) return; m_audio->SetListenerTransform(GetTransform()); }
开发者ID:PanosK92,项目名称:Directus3D,代码行数:7,
示例14: GetTransform void Camera::UpdateMatrix() { int width = Screen::GetWidth(); int height = Screen::GetHeight(); auto transform = GetTransform(); m_view_matrix = Matrix4x4::LookTo( transform->GetPosition(), transform->GetForward(), transform->GetUp()); if(!m_orthographic) { m_projection_matrix = Matrix4x4::Perspective(m_field_of_view, width / (float) height, m_near_clip_plane, m_far_clip_plane); } else { float top = m_orthographic_size; float bottom = -m_orthographic_size; float plane_h = m_orthographic_size * 2; float plane_w = plane_h * (width * m_rect.width) / (height * m_rect.height); m_projection_matrix = Matrix4x4::Ortho(-plane_w/2, plane_w/2, bottom, top, m_near_clip_plane, m_far_clip_plane); } m_view_projection_matrix = m_projection_matrix * m_view_matrix; }
开发者ID:JCGit,项目名称:Galaxy3D,代码行数:26,
示例15: GetTransformvoid CInstanceMesh::Render(){ if ( !mStaticMesh || !GetActive() ) return; Math::Mat44f lTransform = GetTransform(); mCenter = lTransform* mStaticMesh->GetAABB().GetCenter(); if( mIsDynamic ) { mPhysicActor->GetMat44( lTransform ); Math::Vect3f lUp( 0.0f, -mStaticMesh->GetAABB().GetCenter().y, 0.0f ); Math::Mat44f lCenterTransform; lCenterTransform.SetIdentity(); lCenterTransform.Translate( lUp ); lTransform = lTransform * lCenterTransform; } CFrustum lCameraFrustum = CameraMInstance->GetCurrentCamera()->GetFrustum(); CGraphicsManager* lGM = GraphicsInstance; if ( lCameraFrustum.SphereVisible( D3DXVECTOR3( mCenter.u ), mRadius ) ) { lGM ->SetTransform( lTransform ); mStaticMesh->Render( lGM ); lGM ->SetTransform( Math::Mat44f() ); }}
开发者ID:mvuab-g1-14-15,项目名称:AlmostHuman,代码行数:29,
示例16: GetTransformvoid Camera::OneFrame(float delta) { InputSystem &is = *Engine::GetSingleton()->GetInputSystem(); int delta_x = is.GetMouseXMove(); int delta_y = is.GetMouseYMove(); GetTransform()->Rotate(delta_x/1000.0f, -delta_y/1000.0f, 0.0f); if(mouse_reset) { float mouse_x_p = is.GetMouseXPercent(), mouse_y_p = is.GetMouseYPercent(); if(mouse_x_p<0.4f || mouse_x_p>0.6f || mouse_y_p<0.4f || mouse_y_p>0.6f ) { is.SetMousePositionPercent(0.5f, 0.5f); } } if(is.IsKeyDown(InputSystem::K_W)) { TranslateForward(20.0f*delta); } else if(is.IsKeyDown(InputSystem::K_S)) { TranslateForward(-20.0f*delta); } if(is.IsKeyDown(InputSystem::K_D)) { TranslateRight(20.0f*delta); } else if(is.IsKeyDown(InputSystem::K_A)) { TranslateRight(-20.0f*delta); }}
开发者ID:weidaru,项目名称:engine,代码行数:27,
示例17: GetActorLocationvoid AMobileEnemy::BeginPlay() { Super::BeginPlay(); m_totalDistance = RightDistance + LeftDistance; m_currentDistance = LeftDistance; m_actualJumpSpeed = 0.0f; m_capsuleHeight = CapsuleComponent->GetScaledCapsuleHalfHeight(); m_capsuleRadious = CapsuleComponent->GetScaledCapsuleRadius(); m_capsuleHeightPadding = m_capsuleHeight * PADDING_ENEMY_COLLISION_PERCENT; m_capsuleRadiousPadding = m_capsuleRadious * 0.55f; m_lastPosition = GetActorLocation(); m_nextPosition = m_lastPosition; m_rightVector = GetActorRightVector(); { FVector right = GetActorRightVector(); right = right; m_rightPosition = (m_lastPosition + RightDistance * right) * right; m_leftPosition = (m_lastPosition + LeftDistance * -right) * right; } m_isMoving = !HasTrigger; m_initialMovement = m_isMoving; m_initialStatus = GetTransform(); if (Fly) m_enableGravity = false; RegisterDelegate();}
开发者ID:alfreSosa,项目名称:PC-TowardsTheLight,代码行数:25,
示例18: FObjectActionvoid ABrainNormalInteractiveObject::BeginPlay(){ Super::BeginPlay(); int8 flags = (_canBeRotate ? EAction::ROTATE : 0) | (_canBeTranslate ? EAction::TRANSLATE : 0) | (_canBeScale ? EAction::SCALE : 0) | (_canBeShear ? EAction::SHEAR : 0); _actions = FObjectAction(flags); // Init Rotate _currentRotation = GetActorRotation(); _targetRotation = GetActorRotation(); // Init Translate _currentTranslation = GetActorLocation(); _targetTranslation = GetActorLocation(); // Init Scale _targetScale = _initScale; _currentScale = _initScale; // Init Shear _currentShearFirstAxis = 0; _currentShearSecondAxis = 0; _targetShearFirstAxis = 0; _targetShearSecondAxis = 0; _cachedTransform = GetTransform(); if (this->GetClass()->ImplementsInterface(UBrainSaveInterface::StaticClass())) Load();}
开发者ID:gamer08,项目名称:prog,代码行数:33,
示例19: GetTransformvoid Blast::OnTriggerStay(EDGameCore::ICollider* thisCollider, EDGameCore::ICollider* otherCollider, const EDCollision::Contact& contact){ if( otherCollider->GetAttachedRigidBody() != 0 ) { EDCollision::Contact contact2 = contact; Float3 delta = otherCollider->GetTransform()->GetWorldMatrix().WAxis - GetTransform()->GetWorldMatrix().WAxis; if( DotProduct( delta, contact.Normal ) < 0.0f ) contact2.negate(); float mag = delta.magnitude(); if( mag == 0.0f ) { delta = Float3(0.0f, 1.0f, 0.0f); mag = 1.0f; } else delta *= (1.0f / mag); delta *= 15000.0f / (mag*mag); delta *= (1.0f / EDGameCore::Game::GetDeltaTime()); otherCollider->GetAttachedRigidBody()->ApplyForceAtPoint( delta, contact2.Point[0] ); }}
开发者ID:Burnsidious,项目名称:FSGDEngine,代码行数:27,
示例20: Subdivide/*! Subdivides the mesh uniformly one step*/void LoopSubdivisionMesh::Subdivide(){ // Create new mesh and copy all the attributes HalfEdgeMesh subDivMesh; subDivMesh.SetTransform(GetTransform()); subDivMesh.SetName(GetName()); subDivMesh.SetColorMap(GetColorMap()); subDivMesh.SetWireframe(GetWireframe()); subDivMesh.SetShowNormals(GetShowNormals()); subDivMesh.SetOpacity(GetOpacity()); if (IsHovering()) subDivMesh.Hover(); if (IsSelected()) subDivMesh.Select(); subDivMesh.mMinCMap = mMinCMap; subDivMesh.mMaxCMap = mMaxCMap; subDivMesh.mAutoMinMax = mAutoMinMax; // loop over each face and create 4 new ones for (unsigned int i=0; i<mFaces.size(); i++){ // subdivide face std::vector< std::vector<Vector3<float> > > faces = Subdivide(i); // add new faces to subDivMesh for(unsigned int j=0; j<faces.size(); j++){ subDivMesh.AddFace(faces.at(j)); } } // Assigns the new mesh *this = LoopSubdivisionMesh(subDivMesh, ++mNumSubDivs); Update();}
开发者ID:marcusstenbeck,项目名称:tnm079-labs,代码行数:34,
示例21: GetViewMatrixS2Matrix4x4 Camera::GetViewMatrix() const { const Transform &trans = *GetTransform(); //Use spherical coordinate for forward vector. const S2Vector3 & rotate = trans.GetRotate(); float theta = rotate[0], phi = rotate[1]; phi = phi > 1.57f ? 1.57f : phi; phi = phi < -1.57f ? -1.57f : phi; S2Vector3 zaxis(sin(theta)*cos(phi), sin(phi), cos(theta)*cos(phi)); S2Vector3 xaxis = S2Vector3(0.0f, 1.0f, 0.0f).Cross(zaxis); xaxis.Normalize(); S2Vector3 yaxis = zaxis.Cross(xaxis); S2Vector3 position = trans.GetTranslate(); float p_dot_x = position.Dot(xaxis); float p_dot_y = position.Dot(yaxis); float p_dot_z = position.Dot(zaxis); return S2Matrix4x4( xaxis[0], xaxis[1], xaxis[2], -p_dot_x, yaxis[0], yaxis[1], yaxis[2], -p_dot_y, zaxis[0], zaxis[1], zaxis[2], -p_dot_z, 0.0f, 0.0f, 0.0f, 1.0f );}
开发者ID:weidaru,项目名称:engine,代码行数:26,
示例22: LoadTexturevoid Terrain::Render(LPDIRECT3DDEVICE9 pd3dDevice, DWORD dwAttribId) { if (!m_pTexture) { LoadTexture(); } pd3dDevice->SetTransform(D3DTS_WORLD, GetTransform()); m_pd3dDevice->SetTexture(0, m_pTexture); m_pd3dDevice->SetMaterial(&m_d3dMaterial); m_pd3dDevice->SetStreamSource(0, m_pVertexBuffer, 0, sizeof(Vertex)); m_pd3dDevice->SetFVF(Vertex::FVF_Flags | D3DFVF_NORMAL); m_pd3dDevice->SetIndices(m_pIndexBuffer); // m_pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE); // m_pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld); m_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP, 0, 0, m_uNumVertices, 0, m_uNumIndices - 2); // m_pd3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE); // m_pd3dDevice->SetTexture(0, 0); if (m_bRenderFrame) { m_pd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); m_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, m_uNumVertices, 0, m_uNumIndices - 2); m_pd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); }}
开发者ID:H56,项目名称:Snowman,代码行数:31,
示例23: GetPositionvoid mtsOSGBody::Body::UpdateTransform(){ if( GetPosition.IsValid() ){ // Get the position of the camera prmPositionCartesianGet prmRt; GetPosition( prmRt ); bool valid = false; prmRt.GetValid( valid ); // Set the transformation if( valid ) { SetTransform( prmRt.Position() ); } } // Update the transformation osaOSGBody::UpdateTransform(); { prmPositionCartesianSet prmRt; prmRt.SetGoal( GetTransform() ); bool valid = true; prmRt.SetValid( valid ); SetPosition( prmRt ); }}
开发者ID:jhu-saw,项目名称:sawOpenSceneGraph,代码行数:30,
示例24: switchvoid Character::InitTeamPosition(){ switch ( m_Team ) { case TeamColor::RED: GetTransform()->SetPosition( RED_TEAM_POSITION + PLAYER_POSITIONS[m_CharacterId] ); GetTransform()->SetRotation( RED_TEAM_ROTATION ); break; case TeamColor::BLUE: GetTransform()->SetPosition( BLUE_TEAM_POSITION + PLAYER_POSITIONS[m_CharacterId] ); GetTransform()->SetRotation( BLUE_TEAM_ROTATION ); break; default: break; }}
开发者ID:NHNNEXT,项目名称:2014-01-HUDIGAME-skyLab,代码行数:16,
示例25: UpdateLayoutvoid HorizontalLayout::Draw(DrawingContext & drawingContext){ UpdateLayout(); POMDOG_ASSERT(!needToUpdateLayout); auto transform = GetTransform() * drawingContext.Top();#if 0 renderCommand.SetInvoker([transform, this](PrimitiveBatch& primitiveBatch) { const Color backgroundColor = {45, 45, 48, 225}; const Color borderColor = {40, 40, 40, 255}; const Color highlightColor = {106, 106, 106, 255}; const auto width = static_cast<float>(GetWidth()); const auto height = static_cast<float>(GetHeight()); primitiveBatch.DrawRectangle(transform, Vector2::Zero, width, height, backgroundColor); primitiveBatch.DrawLine(transform, Vector2{0.0f, 0.0f}, Vector2{width, 0.0f}, borderColor, 1.0f); primitiveBatch.DrawLine(transform, Vector2{0.0f, 0.0f}, Vector2{0.0f, height}, borderColor, 1.0f); primitiveBatch.DrawLine(transform, Vector2{0.0f, height}, Vector2{width, height}, borderColor, 1.0f); primitiveBatch.DrawLine(transform, Vector2{width, 0.0f}, Vector2{width, height}, borderColor, 1.0f); }); drawingContext.PushCommand(renderCommand);#endif drawingContext.Push(transform); for (auto & child : children) { POMDOG_ASSERT(child); child->Draw(drawingContext); } drawingContext.Pop();}
开发者ID:mogemimi,项目名称:pomdog,代码行数:35,
示例26: TRACE_ENTERvoid EdgeActor::DrawEdge(){ TRACE_ENTER(); if(geode && geode->getDrawable(0)) geode->removeDrawable(geode->getDrawable(0)); osg::Geometry *g = new osg::Geometry; osg::Vec3Array *v = new osg::Vec3Array; // Get the position (translation) of the Edge Actor relative to the origin. dtCore::Transform edgeActorTrans; GetTransform(edgeActorTrans); osg::Vec3 edgeActorPos = edgeActorTrans.GetTranslation(); v->push_back(headPos-edgeActorPos); v->push_back(tailPos-edgeActorPos); osg::DrawArrays *da = new osg::DrawArrays(osg::PrimitiveSet::LINES,0,v->size()); g->setVertexArray(v); g->addPrimitiveSet(da); geode->addDrawable(g); geode->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); GetMatrixNode()->addChild(geode); TRACE_EXIT();}
开发者ID:akbardotinfo,项目名称:watcher-visualization,代码行数:25,
示例27: GetTransformvoid CScriptPlayerActor::Render(const CStateManager& mgr) const { bool phazonSuit = x2e8_suitRes.GetCharacterNodeId() == 3; if (phazonSuit) { // Draw into alpha buffer CModelFlags flags = xb4_drawFlags; flags.x4_color = zeus::skWhite; flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr); x64_modelData->Render(which, x34_transform, x90_actorLights.get(), flags); } CPhysicsActor::Render(mgr); if (x314_beamModelData && !x314_beamModelData->IsNull() && x64_modelData && !x64_modelData->IsNull()) { zeus::CTransform modelXf = GetTransform() * x64_modelData->GetScaledLocatorTransform("GUN_LCTR"); CModelFlags flags(5, 0, 3, zeus::skWhite); flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags); flags.m_extendedShader = EExtendedShader::Lighting; flags.x4_color = zeus::CColor{1.f, xb4_drawFlags.x4_color.a()}; x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags); } if (phazonSuit) { zeus::CVector3f vecFromCam = GetBoundingBox().center() - mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation(); float radius = zeus::clamp(0.25f, (6.f - vecFromCam.magnitude()) / 6.f, 2.f); float offsetX = std::sin(x34c_phazonOffsetAngle); float offsetY = std::sin(x34c_phazonOffsetAngle) * 0.5f; g_Renderer->DrawPhazonSuitIndirectEffect(zeus::CColor(0.1f, 1.f), x338_phazonIndirectTexture, zeus::skWhite, radius, 0.05f, offsetX, offsetY); }}
开发者ID:AxioDL,项目名称:urde,代码行数:33,
示例28: UNREFERENCED_PARAMETERvoid ParticleScene::Initialize(const GameContext& gameContext){ UNREFERENCED_PARAMETER(gameContext); m_pRootObject = new GameObject(); AddChild(m_pRootObject); auto particleObj = new GameObject(); auto particleEmitter = new ParticleEmitterComponent(L"./Resources/Textures/Smoke.png", 60); particleEmitter->SetVelocity(XMFLOAT3(0, 6.0f, 0)); particleEmitter->SetMinSize(1.0f); particleEmitter->SetMaxSize(2.0f); particleEmitter->SetMinEnergy(1.0f); particleEmitter->SetMaxEnergy(2.0f); particleEmitter->SetMinSizeGrow(3.5f); particleEmitter->SetMaxSizeGrow(5.5f); particleEmitter->SetMinEmitterRange(0.2f); particleEmitter->SetMaxEmitterRange(0.5f); particleEmitter->SetColor(XMFLOAT4(1.f, 1.f, 1.f, 0.6f)); particleObj->AddComponent(particleEmitter); m_pRootObject->AddChild(particleObj); auto mat = new ColorMaterial(); gameContext.pMaterialManager->AddMaterial(mat, 103); auto modelObj = new GameObject(); auto model = new ModelComponent(L"./Resources/Meshes/Teapot.ovm"); model->SetMaterial(103); modelObj->AddComponent(model); m_pRootObject->AddChild(modelObj); modelObj->GetTransform()->Scale(0.2f, 0.2f, 0.2f);}
开发者ID:BartyTurbo,项目名称:Arctic-Defence-3D-,代码行数:32,
注:本文中的GetTransform函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetTransientPackage函数代码示例 C++ GetTransactionSnapshot函数代码示例 |