Exemple #1
0
int main()
{
    const std::complex<double> i(0.0,1.0);
    mch::var<double> a,b,r,f;
    mch::wildcard _;

    Match(i)
    {
    Qua(cartesian,a,b)        std::cout << a << "+"    << b << "*i" << std::endl;
     When(a,b |= a < b)       std::cout << a << "<"    << b << std::endl;
     When(a,b |= a ==b)       std::cout << a << "=="   << b << std::endl;
     When(a,b |= a > b)       std::cout << a << ">"    << b << std::endl;
     When(0,1)                std::cout << "(0,1)"     << std::endl;
     When(1+a,1+b)            std::cout << "1+" << a << ",1+" << b << std::endl;
     When(a+1,b+1)            std::cout << a << "+1,"  << b << "+1"<< std::endl;
    Qua(polar,    r,f)        std::cout << r << "*e^i" << f << std::endl;
     When(r,f |= r < f)       std::cout << r << "<"    << f << std::endl;
     When(r,f |= r ==f)       std::cout << r << "=="   << f << std::endl;
     When(r,f |= r > f)       std::cout << r << ">"    << f << std::endl;
     When(2*r,2*f)            std::cout << "2*" << r << ",2*"  << f << std::endl;
     When(r*2,f*2)            std::cout << r << "*2,"  << f << "*2" << std::endl;
     When(r*2 |= r > 0.6,f*2) std::cout << r << "*2>1.2,"  << f << "*2" << std::endl;
     When(r*2,f*2 |= f > 0.6) std::cout << r << "*2,"  << f << "*2>1.2" << std::endl;
     When(r*2,  _)            std::cout << r << "*2, ???" << std::endl;
   //When(r*2,  _ |= r < 0.6) std::cout << r << "*2<1.2, ???" << std::endl;
     When(r*2,  f |= r < 0.6) std::cout << r << "*2<1.2, ???" << std::endl; // FIX: Replaced _ with f in the above as currently we don't have guard specialization
    }
    EndMatch
}
Exemple #2
0
	PUBindEffectEvent::PUBindEffectEvent(const Str& name, const Str8& eventname, Flt timePoint, EffectComponent* controller)
		: mEventName(eventname)
		, mEffectController(controller)
		, bBindRootComponent(FALSE)
		, mIsStart(false)
		, mTimePoint(timePoint)
		, mBinderNode(NULL)
		, mBeBinderNode(NULL)
		, mSceneNodeBinder(NULL)
		, mBonePosBinder(NULL)
		, mHasBoneName(false)
		, mBindPos(Vec3(0, 0, 0))
		, mBindQua(Qua(1, 0, 0, 0))
		, mBindExternalEntitySlot(0)
	{
		setName(name);

		mSceneNodeBinder = MG_NEW EffectComponentBinderSceneNode(mEffectController);
		mBonePosBinder = MG_NEW EffectComponentBinderBonePos(mEffectController);
	}