summaryrefslogtreecommitdiffstats
path: root/source/Tracer.h
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2013-11-05 17:22:28 +0100
committerSamuel Barney <samjbarney@gmail.com>2013-11-05 17:22:28 +0100
commite37531fe0104b1f97d75a24d2b0e03bf507eded8 (patch)
tree5743b03360c3cc9731f4a0691180bd247594e358 /source/Tracer.h
parentReworked collision to use g_BlockIsSolid (diff)
downloadcuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.tar
cuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.tar.gz
cuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.tar.bz2
cuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.tar.lz
cuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.tar.xz
cuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.tar.zst
cuberite-e37531fe0104b1f97d75a24d2b0e03bf507eded8.zip
Diffstat (limited to 'source/Tracer.h')
-rw-r--r--source/Tracer.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/Tracer.h b/source/Tracer.h
index 2f627366f..a4e2d352e 100644
--- a/source/Tracer.h
+++ b/source/Tracer.h
@@ -12,14 +12,29 @@ public: // tolua_export
Vector3f BoxOffset;
cTracer( cWorld* a_World); // tolua_export
~cTracer(); // tolua_export
+
+ /// Determines if a collision occures along a line.
int Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int a_Distance ); // tolua_export
- void SetValues( const Vector3f & a_Start, const Vector3f & a_Direction ); // tolua_export
+
+ /// Contains the position of the block that caused the collision
Vector3f BlockHitPosition; // tolua_export
+
+ /// Contains which face was hit
Vector3f HitNormal; // tolua_export
+
+ /// Contains the exact position where a collision occured. (BlockHitPosition + Offset on block)
Vector3f RealHit; // tolua_export
private:
+
+ /// Preps Tracer object for call of Trace function. Only used internally
+ void SetValues( const Vector3f & a_Start, const Vector3f & a_Direction );
+
+ /// Calculates where on the block a collision occured, if it does occur
int intersect3D_SegmentPlane( const Vector3f & a_Origin, const Vector3f & a_End, const Vector3f & a_PlanePos, const Vector3f & a_PlaneNormal );
+
+ /// Determines which face on the block a collision occured, if it does occur
int GetHitNormal( const Vector3f & start, const Vector3f & end, const Vector3i & a_BlockPos);
+
float SigNum( float a_Num );
cWorld* m_World;