跳转至

attachCamera 人称视角

格式

attachCamera(control)

简介

设置角色视角类型,视角类型详见CONTROL

参数

名称 类型 描述
control int 枚举

实例

当运行开始时设置视角为角色mob的第一人称视角。

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, 41, 0))
    mob.attachCamera(fg.CAMERA_CONTROL.FIRSTPERSON)

fg.AssetSetStartCBFunc(asset, onStart)