summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/algebra.cpp32
-rw-r--r--common/algebra.h108
-rw-r--r--common/camera.h8
-rw-r--r--common/debug.cpp16
-rw-r--r--common/debug.h4
-rw-r--r--common/piece.cpp74
-rw-r--r--common/pieceinf.h8
-rw-r--r--common/preview.cpp6
-rw-r--r--common/project.cpp96
-rw-r--r--common/project.h8
10 files changed, 152 insertions, 208 deletions
diff --git a/common/algebra.cpp b/common/algebra.cpp
index 26b0a16..7e0efd4 100644
--- a/common/algebra.cpp
+++ b/common/algebra.cpp
@@ -8,7 +8,7 @@
// ============================================================================
// 4x4 Matrix class.
-void Matrix44::CreateLookAt(const Point3& Eye, const Point3& Target, const Vector3& Up)
+void Matrix44::CreateLookAt(const Vector3& Eye, const Vector3& Target, const Vector3& Up)
{
Vector3 x, y, z;
@@ -180,32 +180,32 @@ Matrix44 Inverse(const Matrix44& m)
// Project/Unproject a point.
// Convert world coordinates to screen coordinates.
-Point3 ProjectPoint(const Point3& Pt, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4])
+Vector3 ProjectPoint(const Vector3& Pt, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4])
{
Vector4 Tmp;
- Tmp = Vector4(Pt) * ModelView;
- Tmp = Tmp * Projection;
+ Tmp = Mul4(Vector4(Pt), ModelView);
+ Tmp = Mul4(Tmp, Projection);
// Normalize.
Tmp /= Tmp[3];
// Screen coordinates.
- return Point3(Viewport[0]+(1+Tmp[0])*Viewport[2]/2, Viewport[1]+(1+Tmp[1])*Viewport[3]/2, (1+Tmp[2])/2);
+ return Vector3(Viewport[0]+(1+Tmp[0])*Viewport[2]/2, Viewport[1]+(1+Tmp[1])*Viewport[3]/2, (1+Tmp[2])/2);
}
// Convert screen coordinates to world coordinates.
-Point3 UnprojectPoint(const Point3& Point, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4])
+Vector3 UnprojectPoint(const Vector3& Point, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4])
{
- Point3 Tmp = Point;
+ Vector3 Tmp = Point;
UnprojectPoints(&Tmp, 1, ModelView, Projection, Viewport);
return Tmp;
}
-void UnprojectPoints(Point3* Points, int NumPoints, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4])
+void UnprojectPoints(Vector3* Points, int NumPoints, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4])
{
// Calculate the screen to model transform.
- Matrix44 Transform = Inverse(ModelView * Projection);
+ Matrix44 Transform = Inverse(Mul(ModelView, Projection));
for (int i = 0; i < NumPoints; i++)
{
@@ -217,12 +217,12 @@ void UnprojectPoints(Point3* Points, int NumPoints, const Matrix44& ModelView, c
Tmp[2] = Points[i][2] * 2.0f - 1.0f;
Tmp[3] = 1.0f;
- Tmp = Tmp * Transform;
+ Tmp = Mul4(Tmp, Transform);
if (Tmp[3] != 0.0f)
Tmp /= Tmp[3];
- Points[i] = Point3(Tmp[0], Tmp[1], Tmp[2]);
+ Points[i] = Vector3(Tmp[0], Tmp[1], Tmp[2]);
}
}
@@ -230,9 +230,9 @@ void UnprojectPoints(Point3* Points, int NumPoints, const Matrix44& ModelView, c
// Geometry functions.
// Sutherland-Hodgman method of clipping a polygon to a plane.
-void PolygonPlaneClip(Point3* InPoints, int NumInPoints, Point3* OutPoints, int* NumOutPoints, const Vector4& Plane)
+void PolygonPlaneClip(Vector3* InPoints, int NumInPoints, Vector3* OutPoints, int* NumOutPoints, const Vector4& Plane)
{
- Point3 *s, *p, i;
+ Vector3 *s, *p, i;
*NumOutPoints = 0;
s = &InPoints[NumInPoints-1];
@@ -278,7 +278,7 @@ void PolygonPlaneClip(Point3* InPoints, int NumInPoints, Point3* OutPoints, int*
// Calculate the intersection of a line segment and a plane and returns false
// if they are parallel or the intersection is outside the line segment.
-bool LinePlaneIntersection(Point3& Intersection, const Point3& Start, const Point3& End, const Vector4& Plane)
+bool LinePlaneIntersection(Vector3& Intersection, const Vector3& Start, const Vector3& End, const Vector4& Plane)
{
Vector3 Dir = End - Start;
@@ -298,7 +298,7 @@ bool LinePlaneIntersection(Point3& Intersection, const Point3& Start, const Poin
return true;
}
-bool LineTriangleMinIntersection(const Point3& p1, const Point3& p2, const Point3& p3, const Point3& Start, const Point3& End, float& MinDist, Point3& Intersection)
+bool LineTriangleMinIntersection(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& Start, const Vector3& End, float& MinDist, Vector3& Intersection)
{
// Calculate the polygon plane.
Vector4 Plane;
@@ -349,7 +349,7 @@ bool LineTriangleMinIntersection(const Point3& p1, const Point3& p2, const Point
return false;
}
-bool LineQuadMinIntersection(const Point3& p1, const Point3& p2, const Point3& p3, const Point3& p4, const Point3& Start, const Point3& End, float& MinDist, Point3& Intersection)
+bool LineQuadMinIntersection(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Vector3& Start, const Vector3& End, float& MinDist, Vector3& Intersection)
{
// Calculate the polygon plane.
Vector4 Plane;
diff --git a/common/algebra.h b/common/algebra.h
index 693b1ae..941dc23 100644
--- a/common/algebra.h
+++ b/common/algebra.h
@@ -31,7 +31,6 @@
//#define LC_MATH_SSE
// Classes defined in this file:
-class Point3;
class Vector3;
class Vector4;
class Quaternion;
@@ -272,34 +271,6 @@ protected:
#endif
// ============================================================================
-// 3D Point class.
-
-class Point3
-{
-public:
- // Constructors.
- inline Point3() { }
- inline explicit Point3(const Vector4& _v)
- : m_Value(_v) { }
- inline explicit Point3(const float _x, const float _y, const float _z)
- : m_Value(_x, _y, _z) { }
-
- inline operator const float*() const { return (const float*)this; }
- inline operator float*() { return (float*)this; }
- inline const Vector4& GetValue() const { return m_Value; }
- inline operator const Vector4() const
- { return Vector4(m_Value[0], m_Value[1], m_Value[2], 1.0f); }
-
- inline float& operator[](int i) const { return m_Value[i]; }
-
- // Math operations.
-
-protected:
- Vector4 m_Value;
-};
-
-
-// ============================================================================
// 3D Vector class.
class Vector3
@@ -347,12 +318,9 @@ protected:
// ============================================================================
-// Point3 and Vector3 Operators.
+// Operators.
// Comparison.
-inline bool operator==(const Point3& a, const Point3& b)
-{ return Compare3(a.GetValue(), b.GetValue()); }
-
inline bool operator==(const Vector3& a, const Vector3& b)
{ return Compare3(a.GetValue(), b.GetValue()); }
@@ -363,12 +331,6 @@ inline Vector3 operator*(const Vector3& a, float f)
inline Vector3 operator*(float f, const Vector3& a)
{ return Vector3(Multiply34(a.GetValue(), f)); }
-inline Point3 operator*(const Point3& a, float f)
-{ return Point3(Multiply34(a.GetValue(), f)); }
-
-inline Point3 operator*(float f, const Point3& a)
-{ return Point3(Multiply34(a.GetValue(), f)); }
-
// Divide by a scalar.
inline Vector3 operator/(const Vector3& a, float f)
{ return Vector3(Divide34(a.GetValue(), f)); }
@@ -376,35 +338,11 @@ inline Vector3 operator/(const Vector3& a, float f)
inline Vector3 operator/(float f, const Vector3& a)
{ return Vector3(Divide34(a.GetValue(), f)); }
-inline Point3 operator/(const Point3& a, float f)
-{ return Point3(Divide34(a.GetValue(), f)); }
-
-inline Point3 operator/(float f, const Point3& a)
-{ return Point3(Divide34(a.GetValue(), f)); }
-
-// Add vectors/points (return a point if either is a point).
-inline Point3 operator+(const Point3& a, const Point3& b)
-{ return Point3(Add34(a.GetValue(), b.GetValue())); }
-
-inline Point3 operator+(const Point3& a, const Vector3& b)
-{ return Point3(Add34(a.GetValue(), b.GetValue())); }
-
-inline Point3 operator+(const Vector3& a, const Point3& b)
-{ return Point3(Add34(a.GetValue(), b.GetValue())); }
-
+// Add vectors.
inline Vector3 operator+(const Vector3& a, const Vector3& b)
{ return Vector3(Add34(a.GetValue(), b.GetValue())); }
-// Subtract vectors/points (return a vector if both arguments are the same type).
-inline Vector3 operator-(const Point3& a, const Point3& b)
-{ return Vector3(Subtract34(a.GetValue(), b.GetValue())); }
-
-inline Point3 operator-(const Point3& a, const Vector3& b)
-{ return Point3(Subtract34(a.GetValue(), b.GetValue())); }
-
-inline Point3 operator-(const Vector3& a, const Point3& b)
-{ return Point3(Subtract34(a.GetValue(), b.GetValue())); }
-
+// Subtract vectors.
inline Vector3 operator-(const Vector3& a, const Vector3& b)
{ return Vector3(Subtract34(a.GetValue(), b.GetValue())); }
@@ -412,9 +350,6 @@ inline Vector3 operator-(const Vector3& a, const Vector3& b)
inline Vector3 operator-(const Vector3& a)
{ return Vector3(Negate34(a.GetValue())); }
-inline Point3 operator-(const Point3& a)
-{ return Point3(Negate34(a.GetValue())); }
-
// Dot product.
inline float Dot3(const Vector3& a, const Vector3& b)
{ return Dot3(a.GetValue(), b.GetValue()); }
@@ -464,7 +399,7 @@ public:
}
// Operators.
- friend inline Quaternion operator*(const Quaternion& a, const Quaternion& b)
+ friend inline Quaternion Mul(const Quaternion& a, const Quaternion& b)
{
float x = a.m_Value[0] * b.m_Value[3] + a.m_Value[1] * b.m_Value[2] - a.m_Value[2] * b.m_Value[1] + a.m_Value[3] * b.m_Value[0];
float y = -a.m_Value[0] * b.m_Value[2] + a.m_Value[1] * b.m_Value[3] + a.m_Value[2] * b.m_Value[0] + a.m_Value[3] * b.m_Value[1];
@@ -474,7 +409,7 @@ public:
return Quaternion(x, y, z, w);
}
- friend inline Vector3 operator*(const Vector3& a, const Quaternion& b)
+ friend inline Vector3 Mul(const Vector3& a, const Quaternion& b)
{
// Faster to transform to a matrix and multiply.
float Tx = 2.0f*b[0];
@@ -554,12 +489,9 @@ public:
m_Rows[2] = Vector3((one_c * zx) + ys, (one_c * yz) - xs, (one_c * zz) + c);
}
- friend inline Vector3 operator*(const Vector3& a, const Matrix33& b)
+ friend inline Vector3 Mul(const Vector3& a, const Matrix33& b)
{ return Vector3(b.m_Rows[0]*a[0] + b.m_Rows[1]*a[1] + b.m_Rows[2]*a[2]); }
- friend inline Point3 operator*(const Point3& a, const Matrix33& b)
- { return Point3(b.m_Rows[0]*a[0] + b.m_Rows[1]*a[1] + b.m_Rows[2]*a[2]); }
-
protected:
Vector3 m_Rows[3];
@@ -589,16 +521,16 @@ public:
}
// Math operations.
- friend inline Point3 operator*(const Point3& a, const Matrix44& b)
- { return Point3(b.m_Rows[0]*a[0] + b.m_Rows[1]*a[1] + b.m_Rows[2]*a[2] + b.m_Rows[3]); }
+ friend inline Vector3 Mul31(const Vector3& a, const Matrix44& b)
+ { return Vector3(b.m_Rows[0]*a[0] + b.m_Rows[1]*a[1] + b.m_Rows[2]*a[2] + b.m_Rows[3]); }
- friend inline Vector3 operator*(const Vector3& a, const Matrix44& b)
+ friend inline Vector3 Mul30(const Vector3& a, const Matrix44& b)
{ return Vector3(b.m_Rows[0]*a[0] + b.m_Rows[1]*a[1] + b.m_Rows[2]*a[2]); }
- friend inline Vector4 operator*(const Vector4& a, const Matrix44& b)
+ friend inline Vector4 Mul4(const Vector4& a, const Matrix44& b)
{ return Vector4(b.m_Rows[0]*a[0] + b.m_Rows[1]*a[1] + b.m_Rows[2]*a[2] + b.m_Rows[3]*a[3]); }
- friend inline Matrix44 operator*(const Matrix44& a, const Matrix44& b)
+ friend inline Matrix44 Mul(const Matrix44& a, const Matrix44& b)
{
Vector4 Col0(b.m_Rows[0][0], b.m_Rows[1][0], b.m_Rows[2][0], b.m_Rows[3][0]);
Vector4 Col1(b.m_Rows[0][1], b.m_Rows[1][1], b.m_Rows[2][1], b.m_Rows[3][1]);
@@ -630,11 +562,11 @@ public:
m_Rows[2] = Vector4(a[2], b[2], c[2], c[3]);
}
- inline void SetTranslation(const Point3& a)
+ inline void SetTranslation(const Vector3& a)
{ m_Rows[3] = Vector4(a[0], a[1], a[2], 1.0f); }
friend Matrix44 Inverse(const Matrix44& m);
- void CreateLookAt(const Point3& Eye, const Point3& Target, const Vector3& Up);
+ void CreateLookAt(const Vector3& Eye, const Vector3& Target, const Vector3& Up);
void CreatePerspective(float FoVy, float Aspect, float Near, float Far);
void CreateFromAxisAngle(const Vector3& Axis, float Radians)
@@ -651,13 +583,13 @@ protected:
// ============================================================================
// Other Functions.
-Point3 ProjectPoint(const Point3& Point, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4]);
-Point3 UnprojectPoint(const Point3& Point, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4]);
-void UnprojectPoints(Point3* Points, int NumPoints, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4]);
+Vector3 ProjectPoint(const Vector3& Point, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4]);
+Vector3 UnprojectPoint(const Vector3& Point, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4]);
+void UnprojectPoints(Vector3* Points, int NumPoints, const Matrix44& ModelView, const Matrix44& Projection, const int Viewport[4]);
-void PolygonPlaneClip(Point3* InPoints, int NumInPoints, Point3* OutPoints, int* NumOutPoints, const Vector4& Plane);
-bool LinePlaneIntersection(Point3& Intersection, const Point3& Start, const Point3& End, const Vector4& Plane);
-bool LineTriangleMinIntersection(const Point3& p1, const Point3& p2, const Point3& p3, const Point3& Start, const Point3& End, float& MinDist, Point3& Intersection);
-bool LineQuadMinIntersection(const Point3& p1, const Point3& p2, const Point3& p3, const Point3& p4, const Point3& Start, const Point3& End, float& MinDist, Point3& Intersection);
+void PolygonPlaneClip(Vector3* InPoints, int NumInPoints, Vector3* OutPoints, int* NumOutPoints, const Vector4& Plane);
+bool LinePlaneIntersection(Vector3& Intersection, const Vector3& Start, const Vector3& End, const Vector4& Plane);
+bool LineTriangleMinIntersection(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& Start, const Vector3& End, float& MinDist, Vector3& Intersection);
+bool LineQuadMinIntersection(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Vector3& Start, const Vector3& End, float& MinDist, Vector3& Intersection);
#endif
diff --git a/common/camera.h b/common/camera.h
index 840b9f5..c129415 100644
--- a/common/camera.h
+++ b/common/camera.h
@@ -68,10 +68,10 @@ public:
virtual ~Camera ();
// Query functions.
- inline Point3 GetEyePosition() const
- { return Point3(m_fEye[0], m_fEye[1], m_fEye[2]); };
- inline Point3 GetTargetPosition() const
- { return Point3(m_fTarget[0], m_fTarget[1], m_fTarget[2]); };
+ inline Vector3 GetEyePosition() const
+ { return Vector3(m_fEye[0], m_fEye[1], m_fEye[2]); };
+ inline Vector3 GetTargetPosition() const
+ { return Vector3(m_fTarget[0], m_fTarget[1], m_fTarget[2]); };
inline Vector3 GetUpVector() const
{ return Vector3(m_fUp[0], m_fUp[1], m_fUp[2]); };
diff --git a/common/debug.cpp b/common/debug.cpp
index 437adbc..1e56bb5 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -7,8 +7,8 @@
typedef struct
{
- Point3 pt1;
- Point3 pt2;
+ Vector3 pt1;
+ Vector3 pt2;
Vector3 color;
} LC_DEBUG_LINE;
@@ -20,7 +20,7 @@ void ClearDebugLines()
NumDebugLines = 0;
}
-void AddDebugLine(const Point3& pt1, const Point3& pt2, const Vector3& Color)
+void AddDebugLine(const Vector3& pt1, const Vector3& pt2, const Vector3& Color)
{
if (NumDebugLines == LC_MAX_DEBUG_LINES-1)
return;
@@ -35,10 +35,10 @@ void AddDebugLine(const Point3& pt1, const Point3& pt2, const Vector3& Color)
typedef struct
{
- Point3 pt1;
- Point3 pt2;
- Point3 pt3;
- Point3 pt4;
+ Vector3 pt1;
+ Vector3 pt2;
+ Vector3 pt3;
+ Vector3 pt4;
Vector4 color;
} LC_DEBUG_QUAD;
@@ -50,7 +50,7 @@ void ClearDebugQuads()
NumDebugQuads = 0;
}
-void AddDebugQuad(const Point3& pt1, const Point3& pt2, const Point3& pt3, const Point3& pt4, const Vector4& Color)
+void AddDebugQuad(const Vector3& pt1, const Vector3& pt2, const Vector3& pt3, const Vector3& pt4, const Vector4& Color)
{
if (NumDebugQuads == LC_MAX_DEBUG_QUADS-1)
return;
diff --git a/common/debug.h b/common/debug.h
index 88554c9..90b6517 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -6,10 +6,10 @@
void RenderDebugPrimitives();
-void AddDebugLine(const Point3& pt1, const Point3& pt2, const Vector3& Color);
+void AddDebugLine(const Vector3& pt1, const Vector3& pt2, const Vector3& Color);
void ClearDebugLines();
-void AddDebugQuad(const Point3& pt1, const Point3& pt2, const Point3& pt3, const Point3& pt4, const Vector4& Color);
+void AddDebugQuad(const Vector3& pt1, const Vector3& pt2, const Vector3& pt3, const Vector3& pt4, const Vector4& Color);
void ClearDebugQuads();
diff --git a/common/piece.cpp b/common/piece.cpp
index 8b1b59b..2b304b0 100644
--- a/common/piece.cpp
+++ b/common/piece.cpp
@@ -464,11 +464,11 @@ void Piece::MinIntersectDist(LC_CLICKLINE* pLine)
Matrix44 WorldToLocal;
WorldToLocal.CreateFromAxisAngle(Vector3(m_fRotation[0], m_fRotation[1], m_fRotation[2]), -m_fRotation[3] * LC_DTOR);
- WorldToLocal.SetTranslation(Point3(-m_fPosition[0], -m_fPosition[1], -m_fPosition[2]) * WorldToLocal);
+ WorldToLocal.SetTranslation(Mul31(Vector3(-m_fPosition[0], -m_fPosition[1], -m_fPosition[2]), WorldToLocal));
- Point3 Start = Point3(pLine->a1, pLine->b1, pLine->c1) * WorldToLocal;
- Point3 End = Point3(pLine->a1 + pLine->a2, pLine->b1 + pLine->b2, pLine->c1 + pLine->c2) * WorldToLocal;
- Point3 Intersection;
+ Vector3 Start = Mul31(Vector3(pLine->a1, pLine->b1, pLine->c1), WorldToLocal);
+ Vector3 End = Mul31(Vector3(pLine->a1 + pLine->a2, pLine->b1 + pLine->b2, pLine->c1 + pLine->c2), WorldToLocal);
+ Vector3 Intersection;
float* verts = m_pPieceInfo->m_fVertexArray;
@@ -484,9 +484,12 @@ void Piece::MinIntersectDist(LC_CLICKLINE* pLine)
for (i = 0; i < *info; i += 4)
{
- if (LineQuadMinIntersection((Point3&)verts[info[i+1]*3], (Point3&)verts[info[i+2]*3],
- (Point3&)verts[info[i+3]*3], (Point3&)verts[info[i+4]*3],
- Start, End, pLine->mindist, Intersection))
+ Vector3 v1(verts[info[i+1]*3], verts[info[i+1]*3+1], verts[info[i+1]*3+2]);
+ Vector3 v2(verts[info[i+2]*3], verts[info[i+2]*3+1], verts[info[i+2]*3+2]);
+ Vector3 v3(verts[info[i+3]*3], verts[info[i+3]*3+1], verts[info[i+3]*3+2]);
+ Vector3 v4(verts[info[i+4]*3], verts[info[i+4]*3+1], verts[info[i+4]*3+2]);
+
+ if (LineQuadMinIntersection(v1, v2, v3, v4, Start, End, pLine->mindist, Intersection))
{
pLine->pClosest = this;
}
@@ -496,8 +499,11 @@ void Piece::MinIntersectDist(LC_CLICKLINE* pLine)
for (i = 0; i < *info; i += 3)
{
- if (LineTriangleMinIntersection((Point3&)verts[info[i+1]*3], (Point3&)verts[info[i+2]*3],
- (Point3&)verts[info[i+3]*3], Start, End, pLine->mindist, Intersection))
+ Vector3 v1(verts[info[i+1]*3], verts[info[i+1]*3+1], verts[info[i+1]*3+2]);
+ Vector3 v2(verts[info[i+2]*3], verts[info[i+2]*3+1], verts[info[i+2]*3+2]);
+ Vector3 v3(verts[info[i+3]*3], verts[info[i+3]*3+1], verts[info[i+3]*3+2]);
+
+ if (LineTriangleMinIntersection(v1, v2, v3, Start, End, pLine->mindist, Intersection))
{
pLine->pClosest = this;
}
@@ -519,9 +525,12 @@ void Piece::MinIntersectDist(LC_CLICKLINE* pLine)
for (i = 0; i < *info; i += 4)
{
- if (LineQuadMinIntersection((Point3&)verts[info[i+1]*3], (Point3&)verts[info[i+2]*3],
- (Point3&)verts[info[i+3]*3], (Point3&)verts[info[i+4]*3],
- Start, End, pLine->mindist, Intersection))
+ Vector3 v1(verts[info[i+1]*3], verts[info[i+1]*3+1], verts[info[i+1]*3+2]);
+ Vector3 v2(verts[info[i+2]*3], verts[info[i+2]*3+1], verts[info[i+2]*3+2]);
+ Vector3 v3(verts[info[i+3]*3], verts[info[i+3]*3+1], verts[info[i+3]*3+2]);
+ Vector3 v4(verts[info[i+4]*3], verts[info[i+4]*3+1], verts[info[i+4]*3+2]);
+
+ if (LineQuadMinIntersection(v1, v2, v3, v4, Start, End, pLine->mindist, Intersection))
{
pLine->pClosest = this;
}
@@ -531,8 +540,11 @@ void Piece::MinIntersectDist(LC_CLICKLINE* pLine)
for (i = 0; i < *info; i += 3)
{
- if (LineTriangleMinIntersection((Point3&)verts[info[i+1]*3], (Point3&)verts[info[i+2]*3],
- (Point3&)verts[info[i+3]*3], Start, End, pLine->mindist, Intersection))
+ Vector3 v1(verts[info[i+1]*3], verts[info[i+1]*3+1], verts[info[i+1]*3+2]);
+ Vector3 v2(verts[info[i+2]*3], verts[info[i+2]*3+1], verts[info[i+2]*3+2]);
+ Vector3 v3(verts[info[i+3]*3], verts[info[i+3]*3+1], verts[info[i+3]*3+2]);
+
+ if (LineTriangleMinIntersection(v1, v2, v3, Start, End, pLine->mindist, Intersection))
{
pLine->pClosest = this;
}
@@ -554,7 +566,7 @@ bool PolygonIntersectsPlanes(float* p1, float* p2, float* p3, float* p4, const V
// First do the Cohen-Sutherland out code test for trivial rejects/accepts.
for (i = 0; i < NumPoints; i++)
{
- Point3 Pt(Points[i][0], Points[i][1], Points[i][2]);
+ Vector3 Pt(Points[i][0], Points[i][1], Points[i][2]);
for (int j = 0; j < NumPlanes; j++)
{
@@ -585,17 +597,17 @@ bool PolygonIntersectsPlanes(float* p1, float* p2, float* p3, float* p4, const V
}
// Buffers for clipping the polygon.
- Point3 ClipPoints[2][8];
+ Vector3 ClipPoints[2][8];
int NumClipPoints[2];
int ClipBuffer = 0;
NumClipPoints[0] = NumPoints;
- ClipPoints[0][0] = Point3(p1[0], p1[1], p1[2]);
- ClipPoints[0][1] = Point3(p2[0], p2[1], p2[2]);
- ClipPoints[0][2] = Point3(p3[0], p3[1], p3[2]);
+ ClipPoints[0][0] = Vector3(p1[0], p1[1], p1[2]);
+ ClipPoints[0][1] = Vector3(p2[0], p2[1], p2[2]);
+ ClipPoints[0][2] = Vector3(p3[0], p3[1], p3[2]);
if (NumPoints == 4)
- ClipPoints[0][3] = Point3(p4[0], p4[1], p4[2]);
+ ClipPoints[0][3] = Vector3(p4[0], p4[1], p4[2]);
// Now clip the polygon against the planes.
for (i = 0; i < NumPlanes; i++)
@@ -613,29 +625,29 @@ bool PolygonIntersectsPlanes(float* p1, float* p2, float* p3, float* p4, const V
bool Piece::IntersectsVolume(const Vector4* Planes, int NumPlanes)
{
// First check the bounding box for quick rejection.
- Point3 Box[8] =
+ Vector3 Box[8] =
{
- Point3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[5]),
- Point3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[5]),
- Point3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[2]),
- Point3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[5]),
- Point3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[2]),
- Point3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[2]),
- Point3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[5]),
- Point3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[2])
+ Vector3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[5]),
+ Vector3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[5]),
+ Vector3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[2]),
+ Vector3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[5]),
+ Vector3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[2]),
+ Vector3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[2]),
+ Vector3(m_pPieceInfo->m_fDimensions[0], m_pPieceInfo->m_fDimensions[4], m_pPieceInfo->m_fDimensions[5]),
+ Vector3(m_pPieceInfo->m_fDimensions[3], m_pPieceInfo->m_fDimensions[1], m_pPieceInfo->m_fDimensions[2])
};
// Transform the planes to local space.
Matrix44 WorldToLocal;
WorldToLocal.CreateFromAxisAngle(Vector3(m_fRotation[0], m_fRotation[1], m_fRotation[2]), -m_fRotation[3] * LC_DTOR);
- WorldToLocal.SetTranslation(Point3(-m_fPosition[0], -m_fPosition[1], -m_fPosition[2]) * WorldToLocal);
+ WorldToLocal.SetTranslation(Mul31(Vector3(-m_fPosition[0], -m_fPosition[1], -m_fPosition[2]), WorldToLocal));
Vector4* LocalPlanes = new Vector4[NumPlanes];
int i;
for (i = 0; i < NumPlanes; i++)
{
- LocalPlanes[i] = Vector3(Planes[i]) * WorldToLocal;
+ LocalPlanes[i] = Mul30(Vector3(Planes[i]), WorldToLocal);
LocalPlanes[i][3] = Planes[i][3] - Dot3(Vector3(WorldToLocal[3]), Vector3(LocalPlanes[i]));
}
diff --git a/common/pieceinf.h b/common/pieceinf.h
index 7676700..c6856ec 100644
--- a/common/pieceinf.h
+++ b/common/pieceinf.h
@@ -73,11 +73,11 @@ class PieceInfo
return (m_strDescription[0] == '~');
}
- Point3 GetCenter() const
+ Vector3 GetCenter() const
{
- return Point3((m_fDimensions[0] + m_fDimensions[3]) * 0.5f,
- (m_fDimensions[1] + m_fDimensions[4]) * 0.5f,
- (m_fDimensions[2] + m_fDimensions[5]) * 0.5f);
+ return Vector3((m_fDimensions[0] + m_fDimensions[3]) * 0.5f,
+ (m_fDimensions[1] + m_fDimensions[4]) * 0.5f,
+ (m_fDimensions[2] + m_fDimensions[5]) * 0.5f);
}
// Operations
diff --git a/common/preview.cpp b/common/preview.cpp
index 82d16f6..c6c54ea 100644
--- a/common/preview.cpp
+++ b/common/preview.cpp
@@ -52,14 +52,14 @@ void PiecePreview::OnDraw()
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- Point3 Eye(0, 0, 1.0f);
+ Vector3 Eye(0, 0, 1.0f);
Matrix33 Rot;
Rot.CreateFromAxisAngle(Vector3(1, 0, 0), -m_RotateX * LC_DTOR);
- Eye = Eye * Rot;
+ Eye = Mul(Eye, Rot);
Rot.CreateFromAxisAngle(Vector3(0, 0, 1), -m_RotateZ * LC_DTOR);
- Eye = Eye * Rot;
+ Eye = Mul(Eye, Rot);
if (m_AutoZoom)
{
diff --git a/common/project.cpp b/common/project.cpp
index 763b056..d743a0e 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -2129,7 +2129,7 @@ void Project::RenderScene(bool bShaded, bool bDrawViewports)
{
if (m_nCurAction == LC_ACTION_INSERT)
{
- Point3 pos = GetPieceInsertPosition(m_nDownX, m_nDownY);
+ Vector3 pos = GetPieceInsertPosition(m_nDownX, m_nDownY);
glPushMatrix();
glTranslatef(pos[0], pos[1], pos[2]);
@@ -2403,13 +2403,13 @@ void Project::RenderOverlays(int Viewport)
for (j = 0; j < 32; j++)
{
- Point3 Pt;
+ Vector3 Pt;
Pt[0] = cosf(LC_2PI * j / 32) * OverlayRotateRadius * OverlayScale;
Pt[1] = sinf(LC_2PI * j / 32) * OverlayRotateRadius * OverlayScale;
Pt[2] = 0.0f;
- Pt = Pt * Mat;
+ Pt = Mul31(Pt, Mat);
glVertex3f(Pt[0], Pt[1], Pt[2]);
}
@@ -2468,8 +2468,8 @@ void Project::RenderOverlays(int Viewport)
if (Dot3(ViewDir, v1+v2) <= 0.0f)
{
- Point3 Pt1 = m_OverlayCenter + v1 * OverlayRotateRadius * OverlayScale;
- Point3 Pt2 = m_OverlayCenter + v2 * OverlayRotateRadius * OverlayScale;
+ Vector3 Pt1 = m_OverlayCenter + v1 * OverlayRotateRadius * OverlayScale;
+ Vector3 Pt2 = m_OverlayCenter + v2 * OverlayRotateRadius * OverlayScale;
glVertex3f(Pt1[0], Pt1[1], Pt1[2]);
glVertex3f(Pt2[0], Pt2[1], Pt2[2]);
@@ -2516,8 +2516,8 @@ void Project::RenderOverlays(int Viewport)
const float OverlayRotateArrowSize = 1.5f;
const float OverlayRotateArrowCapSize = 0.25f;
- Point3 Pt = m_OverlayCenter + Normal * OverlayScale * OverlayRotateRadius;
- Point3 Tip = Pt + Tangent * OverlayScale * OverlayRotateArrowSize;
+ Vector3 Pt = m_OverlayCenter + Normal * OverlayScale * OverlayRotateRadius;
+ Vector3 Tip = Pt + Tangent * OverlayScale * OverlayRotateArrowSize;
Vector3 Arrow;
Matrix33 Rot;
@@ -2528,13 +2528,13 @@ void Project::RenderOverlays(int Viewport)
glVertex3f(Tip[0], Tip[1], Tip[2]);
Rot.CreateFromAxisAngle(Normal, LC_PI * 0.15f);
- Arrow = Tangent * Rot * OverlayRotateArrowCapSize;
+ Arrow = Mul(Tangent, Rot) * OverlayRotateArrowCapSize;
glVertex3f(Tip[0], Tip[1], Tip[2]);
glVertex3f(Tip[0] - Arrow[0], Tip[1] - Arrow[1], Tip[2] - Arrow[2]);
Rot.CreateFromAxisAngle(Normal, -LC_PI * 0.15f);
- Arrow = Tangent * Rot * OverlayRotateArrowCapSize;
+ Arrow = Mul(Tangent, Rot) * OverlayRotateArrowCapSize;
glVertex3f(Tip[0], Tip[1], Tip[2]);
glVertex3f(Tip[0] - Arrow[0], Tip[1] - Arrow[1], Tip[2] - Arrow[2]);
@@ -6439,7 +6439,7 @@ void Project::SelectAndFocusNone(bool bFocusOnly)
// AfxGetMainWnd()->PostMessage(WM_LC_UPDATE_INFO, NULL, OT_PIECE);
}
-bool Project::GetSelectionCenter(Point3& Center) const
+bool Project::GetSelectionCenter(Vector3& Center) const
{
float bs[6] = { 10000, 10000, 10000, -10000, -10000, -10000 };
bool Selected = false;
@@ -6453,7 +6453,7 @@ bool Project::GetSelectionCenter(Point3& Center) const
}
}
- Center = Point3((bs[0] + bs[3]) * 0.5f, (bs[1] + bs[4]) * 0.5f, (bs[2] + bs[5]) * 0.5f);
+ Center = Vector3((bs[0] + bs[3]) * 0.5f, (bs[1] + bs[4]) * 0.5f, (bs[2] + bs[5]) * 0.5f);
return Selected;
}
@@ -6538,7 +6538,7 @@ Object* Project::GetFocusObject() const
}
// Try to find a good place for the user to add a new piece.
-Point3 Project::GetPieceInsertPosition(int MouseX, int MouseY)
+Vector3 Project::GetPieceInsertPosition(int MouseX, int MouseY)
{
// See if the mouse is over any pieces.
LC_CLICKLINE ClickLine;
@@ -6556,7 +6556,7 @@ Point3 Project::GetPieceInsertPosition(int MouseX, int MouseY)
mat.GetTranslation(pos);
SnapPoint(pos, NULL);
- return Point3(pos[0], pos[1], pos[2]);
+ return Vector3(pos[0], pos[1], pos[2]);
}
// Try to hit the base grid.
@@ -6576,10 +6576,10 @@ Point3 Project::GetPieceInsertPosition(int MouseX, int MouseY)
ModelView.CreateLookAt(Cam->GetEyePosition(), Cam->GetTargetPosition(), Cam->GetUpVector());
Projection.CreatePerspective(Cam->m_fovy, Aspect, Cam->m_zNear, Cam->m_zFar);
- Point3 ClickPoints[2] = { Point3((float)m_nDownX, (float)m_nDownY, 0.0f), Point3((float)m_nDownX, (float)m_nDownY, 1.0f) };
+ Vector3 ClickPoints[2] = { Vector3((float)m_nDownX, (float)m_nDownY, 0.0f), Vector3((float)m_nDownX, (float)m_nDownY, 1.0f) };
UnprojectPoints(ClickPoints, 2, ModelView, Projection, Viewport);
- Point3 Intersection;
+ Vector3 Intersection;
if (LinePlaneIntersection(Intersection, ClickPoints[0], ClickPoints[1], Vector4(0, 0, 1, 0)))
{
SnapVector((Vector3&)Intersection, Vector3(0, 0, 0));
@@ -6587,7 +6587,7 @@ Point3 Project::GetPieceInsertPosition(int MouseX, int MouseY)
}
// Couldn't find a good position, so just place the piece somewhere near the camera.
- return UnprojectPoint(Point3((float)m_nDownX, (float)m_nDownY, 0.9f), ModelView, Projection, Viewport);
+ return UnprojectPoint(Vector3((float)m_nDownX, (float)m_nDownY, 0.9f), ModelView, Projection, Viewport);
}
void Project::FindObjectFromPoint(int x, int y, LC_CLICKLINE* pLine, bool PiecesOnly)
@@ -6676,10 +6676,10 @@ void Project::FindObjectsInBox(float x1, float y1, float x2, float y2, PtrArray<
}
// Unproject 6 points to world space.
- Point3 Corners[6] =
+ Vector3 Corners[6] =
{
- Point3(Left, Top, 0), Point3(Left, Bottom, 0), Point3(Right, Bottom, 0),
- Point3(Right, Top, 0), Point3(Left, Top, 1), Point3(Right, Bottom, 1)
+ Vector3(Left, Top, 0), Vector3(Left, Bottom, 0), Vector3(Right, Bottom, 0),
+ Vector3(Right, Top, 0), Vector3(Left, Top, 1), Vector3(Right, Bottom, 1)
};
UnprojectPoints(Corners, 6, ModelView, Projection, Viewport);
@@ -6930,20 +6930,20 @@ bool Project::StopTracking(bool bAccept)
}
// Unproject screen points to world space.
- Point3 Points[3] =
+ Vector3 Points[3] =
{
- Point3((Left + Right) / 2, (Top + Bottom) / 2, 0.9f),
- Point3((float)Viewport[2] / 2.0f, (float)Viewport[3] / 2.0f, 0.9f),
- Point3((float)Viewport[2] / 2.0f, (float)Viewport[3] / 2.0f, 0.1f),
+ Vector3((Left + Right) / 2, (Top + Bottom) / 2, 0.9f),
+ Vector3((float)Viewport[2] / 2.0f, (float)Viewport[3] / 2.0f, 0.9f),
+ Vector3((float)Viewport[2] / 2.0f, (float)Viewport[3] / 2.0f, 0.1f),
};
UnprojectPoints(Points, 3, ModelView, Projection, Viewport);
// Center camera.
- Point3 Eye = Cam->GetEyePosition();
+ Vector3 Eye = Cam->GetEyePosition();
Eye = Eye + (Points[0] - Points[1]);
- Point3 Target = Cam->GetTargetPosition();
+ Vector3 Target = Cam->GetTargetPosition();
Target = Target + (Points[0] - Points[1]);
// Zoom in/out.
@@ -7205,7 +7205,7 @@ void Project::RotateSelectedObjects(const Vector3& Delta)
bs[2] = bs[5] = pos[2];
}
- Point3 Center((bs[0]+bs[3])/2, (bs[1]+bs[4])/2, (bs[2]+bs[5])/2);
+ Vector3 Center((bs[0]+bs[3])/2, (bs[1]+bs[4])/2, (bs[2]+bs[5])/2);
for (pPiece = m_pPieces; pPiece; pPiece = pPiece->m_pNext)
{
@@ -7221,37 +7221,37 @@ void Project::RotateSelectedObjects(const Vector3& Delta)
if (nSel == 1)
{
if (!(m_nSnap & LC_DRAW_LOCK_X) && (x != 0.0f))
- q = Quaternion(sinf(x / 2.0f * LC_DTOR), 0, 0, cosf(x / 2.0f * LC_DTOR)) * q;
+ q = Mul(Quaternion(sinf(x / 2.0f * LC_DTOR), 0, 0, cosf(x / 2.0f * LC_DTOR)), q);
if (!(m_nSnap & LC_DRAW_LOCK_Y) && (y != 0.0f))
- q = Quaternion(0, sinf(y / 2.0f * LC_DTOR), 0, cosf(y / 2.0f * LC_DTOR)) * q;
+ q = Mul(Quaternion(0, sinf(y / 2.0f * LC_DTOR), 0, cosf(y / 2.0f * LC_DTOR)), q);
if (!(m_nSnap & LC_DRAW_LOCK_Z) && (z != 0.0f))
- q = Quaternion(0, 0, sinf(z / 2.0f * LC_DTOR), cosf(z / 2.0f * LC_DTOR)) * q;
+ q = Mul(Quaternion(0, 0, sinf(z / 2.0f * LC_DTOR), cosf(z / 2.0f * LC_DTOR)), q);
}
else
{
- Vector3 Distance = Point3(pos[0], pos[1], pos[2]) - Center;
+ Vector3 Distance = Vector3(pos[0], pos[1], pos[2]) - Center;
if (!(m_nSnap & LC_DRAW_LOCK_X) && (x != 0.0f))
{
Quaternion RotX(sinf(x / 2.0f * LC_DTOR), 0, 0, cosf(x / 2.0f * LC_DTOR));
- q = RotX * q;
- Distance = Distance * RotX;
+ q = Mul(RotX, q);
+ Distance = Mul(Distance, RotX);
}
if (!(m_nSnap & LC_DRAW_LOCK_Y) && (y != 0.0f))
{
Quaternion RotY(0, sinf(y / 2.0f * LC_DTOR), 0, cosf(y / 2.0f * LC_DTOR));
- q = RotY * q;
- Distance = Distance * RotY;
+ q = Mul(RotY, q);
+ Distance = Mul(Distance, RotY);
}
if (!(m_nSnap & LC_DRAW_LOCK_Z) && (z != 0.0f))
{
Quaternion RotZ(0, 0, sinf(z / 2.0f * LC_DTOR), cosf(z / 2.0f * LC_DTOR));
- q = RotZ * q;
- Distance = Distance * RotZ;
+ q = Mul(RotZ, q);
+ Distance = Mul(Distance, RotZ);
}
pos[0] = Center[0] + Distance[0];
@@ -7807,7 +7807,7 @@ void Project::OnLeftButtonDown(int x, int y, bool bControl, bool bShift)
{
if (m_nCurAction == LC_ACTION_INSERT)
{
- Point3 Pos = GetPieceInsertPosition(x, y);
+ Vector3 Pos = GetPieceInsertPosition(x, y);
Piece* pPiece = new Piece(m_pCurPiece);
SnapVector((Vector3&)Pos, Vector3(0, 0, 0));
pPiece->Initialize(Pos[0], Pos[1], Pos[2], m_nCurStep, m_nCurFrame, m_nCurColor);
@@ -8763,13 +8763,13 @@ void Project::MouseUpdateOverlays(int x, int y)
int Mode = -1;
- Point3 SegStart((float)pts[0][0], (float)pts[0][1], (float)pts[0][2]);
- Point3 Pt((float)x, (float)y, 0);
+ Vector3 SegStart((float)pts[0][0], (float)pts[0][1], (float)pts[0][2]);
+ Vector3 Pt((float)x, (float)y, 0);
// Check if the mouse is over an arrow.
for (int i = 1; i < 4; i++)
{
- Point3 SegEnd((float)pts[i][0], (float)pts[i][1], (float)pts[i][2]);
+ Vector3 SegEnd((float)pts[i][0], (float)pts[i][1], (float)pts[i][2]);
Vector3 Line = SegEnd - SegStart;
Vector3 Vec = Pt - SegStart;
@@ -8780,7 +8780,7 @@ void Project::MouseUpdateOverlays(int x, int y)
continue;
// Closest point in the line segment to the mouse.
- Point3 Closest = SegStart + u * Line;
+ Vector3 Closest = SegStart + u * Line;
if ((Closest - Pt).LengthSquared() < 100.0f)
{
@@ -8841,9 +8841,9 @@ void Project::MouseUpdateOverlays(int x, int y)
gluUnProject(x, y, 0, ModelMatrix, ProjMatrix, Viewport, &px, &py, &pz);
gluUnProject(x, y, 1, ModelMatrix, ProjMatrix, Viewport, &rx, &ry, &rz);
- Point3 SegStart((float)rx, (float)ry, (float)rz);
- Point3 SegEnd((float)px, (float)py, (float)pz);
- Point3 Center(m_OverlayCenter[0], m_OverlayCenter[1], m_OverlayCenter[2]);
+ Vector3 SegStart((float)rx, (float)ry, (float)rz);
+ Vector3 SegEnd((float)px, (float)py, (float)pz);
+ Vector3 Center(m_OverlayCenter[0], m_OverlayCenter[1], m_OverlayCenter[2]);
Vector3 Line = SegEnd - SegStart;
Vector3 Vec = Center - SegStart;
@@ -8851,7 +8851,7 @@ void Project::MouseUpdateOverlays(int x, int y)
float u = Dot3(Vec, Line) / Line.LengthSquared();
// Closest point in the line to the mouse.
- Point3 Closest = SegStart + u * Line;
+ Vector3 Closest = SegStart + u * Line;
int Mode = -1;
float Distance = (Closest - Center).Length();
@@ -8897,10 +8897,10 @@ void Project::MouseUpdateOverlays(int x, int y)
float u1 = (-b + sqrtf(f)) / (2*a);
float u2 = (-b - sqrtf(f)) / (2*a);
- Point3 Intersections[2] =
+ Vector3 Intersections[2] =
{
- Point3(x1 + u1*(x2-x1), y1 + u1*(y2-y1), z1 + u1*(z2-z1)),
- Point3(x1 + u2*(x2-x1), y1 + u2*(y2-y1), z1 + u2*(z2-z1))
+ Vector3(x1 + u1*(x2-x1), y1 + u1*(y2-y1), z1 + u1*(z2-z1)),
+ Vector3(x1 + u2*(x2-x1), y1 + u2*(y2-y1), z1 + u2*(z2-z1))
};
for (int i = 0; i < 2; i++)
diff --git a/common/project.h b/common/project.h
index 6210c97..eee1b5a 100644
--- a/common/project.h
+++ b/common/project.h
@@ -161,11 +161,11 @@ protected:
void AddPiece(Piece* pPiece);
void RemovePiece(Piece* pPiece);
bool RemoveSelectedObjects();
- Point3 GetPieceInsertPosition(int MouseX, int MouseY);
+ Vector3 GetPieceInsertPosition(int MouseX, int MouseY);
void FindObjectFromPoint(int x, int y, LC_CLICKLINE* pLine, bool PiecesOnly = false);
void FindObjectsInBox(float x1, float y1, float x2, float y2, PtrArray<Object>& Objects);
void SelectAndFocusNone(bool bFocusOnly);
- bool GetSelectionCenter(Point3& Center) const;
+ bool GetSelectionCenter(Vector3& Center) const;
void CalculateStep();
void MoveSelectedObjects(const Vector3& Delta);
void RotateSelectedObjects(const Vector3& Delta);
@@ -218,8 +218,8 @@ protected:
int m_OverlayMode;
bool m_OverlayActive;
float m_OverlayScale[4];
- Point3 m_OverlayCenter;
- Point3 m_OverlayTrackStart;
+ Vector3 m_OverlayCenter;
+ Vector3 m_OverlayTrackStart;
Vector3 m_OverlayDelta;
void MouseUpdateOverlays(int x, int y);
void ActivateOverlay();