[記錄]升級到yake0.7....

發現yake 0.7新特性
1 簡單的觸發器  你可以通過一個返回bool值的callback條件來決定狀態機的transition....
2 res系統
腳本系統構造函數做了改動
// 添加了對象名
ent::LuaObjectManagerListener luaFmsObjListener(*luaSys, "main" );

編譯錯誤
一個在const函數修改的問題
yake::math::Quaternion MovementComponent::getOrientation() const
{
    // 保證目標存在
    YAKE_ASSERT(mActor);
    mOrientation = mActor->getOrientation();
    return mOrientation;
}

搞了半天一直不知道爲什麼編譯不能通過...
原來是因爲我在const函數中對成員變量mOrientation做了修改...
帶const的函數中是不能對任何成員變量做修改的..
在對應的函數上加上mutable關鍵字就可以了
    mutable Vector3      mPosition;
    mutable Quaternion  mOrientation;

yake沒有重載*= 操作符, 所有你不能這樣用
rot *= mActor->getOrientation();
 而應該這樣寫
rot = rot * mActor->getOrientation();
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章