unity调方向和位置函数
// ship02.updateGraphNodePosition(FollowObject: graphNode, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
// ship02.updateGraphNodeRotation(FollowObject: graphNode, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
//传入的参数followObject, followType, listenType
//updateGraphNodePosition:andRotation: 只能指定graphNode,注意
lf.ship02.updateGraphNodePosition(graphNode, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
lf.ship02.updateGraphNodeRotation(graphNode, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
//设置ship02行驶轨迹点,该方法负责把ship02驱动到指定的位置(由unit01的position==指定位置)
//参数speedSettings:SCNPhysicsSpeed
ship02.runPosition(graphNode.worldPosition, speedSettings: speedSettings)
greece
// ship02.updateGraphNodePosition(FollowObject: graphNode02, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
// ship02.updateGraphNodeRotation(FollowObject: graphNode02, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
ship02.updateGraphNodePosition(graphNode02, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
ship02.updateGraphNodeRotation(graphNode02, FollowType: FollowType_Abs_in_
world, ListenType: ListenType_Rel_to_ship)
//设置ship02行驶轨迹点,该方法负责把ship02驱动到指定的位置(由unit01的position==指定位置)
//参数speedSettings:SCNPhysicsSpeed
ship02.runPosition(graphNode02.worldPosition, speedSettings: speedSettings)
technical
gobble
//3.设置其他unit在graphNode结点上的位置&方向
existential// unit03.updateGraphNodePosition(FollowObject: graphNode, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
/
/ unit03.updateGraphNodeRotation(FollowObject: graphNode, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
bmk
unit03.updateGraphNodePosition(graphNode, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
unit03.updateGraphNodeRotation(graphNode, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
//4.Ship02停船
ship02.stopRun()
//5.设置unit03在graphNode02结点上的位置&方向
/
/ unit03.updateGraphNodePosition(FollowObject: graphNode02, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
// unit03.updateGraphNodeRotation(FollowObject: graphNode02, FollowType: P_ABS_IN_WORLD, ListenType: P_REL_TO_SHIP)
unit03.updateGraphNodePosition(graphNode02, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
alarm unit03.updateGraphNodeRotation(graphNode02, FollowType: FollowType_Abs_in_world, ListenType: ListenType_Rel_to_ship)
//6.ship02跟新他的位置以追踪unit03
// ship02.updateGraphNodePosition(FollowObject: unit03, FollowType: P_REL_TO_SHIP, ListenType: P_ABS_IN_WORLD)
ship02.updateGraphNodePosition(unit03, FollowType: FollowType_Rel_to_ship, ListenType: ListenType_Abs_in_world)
//7.把ship02 Drive到unit03附近
// ship02.runPosition(CGPoint, speedSetting: SCNPhysicsSpeed)
ship02.runPosition(unit03.worldPosition, speedSettings: speedSettings)
}
//MARK: 演示simd
func demo_simd() {
亲子培训
//显示一个simd示例
var xglMatrix4 = matrix_identity_float4x4
//这个simd对象,可以是matrix, vector或者quat
let translationMatrix = matrix_float4x4_translation(1.0, 1.0, 1.0)
let scaleMatrix = matrix_float4x4_uniform_scale(1.0)
//使用float4x4来叠加transform
学院用英语怎么说 xglMatrix4 = matrix_multiply(xglMatrix4, scaleMatrix)
加州大学 xglMatrix4 = matrix_multiply(xglMatrix4, translationMatrix)子法
}
}