纳金网

标题: Collider for Simulations (Physics Behavior) [打印本页]

作者: Asen    时间: 2011-10-20 15:38
标题: Collider for Simulations (Physics Behavior)






               Collider for Simulations (Physics Behavior)
              









           Summary
         

           Causes the parent object to interact with any Collision Shells in a semi-realistic manner.
         





               Category
              


              Latest Behaviors
            




               Author
              


              Gavin Kistner
            




               Difficulty
              


              (Reference)
            




               Time to Complete
              


              5 Minutes
            








           Downloads
         


            Click Here
           
           to download the associated files.
         


            (This document covers version 3.1.2 of the 'Collider for Simulations' behavior, current as of 2005-Feb-11)
           

            Description
           


             Attach this behavior to an object to cause it to collide with any objects which have the Collision Shell behavior attached.
            

             When an object collides with a collision shell:
            


              the Collision Shell fires a ‘Collided With’ event
            

              this behavior and the object to which it is attached both fire a ‘Collided’ event
            

              the object ‘bounces’ off of the Collision Shell, with the amount of bounce being proportional to the
              
               Elasticity
              
              setting of the Collision Shell behavior
            


             While the polygons of the Collision Shell are used to find the collision, the geometry of the Collider object is
            
              NOT
            
             used. Instead, a ray is projected from the center of the object out to its collision radius, along the direction of movement for the object. It is this ray which is used to detect collisions.
            

             If the
            
              Extra Detection?
            
             advanced property is checked, an additional 6 rays are positioned around the object, offset from its center along the global axes.
            

             It does not matter whether the parent object is moved due to its positionVelocity, or animation/script setting its position directly; the difference between the previous position of the object and its new position is used in all cases to determine whether the object has moved.
            

             Note that the parent object must be in ‘global space’; that is, it may not be attached under any parent element which is rotated scaled, or offset. (No such restriction exists for the shells.)
            

             When the object bounces off an object, the object is set into motion by setting its position velocity. By default, the amount of reflection will be determined by the
            
              Elasticity
            
             property of the shell which was collided with. The
            
              Override Elasticity?
            
             advanced property may be used to set an elasticity which always applies to the collider, regardless of the elasticity of any shell.
            

             Note that the collision detection is only based on the movement of the collider itself,
            
              NOT
            
             the collision shells. If you have a collider sitting still (a baseball) and you move/rotate a collision shell into it (a baseball bat) the ball will not experience a collision. Similarly if the ball is moving very slowly towards a collision shell which is itself moving very quickly, if a collision occurs (which will only occur if the movement of the object overlaps a face of the shell during one frame) the object will bounce off only in proportion to its own speed,
            
              NOT
            
             the combined speed of the object and the collision shell which hit it.
            

             Finally, while this behavior attempts to simulate realistic collisions and reflections, there are known inaccuracies and edge cases which can cause it to react somewhat incorrectly (the reflection is slightly off) or very incorrectly (the collider passes right through a collision shell). This behavior is not a substitute for real physical simulation.
            

             Instead of this behavior, use the Collider for Walkthroughs behavior attached to a Camera for better results when creating a ‘walkthrough’ presentation.
            


            Basic Properties
           



              Collision Distance
            

              How far from the center of the object should a collision be looked for?
            



            Advanced Properties
           



              Flash On Collision?
            

              Flash to a color the parent collides?
            

              Flash Color
            

              Color to flash when a collision occurs.
            

              Override Elasticity?
            

              Use the 'Elasticity' value (below) rather than that of the collider?
            

              Elasticity
            

              Elasticity value to use instead of those on any collider.
            

              Extra Detection?
            

              Use 7 rays for collision instead of 1? (seven times slower)
            



            Events
           



              Collided
            

              Fires when the parent object collides with a collision shell.
            



            Demonstration
           




              View Demonstration Project
            




              Download Project File
            




作者: 晃晃    时间: 2012-1-22 23:29
今年过年不收礼,收礼只收你短信,祝福不分大小,只要真心我就要。条数越多我越高兴,手机越响我越开心,你可否提前把礼送,等礼等得我好心焦。

作者: 奇    时间: 2012-3-4 23:20
先垫一块,再说鸟

作者: C.R.CAN    时间: 2012-3-12 23:25
不错啊 经典

作者: 晃晃    时间: 2012-3-13 23:19
呵呵,真得不错哦!!

作者: 晃晃    时间: 2012-4-13 23:27
很经典,很实用,学习了!

作者: 晃晃    时间: 2012-5-1 23:20
再看一看,再顶楼主

作者: tc    时间: 2012-5-12 23:23
凡系斑竹滴话要听;凡系朋友滴帖要顶!

作者: 晃晃    时间: 2012-8-15 23:44
读铁系缘分,顶铁系友情

作者: tc    时间: 2012-12-9 23:22
不会吧,太恐怖了

作者: C.R.CAN    时间: 2013-2-3 23:31
好铁多多发,感激分享





欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5