Check character positioning with a box check (character must be inside at least one of the defined boxes)
843 {
844 const float CYLINDER_HEIGHT = 0.01;
845 const float CYLINDER_RADIUS = 0.01;
846
847 #ifdef DIAG_DEVELOPER
849 if (fullDebugEnabled || (!fullDebugEnabled && m_InsideTestBoxes.Count() > 0))
850 DestroyDebugInsideTestBoxes();
851 #endif
852
854 if (!modelMinMaxs)
855 return true;
856
859 vector adjustedPos = player.GetPosition();
860 adjustedPos[1] = adjustedPos[1] + CYLINDER_HEIGHT / 2;
861 matPlayer[3] = adjustedPos;
862
863 #ifdef DIAG_DEVELOPER
864 if (fullDebugEnabled)
865 {
866 if (m_PlayerInsideTestCylinder)
867 m_PlayerInsideTestCylinder.Destroy();
869 m_PlayerInsideTestCylinder.SetMatrix(matPlayer);
870 }
871 #endif
872
875 bool success = false;
876
878 {
879 vector min = minMaxPair[0];
880 vector max = minMaxPair[1];
881
882 bool playerInside = false;
883
884
886
887 if (playerInside)
888 {
889 success = true;
890 #ifdef DIAG_DEVELOPER
891 if (fullDebugEnabled)
892 {
893 DrawDebugInsideTestBox(min, max,
ARGB(90, 128, 128, 128));
894 }
895 else
896 #else
897 return true;
898 #endif
899 }
900 #ifdef DIAG_DEVELOPER
901 else
902 {
903 if (fullDebugEnabled)
904 {
905 DrawDebugInsideTestBox(min, max,
ARGB(90, 128, 0, 128));
906 }
907 }
908 #endif
909 }
910
911 #ifdef DIAG_DEVELOPER
912 if (fullDebugEnabled)
913 {
914 if (!success)
915 ConstructionDebug.SetInsideboxCheckDebugData(part.
GetPartName());
916 else
917 ConstructionDebug.SetInsideboxCheckDebugData("");
918 }
919 #endif
920
921 return success;
922 }
array< ref array< vector > > TConstructionPartInsiderBoxData
TConstructionPartInsiderBoxData GetInsiderBoxData()
translated MODELSPACE positions of min/max memory points (should be single points in memory LOD)
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool IntersectCylinderOBB(vector mins, vector maxs, vector obbMat[4], vector cylMat[4], float cylinderRadius, float cylinderHeight)
Tests whether cylinder is intersecting oriented box.
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
int ARGB(int a, int r, int g, int b)