zoukankan      html  css  js  c++  java
  • cocos2dx实现3d拾取注意事项

    用的是cocos2dx 3.x,如果是真机测试,glview = cocos2d::GLViewImpl::createWithRect(...)和glview->setDesignResolutionSize(...)都得传设备的分辨率,才能使拾取的结果正确。

    bool AppDelegate::applicationDidFinishLaunching()

    {

        // initialize director

        auto director = Director::getInstance();

        auto glview = director->getOpenGLView();

    #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32||CC_TARGET_PLATFORM == CC_PLATFORM_MAC)

        auto size = CCSize(1136,640);

    #else

        auto size = glview->getVisibleSize();

    #endif

        

        if(!glview) {

            glview = cocos2d::GLViewImpl::createWithRect("HelloWorld", Rect(0,0,size.width,size.height));//Rect(0,0,900,640));

            director->setOpenGLView(glview);

        }

        

        // set FPS. the default value is 1.0/60 if you don't call this

        director->setAnimationInterval(1.0 / 60);

        glview->setDesignResolutionSize(size.width,

                                        size.height,

                                        kResolutionShowAll);

        director->runWithScene(HelloWorld::scene());

        return true;

    }

  • 相关阅读:
    网站迁移服务器后CPU、内存飙升,设置robots.txt 问题
    System.Web.Mvc 找到的程序集清单定义与程序集引用不匹配
    滑动窗口协议
    TCP拥塞控制
    计网常用协议
    TCP协议中的三次握手、四次挥手
    浏览网页的详细过程
    docker网络模式
    openstack网络
    查找算法
  • 原文地址:https://www.cnblogs.com/wantnon/p/4224961.html
Copyright © 2011-2022 走看看