zoukankan      html  css  js  c++  java
  • 成都某公司笔试题

    答案不用看了,我自己写的,面试机会都没有
     
     
    • 请比较一下中的Dictionary类与List类(效率,特点,实用场合)。
       
      List效率更高,所以当数据量很大时用list更能节约时间,Dictionary效率低,查找快,所以需要快速查找,数据量小时,用dictionary
       
       
       
       
       
    • 编程题,Dictionary<int,Item>dicItems中含有m个元素,请写一个方法,实现移除指定值项。
      Public static void RemoveItems(Dictionary<int,Item>dicItems, Item item)
      {
       
      用foreach语句,拿第二个参数“item”和dictionary的item做比较,当相等时删除对应的dictionary中的数据
       
       
       
       
      }
    • 编程题,设从原点到A点, 要求在totalTime时间内以匀加速度到达,求从A点出发后经过elaspe时间后的位置。
    Public static Vector3GetDistance(Vector3 target, float totalTime, float elapse)
    {
    //TargetA的位置
                       Vector3 pos=target;
                       //因为是匀加速,所以在三个方向都是匀加速,s=a*time*time
             
                       pos.x+=pos.x*(elaspe/totalTime)*(elaspe/totalTime);
                       pos.y+=pos.y*(elaspe/totalTime)*(elaspe/totalTime);
                       pos.z+=pos.z*(elaspe/totalTime)*(elaspe/totalTime);
     
    //返回经过elaspe时间的位置
                       returnpos;
     
    }
    • 翻译题,请将下列Unity3D官方文档翻译成中文
    • Once a rigidbody is moving at less than acertain minimum linear or rotational speed, the physics engine will assume ithas come to a halt. When this happens, the object will not move again until itreceives a collision or force and so it will be set to “sleeping” mode. Thisoptimisation means that no processor time will be spent updating the rigidbodyuntil the next time it is “awoken” (ie, set in motion again). For mostpurposes, the sleeping and waking of rigidbodies happens transparently.However, an object might fail to wake up if a static collider (ie, one withouta rigidbody) is moved into it or away from it by modifying the transformposition. This might result, say, in the rigidbody object hanging in the airwhen the floor has been moved out from beneath it. In cases like this, theobject can be woken explicitly using the WakeUp function.
    当一个刚体正以小于某个特定的最小直线速度或者旋转速度运动时,物理引擎将会认为它遇到了障碍物。当这种情况发生时,物体将不再运动除非受到碰撞或者力所以它会被设置成休眠模式。这种模式意味着直到下一次被唤醒前,没有处理时间会被花费在更新这个刚体。在大多数情况下,刚体的休眠和唤醒过渡性的发生。然而,如果一个静态的碰撞器(没有刚体)通过修改变换提的位置,被放入这个物体或者远离这个物体时,这个物体可能不能成功的被唤醒。这可能会导致,当承载某个刚体的地板被移除时,这个刚体悬挂在半空中。像在这种情况中,使用wakeup函数,这个物体将会被唤醒。
     
     
     
     
     
    • 请问,如何实现切换场景数据传递。
     
    1.切换场景Application.LoadLevel();
     
     
     
     
    • 请谈谈Animator与Animation差别与使用。
      Animator是组件?
       
      使用Animation.Play()
       
      Animation.Stop(),还有个动画淡出
       
       
       
       
       
       
       
       
       
    • 谈谈通常Shader中是如何将图片变成灰度图。
     
     
     
     
     
     
     
     
    • 请结合渲染管线,谈谈如何优化unity3d项目。
    • 用低面的模型,可以减少渲染的运算
    • 将不重要的场景,游戏对象降低面数,减少细节。
  • 相关阅读:
    下载视频
    009 逻辑 + MFC CString
    008 浅拷贝与深拷贝
    007 operator
    006 this指针原理
    005 逻辑 + STL list
    004 list::sort
    003 逻辑 + mfc CList
    001 C++历史和思想
    并查集模板
  • 原文地址:https://www.cnblogs.com/123ing/p/3851257.html
Copyright © 2011-2022 走看看