zoukankan      html  css  js  c++  java
  • [Unity3d]向量的过度方法以及拖尾效果

    Vector3.RotateTowards()

    • 用法
    public static function RotateTowards(current: Vector3, target: Vector3, maxRadiansDelta: float, maxMagnitudeDelta: float): Vector3;
    
    • 说明:限定了每个偏转的阈值

    Vector3.SmoothDamp() 弹性过渡

    • 用法
    public static function SmoothDamp(current: Vector3, target: Vector3, ref currentVelocity: Vector3, smoothTime: float, maxSpeed: float = Mathf.Infinity, deltaTime: float = Time.deltaTime): Vector3;
    public static function SmoothDamp(current: Vector3, target: Vector3, ref currentVelocity: Vector3, smoothTime: float, maxSpeed: float = Mathf.Infinity, deltaTime: float = Time.deltaTime): Vector3;
    public static function SmoothDamp(current: Vector3, target: Vector3, ref currentVelocity: Vector3, smoothTime: float, maxSpeed: float = Mathf.Infinity, deltaTime: float = Time.deltaTime): Vector3;
    
    • 用法:也是从一个向量值转向另一个向量值,不过可以传入一个弹性值smoothTime。当2个向量相差大的时候,则过度的会快,反之则过度的慢,这也是推荐的方法

    Vector3.Lerp

    • 用法
    public static function Lerp(a: Vector3, b: Vector3, t: float): Vector3;
    
    • 说明:如果float的值是0,则返回的向量值是a;如果float的值是1,则返回的向量值是b, 0.5则是这2个向量的中间值

    设置物体的拖尾效果

    • 创建一个空物体并且添加拖尾特性:
    • 运行效果:

    制作子弹

    • 创建Quad对象并且在其父级的空对象中添加Halo效果
  • 相关阅读:
    js的BOM对象完全解析
    转:JavaScript中的this陷阱的最全收集
    转载:冷门js技巧
    MVVM的架构设计与团队协作 with StoryBoard
    ReactiveCocoa & FRP & MVVM
    ReactiveCocoa的冷信号与热信号 探讨
    Git本地项目上传 & SourceTree & GitHub 简单使用
    Monad / Functor / Applicative 浅析
    map & flatMap 浅析
    Swift -> Let & Var 背后编程模式 探讨
  • 原文地址:https://www.cnblogs.com/xiuj/p/5935134.html
Copyright © 2011-2022 走看看