123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #ifndef __MATH_CCAFFINETRANSFORM_H__
- #define __MATH_CCAFFINETRANSFORM_H__
- #include "platform/CCPlatformMacros.h"
- #include "math/CCGeometry.h"
- #include "math/CCMath.h"
- NS_CC_BEGIN
- struct CC_DLL AffineTransform {
- float a, b, c, d;
- float tx, ty;
- static const AffineTransform IDENTITY;
- };
- CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty);
- #define AffineTransformMake __CCAffineTransformMake
- CC_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t);
- #define PointApplyAffineTransform __CCPointApplyAffineTransform
- CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t);
- #define SizeApplyAffineTransform __CCSizeApplyAffineTransform
- CC_DLL AffineTransform AffineTransformMakeIdentity();
- CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform);
- CC_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform);
- CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform);
- CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty);
- CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle);
- CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy);
- CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2);
- CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2);
- CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t);
- CC_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2);
- extern CC_DLL const AffineTransform AffineTransformIdentity;
- NS_CC_END
- #endif
|