mirror of https://github.com/axmolengine/axmol.git
122 lines
3.3 KiB
C
122 lines
3.3 KiB
C
|
/**
|
|||
|
* The MIT License (MIT)
|
|||
|
*
|
|||
|
* Copyright (c) 2012-2018 DragonBones team and other contributors
|
|||
|
*
|
|||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|||
|
* this software and associated documentation files (the "Software"), to deal in
|
|||
|
* the Software without restriction, including without limitation the rights to
|
|||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|||
|
* subject to the following conditions:
|
|||
|
*
|
|||
|
* The above copyright notice and this permission notice shall be included in all
|
|||
|
* copies or substantial portions of the Software.
|
|||
|
*
|
|||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
*/
|
|||
|
#ifndef DRAGONBONES_POINT_H
|
|||
|
#define DRAGONBONES_POINT_H
|
|||
|
|
|||
|
#include "../core/DragonBones.h"
|
|||
|
|
|||
|
DRAGONBONES_NAMESPACE_BEGIN
|
|||
|
/**
|
|||
|
* - The Point object represents a location in a two-dimensional coordinate system.
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language en_US
|
|||
|
*/
|
|||
|
/**
|
|||
|
* - Point <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD>е<EFBFBD>ij<EFBFBD><EFBFBD>λ<EFBFBD>á<EFBFBD>
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language zh_CN
|
|||
|
*/
|
|||
|
class Point
|
|||
|
{
|
|||
|
public:
|
|||
|
static Point helpPointA;
|
|||
|
static Point helpPointB;
|
|||
|
static Point helpPointC;
|
|||
|
static Point helpPointD;
|
|||
|
|
|||
|
public:
|
|||
|
/**
|
|||
|
* - The horizontal coordinate.
|
|||
|
* @default 0.0
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language en_US
|
|||
|
*/
|
|||
|
/**
|
|||
|
* - <EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD>ˮƽ<EFBFBD><EFBFBD><EFBFBD>ꡣ
|
|||
|
* @default 0.0
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language zh_CN
|
|||
|
*/
|
|||
|
float x;
|
|||
|
/**
|
|||
|
* - The vertical coordinate.
|
|||
|
* @default 0.0
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language en_US
|
|||
|
*/
|
|||
|
/**
|
|||
|
* - <EFBFBD>õ<EFBFBD><EFBFBD>Ĵ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>ꡣ
|
|||
|
* @default 0.0
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language zh_CN
|
|||
|
*/
|
|||
|
float y;
|
|||
|
|
|||
|
Point():
|
|||
|
x(0.0f),
|
|||
|
y(0.0f)
|
|||
|
{}
|
|||
|
/**
|
|||
|
* - Creates a new point. If you pass no parameters to this method, a point is created at (0,0).
|
|||
|
* @param x - The horizontal coordinate.
|
|||
|
* @param y - The vertical coordinate.
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language en_US
|
|||
|
*/
|
|||
|
/**
|
|||
|
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> egret.Point <EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κβ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᴴ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>λ<EFBFBD>ڣ<EFBFBD>0<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>λ<EFBFBD>õĵ㡣
|
|||
|
* @param x - <EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>x<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>Ϊ 0.0<EFBFBD><EFBFBD>
|
|||
|
* @param y - <EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>Ϊ 0.0<EFBFBD><EFBFBD>
|
|||
|
* @version DragonBones 3.0
|
|||
|
* @language zh_CN
|
|||
|
*/
|
|||
|
Point(const Point& value)
|
|||
|
{
|
|||
|
operator=(value);
|
|||
|
}
|
|||
|
~Point() {}
|
|||
|
|
|||
|
inline void operator=(const Point& value)
|
|||
|
{
|
|||
|
x = value.x;
|
|||
|
y = value.y;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* @private
|
|||
|
*/
|
|||
|
inline void clear()
|
|||
|
{
|
|||
|
x = y = 0.0f;
|
|||
|
}
|
|||
|
|
|||
|
public: // For WebAssembly.
|
|||
|
static Point* getHelpPointA() { return &helpPointA; }
|
|||
|
static Point* getHelpPointB() { return &helpPointB; }
|
|||
|
static Point* getHelpPointC() { return &helpPointC; }
|
|||
|
static Point* getHelpPointD() { return &helpPointD; }
|
|||
|
};
|
|||
|
|
|||
|
DRAGONBONES_NAMESPACE_END
|
|||
|
#endif // DRAGONBONES_POINT_H
|