コード例 #1
0
AnimationStateMachineBehaviour* AnimationStateMachine::getBehaviour(
    const char* from,
    const char* to)
{
    auto fromNode = getNode(from);
    auto toNode = getNode(to);

    auto ret = getBehaviour(fromNode, toNode);

    return ret;
}
コード例 #2
0
ファイル: behaviour.cpp プロジェクト: Sirithang/webgine
BehaviourID behaviour::create(EntityID ent)
{
	BehaviourID ret = gBehaviourManager.add();
	Behaviour& b = getBehaviour(ret);

	b._owner = ent;
	b._interface = 0;

	entity::addComponent(ent, ret, BEHAVIOUR);

	return ret;
}
コード例 #3
0
ファイル: behaviour.cpp プロジェクト: Sirithang/webgine
void behaviour::setInterface(BehaviourID behave,BehaviourInterface* behaviourInterface)
{
	Behaviour& b = getBehaviour(behave);

	b._interface = behaviourInterface;

	if(b._interface)
	{
		foundation::array::push_back(*gSortedInterfaces, b._interface);
		qsort(gSortedInterfaces->_data, foundation::array::size(*gSortedInterfaces), sizeof(BehaviourInterface*), sortInterface);

		b._interface->_entity = b._owner;
		b._interface->created();
	}
}