跳转至

setAngleSpeed

格式

setAngleSpeed(angleSpeed)

简介

设置角色转动速度,不设置速度默认为1弧度/秒。

参数

名称 类型 描述
angularSpeed float 转动速度

实例

当运行开始时设置角色mob转动速度为2弧度/秒,向左旋转。

import fg
import wx
import vmath

asset = fg.AssetCreate()
asset.name = 'Main Scene'
asset.state = fg.STATE.VOXMODEL
asset.vmFile = 'mainScene'
asset.icon='icon.png'

fg.AssetRegister(asset)

mob = fg.AssetCreate((fg.SimpleMob,))
mob.name = 'mob'
mob.state = fg.STATE.MOBILE
mob.mobSkeleton = 'skeleton.ozz'
mob.mobMesh = 'mesh.ozz'
mob.mobTexture = 'texture.png'
mob.mobAction = 'action.ozz'
mob.icon='mob.png'

def onStart(self):
    global mob
    mob=fg.AssetBuildEntity(fg.AssetRegister(mob), self.id, vmath.Vec3(0,25,0))
    mob.setAngleSpeed(2)
    mob.setMotion(wx.MOTION.YAW_LEFT)

fg.AssetSetStartCBFunc(asset, onStart)