From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/mecanim/graph/quaternionnode.h | 283 +++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 Runtime/mecanim/graph/quaternionnode.h (limited to 'Runtime/mecanim/graph/quaternionnode.h') diff --git a/Runtime/mecanim/graph/quaternionnode.h b/Runtime/mecanim/graph/quaternionnode.h new file mode 100644 index 0000000..19f1f86 --- /dev/null +++ b/Runtime/mecanim/graph/quaternionnode.h @@ -0,0 +1,283 @@ +/* + Copyright (c) 7244339 Canada Inc. (Mecanim) + All Rights Reserved. +*/ +#pragma once + +#include "Runtime/mecanim/defs.h" +#include "Runtime/mecanim/memory.h" +#include "Runtime/mecanim/types.h" +#include "Runtime/mecanim/object.h" + +#include "Runtime/Math/Simd/math.h" + +#include "Runtime/mecanim/graph/plug.h" +#include "Runtime/mecanim/graph/node.h" + +#include "Runtime/mecanim/graph/unarynode.h" + +namespace mecanim +{ + +namespace graph +{ + class quatIdentityOp + { + public: + template static math::float4 Operation(){ return math::quatIdentity(); } + }; + + class quatIdentity : public ResultNode + { + public: + static const eNodeType mId = quatIdentityId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatConjOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatConj(l); } + }; + + class quatConj : public UnaryNode > + { + public: + static const eNodeType mId = quatConjId; + virtual eNodeType NodeType(){return mId;} + }; + + class quatMulOp + { + public: + template static math::float4 Operation( math::float4 const& l, math::float4 const& r){ return math::quatMul(l, r); } + }; + + class quatMul : public BinaryNode + { + public: + static const eNodeType mId = quatMulId; + virtual eNodeType NodeType(){return mId;} + }; + + class quatMulVecOp + { + public: + template static math::float4 Operation( math::float4 const& l, math::float4 const& r){ return math::quatMulVec(l, r); } + }; + + class quatMulVec : public BinaryNode + { + public: + static const eNodeType mId = quatMulVecId; + virtual eNodeType NodeType(){return mId;} + }; + + class quatLerpOp + { + public: + template static math::float4 Operation( math::float4 const& a, math::float4 const& b, float c){ return math::quatLerp(a, b, math::float1(c)); } + }; + + class quatLerp : public TernaryNode + { + public: + static const eNodeType mId = quatLerpId; + virtual eNodeType NodeType(){return mId;} + }; + + class quatArcRotateOp + { + public: + template static math::float4 Operation( math::float4 const& l, math::float4 const& r){ return math::quatArcRotate(l, r); } + }; + + class quatArcRotate : public BinaryNode + { + public: + static const eNodeType mId = quatArcRotateId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatArcRotateXOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatArcRotateX(l); } + }; + + class quatArcRotateX : public UnaryNode > + { + public: + static const eNodeType mId = quatArcRotateXId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatXcosOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatXcos(l); } + }; + + class quatXcos : public UnaryNode > + { + public: + static const eNodeType mId = quatXcosId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatYcosOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatYcos(l); } + }; + + class quatYcos : public UnaryNode > + { + public: + static const eNodeType mId = quatYcosId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatZcosOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatZcos(l); } + }; + + class quatZcos : public UnaryNode > + { + public: + static const eNodeType mId = quatZcosId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatEulerToQuatOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatEulerToQuat(l); } + }; + + class quatEulerToQuat : public UnaryNode > + { + public: + static const eNodeType mId = quatEulerToQuatId; + virtual eNodeType NodeType(){return mId;} + }; + template class quatQuatToEulerOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatQuatToEuler(l); } + }; + + class quatQuatToEuler : public UnaryNode > + { + public: + static const eNodeType mId = quatQuatToEulerId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quatProjOnYPlaneOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quatProjOnYPlane(l); } + }; + + class quatProjOnYPlane : public UnaryNode > + { + public: + static const eNodeType mId = quatProjOnYPlaneId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quat2QtanOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quat2Qtan(l); } + }; + + class quat2Qtan : public UnaryNode > + { + public: + static const eNodeType mId = quat2QtanId; + virtual eNodeType NodeType(){return mId;} + }; + + template class qtan2QuatOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::qtan2Quat(l); } + }; + + class qtan2Quat : public UnaryNode > + { + public: + static const eNodeType mId = qtan2QuatId; + virtual eNodeType NodeType(){return mId;} + }; + + template class ZYRoll2QuatOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::ZYRoll2Quat(l); } + }; + + class ZYRoll2Quat : public UnaryNode > + { + public: + static const eNodeType mId = ZYRoll2QuatId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quat2ZYRollOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quat2ZYRoll(l); } + }; + + class quat2ZYRoll : public UnaryNode > + { + public: + static const eNodeType mId = quat2ZYRollId; + virtual eNodeType NodeType(){return mId;} + }; + + template class RollZY2QuatOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::RollZY2Quat(l); } + }; + + class RollZY2Quat : public UnaryNode > + { + public: + static const eNodeType mId = RollZY2QuatId; + virtual eNodeType NodeType(){return mId;} + }; + + template class quat2RollZYOp + { + public: + static math::float4 Operation( math::float4 const& l){ return math::quat2RollZY(l); } + }; + + class quat2RollZY : public UnaryNode > + { + public: + static const eNodeType mId = quat2RollZYId; + virtual eNodeType NodeType(){return mId;} + }; + + class quatWeightOp + { + public: + template static math::float4 Operation( math::float4 const& l, float r){ return math::quatWeight(l, math::float1(r)); } + }; + + class quatWeight : public BinaryNode + { + public: + static const eNodeType mId = quatWeightId; + virtual eNodeType NodeType(){return mId;} + }; +} +} \ No newline at end of file -- cgit v1.1-26-g67d0