PuzzleSDK
Bug-1174.cpp 文件参考
#include "Bug-1174.h"
+ Bug-1174.cpp 的引用(Include)关系图:

浏览源代码.

函数

int check_for_error (Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4, float s, float t)
 

变量

 USING_NS_CC
 

函数说明

◆ check_for_error()

int check_for_error ( Vec2  p1,
Vec2  p2,
Vec2  p3,
Vec2  p4,
float  s,
float  t 
)

在文件 Bug-1174.cpp36 行定义.

37{
38 // the hit point is p3 + t * (p4 - p3);
39 // the hit point also is p1 + s * (p2 - p1);
40
41 auto p4_p3 = p4 - p3;
42 auto p4_p3_t = p4_p3 * t;
43 auto hitPoint1 = p3 + p4_p3_t;
44
45 auto p2_p1 = p2 - p1;
46 auto p2_p1_s = p2_p1 * s;
47 auto hitPoint2 = p1 + p2_p1_s;
48
49 // Since float has rounding errors, only check if diff is < 0.05
50 if( (fabs( hitPoint1.x - hitPoint2.x) > 0.1f) || ( fabs(hitPoint1.y - hitPoint2.y) > 0.1f) )
51 {
52 log("ERROR: (%f,%f) != (%f,%f)", hitPoint1.x, hitPoint1.y, hitPoint2.x, hitPoint2.y);
53 return 1;
54 }
55
56 return 0;
57}

被这些函数引用 Bug1174Layer::init().

+ 这是这个函数的调用关系图:

变量说明

◆ USING_NS_CC

USING_NS_CC

在文件 Bug-1174.cpp32 行定义.