跳转至

CalcDeltaPitch 计算仰角变化量

格式

CalcDeltaPitch(from, to)

简介

计算仰角变化量。

参数

名称 类型 描述
from float 初始仰角(弧度)
to float 目标仰角(弧度)

返回值

名称 类型 描述
delta float 仰角变化量(单位:弧度)

实例

运行开始时计算角色当前仰角到达某一固定值仰角的变化量。

import fg,wx,math

asset = fg.AssetCreate()
asset.state = fg.STATE.MOBILE
asset.name = 'boy'
asset.icon = 'boy/icon.png'
asset.mobSkeleton = 'boy/skeleton.ozz'
asset.mobMesh = 'boy/mesh.ozz'
asset.mobTexture = 'boy/texture.png'
asset.mobAction = 'boy/Take 001.ozz'
asset.mobActionRange = [0, 1]

fg.AssetRegister(asset)

def onStart(self):
    a = wx.CalcDeltaPitch(wx.MobGetPitch(self.id), math.pi/2)
    print(a)

fg.AssetSetStartCBFunc(asset, onStart)