11 string m_CollisionDetails;
85 string baseStringBegin = Watchtower.BASE_VIEW_NAME;
86 string baseIgnoreStringEnd = Watchtower.BASE_WALL_NAME;
88 int floors = Watchtower.MAX_WATCHTOWER_FLOORS;
89 int walls = Watchtower.MAX_WATCHTOWER_WALLS;
92 for (
int i = 1; i < floors + 1; ++i)
94 compName = baseStringBegin + i.
ToString();
95 for (
int j = 1; j < walls + 1; ++j)
105 string configPathProjectionTypename =
string.Format(
"CfgVehicles %1 projectionTypename",
m_Parent.GetType());
106 if (
g_Game.ConfigIsExisting(configPathProjectionTypename))
115 projectionEntity.SetAllowDamage(
false);
122 if (projectionEntity == null)
134 if (
ItemBase.Cast(projectionEntity))
140 if (
g_Game.ConfigIsExisting(configPathSlope))
146 if (
g_Game.ConfigIsExisting(configPathAlign))
152 if (
g_Game.ConfigIsExisting(configPathOrientationLimit))
173 #ifdef DIAG_DEVELOPER
200 string cfg_access =
"CfgVehicles " +
m_Projection.GetType() +
" AnimationSources ";
202 if (
g_Game.ConfigIsExisting(cfg_access) )
204 int cfg_access_count =
g_Game.ConfigGetChildrenCount(cfg_access);
206 for (
int i = 0; i < cfg_access_count; ++i )
209 g_Game.ConfigGetChildName(cfg_access, i, found_anim);
211 float anim_phase =
m_Parent.GetAnimationPhase(found_anim);
237 return "GardenPlotPlacing";
243 return item.GetType() +
"Placing";
246 return item.GetType();
276 #ifdef DIAG_DEVELOPER
312 normal =
g_Game.SurfaceGetNormal( projection_position[0], projection_position[2] );
316 angles[1] = angles[1] + 270;
318 angles[0] =
Math.
Clamp( angles[0], 0, 360 );
319 angles[1] =
Math.
Clamp( angles[1], 0, 360 );
320 angles[2] =
Math.
Clamp( angles[2], 0, 360 );
322 projection_orientation_angles[0] = projection_orientation_angles[0] + ( 360 - angles[0] );
334 if ( y_p_r[0] > 180 )
336 y_p_r[0] = y_p_r[0] - 360;
339 if ( y_p_r[0] < -180 )
341 y_p_r[0] = y_p_r[0] + 360;
396 #ifdef DIAG_DEVELOPER
397 void DebugLog(
string header,
bool mustBeTrue =
false,
bool condition =
true,
string info =
"")
401 int color = 0xFFFFFFFF;
403 if (mustBeTrue && !condition || !mustBeTrue && condition)
406 string text = header + condition + info;
411 protected float m_PitchOverride;
412 protected float m_RollOverride;
413 void DebugConfigValues()
422 DbgUI.InputFloat(
"pitch limit override", m_PitchOverride);
424 DbgUI.InputFloat(
"roll limit override", m_RollOverride);
434 #ifdef DIAG_DEVELOPER
435 m_CollisionDetails =
"";
440 #ifdef DIAG_DEVELOPER
441 m_CollisionDetails +=
"[Player]";
452 #ifdef DIAG_DEVELOPER
453 DebugLog(
"Inherits from TrapSpawnBase, checking IsPlaceableAtposition",
true);
462 #ifdef DIAG_DEVELOPER
463 DebugLog(
"Inherits from TrapBase, checking IsPlaceableAtposition",
true);
487 #ifdef DIAG_DEVELOPER
493 #ifdef DIAG_DEVELOPER
494 MiscGameplayFunctions.IsUnderRoofFromToCalculation(
m_Projection, from, to);
495 DrawArrow(from, to, !b2);
499 #ifdef DIAG_DEVELOPER
500 DebugLog(
"IsClippingRoof: ",
false, b1,
" | (projection height) " +
m_Projection.GetPosition()[1] +
" > (camera height) " +
g_Game.GetCurrentCameraPosition()[1]);
501 DebugLog(
"IsClippingRoof: ",
false, b2,
" | (DoPlacingHeightCheck) " +
m_Projection.DoPlacingHeightCheck() +
" && (IsUnderRoof) " + MiscGameplayFunctions.IsUnderRoof(
m_Projection) +
" | from: " + from[1] +
" | to: " + to[1]);
513 #ifdef DIAG_DEVELOPER
520 #ifdef DIAG_DEVELOPER
547 vector absoluteOffset =
"0 0.05 0";
555 relativeOffset[1] = (minMax[1][1] - minMax[0][1]) * 0.5;
556 center =
m_Projection.GetPosition() + relativeOffset + absoluteOffset;
562 excludedObjects.Insert(action_item);
566 bool isTrue =
g_Game.IsBoxCollidingGeometry(center, orientation, edgeLength, ObjIntersectFire, ObjIntersectGeom, excludedObjects, collidedObjects);
567 #ifdef DIAG_DEVELOPER
571 foreach (
Object object: collidedObjects)
572 text +=
" | " +
Object.GetDebugName(
object);
574 DebugLog(
"IsCollidingBBox: ",
false, isTrue, text);
576 int color = 0x01FFFFFF;
596 vector absoluteOffset =
"0 0.05 0";
604 relativeOffset[1] = (minMax[1][1] - minMax[0][1]) * 0.5;
605 center =
m_Projection.GetPosition() + relativeOffset + absoluteOffset;
611 excludedObjects.Insert(action_item);
614 params.
SetParams(center, orientation, edgeLength, ObjIntersect.View, ObjIntersect.Geom,
false);
615 bool isTrue =
g_Game.IsBoxCollidingGeometryProxy(params, excludedObjects, collidedObjects);
616 #ifdef DIAG_DEVELOPER
620 foreach (BoxCollidingResult
object: collidedObjects)
621 text +=
" | " +
Object.GetDebugName(
object.obj);
623 DebugLog(
"IsCollidingGeometryProxy: ",
false, isTrue, text);
625 int color = 0x01FFFFFF;
661 vector contact_pos_left_close;
662 vector contact_pos_right_close;
663 vector contact_pos_left_far;
664 vector contact_pos_right_far;
665 vector contact_dir_left_close;
666 vector contact_dir_right_close;
667 vector contact_dir_left_far;
668 vector contact_dir_right_far;
669 int contact_component_left_close;
670 int contact_component_right_close;
671 int contact_component_left_far;
672 int contact_component_right_far;
673 set<Object> results_left_close =
new set<Object>;
674 set<Object> results_right_close =
new set<Object>;
675 set<Object> results_left_far =
new set<Object>;
676 set<Object> results_right_far =
new set<Object>;
683 DayZPhysics.
RaycastRV(from_left_close, to_left_close_down, contact_pos_left_close, contact_dir_left_close, contact_component_left_close, results_left_close, null,
m_Projection,
false,
false, ObjIntersectFire);
684 if (results_left_close.Count() > 0)
685 obj_left_close = results_left_close[results_left_close.Count() - 1];
687 DayZPhysics.
RaycastRV(from_right_close, to_right_close_down, contact_pos_right_close, contact_dir_right_close, contact_component_right_close, results_right_close, null,
m_Projection,
false,
false, ObjIntersectFire);
688 if (results_right_close.Count() > 0)
689 obj_right_close = results_right_close[results_right_close.Count() - 1];
691 DayZPhysics.
RaycastRV(from_left_far, to_left_far_down, contact_pos_left_far, contact_dir_left_far, contact_component_left_far, results_left_far, null,
m_Projection,
false,
false, ObjIntersectFire);
692 if (results_left_far.Count() > 0)
693 obj_left_far = results_left_far[results_left_far.Count() - 1];
695 DayZPhysics.
RaycastRV(from_right_far, to_right_far_down, contact_pos_right_far, contact_dir_right_far, contact_component_right_far, results_right_far, null,
m_Projection,
false,
false, ObjIntersectFire);
696 if (results_right_far.Count() > 0)
697 obj_right_far = results_right_far[results_right_far.Count() - 1];
699 return IsBaseIntact(obj_left_close, obj_right_close, obj_left_far, obj_right_far ) &&
IsBaseStatic( obj_left_close ) &&
IsBaseFlat( contact_pos_left_close, contact_pos_right_close, contact_pos_left_far, contact_pos_right_far);
707 #ifdef DIAG_DEVELOPER
718 #ifdef DIAG_DEVELOPER
719 DebugLog(
"IsCollidingZeroPos: ",
false, isTrue);
737 #ifdef DIAG_DEVELOPER
738 if (objectToCheck == null)
739 DebugLog(
"IsBaseStatic(must be true): ",
true,
true,
" | objectToCheck is null (this is good)");
741 DebugLog(
"IsBaseStatic(must be true): ",
true,
IsObjectStatic(objectToCheck));
753 bool isTrue = (under_left_close == under_right_close && under_right_close == under_left_far && under_left_far == under_right_far);
754 #ifdef DIAG_DEVELOPER
755 DebugLog(
"IsBaseIntact(must be true and all equal): ",
true, isTrue,
" | ulc: " +
Object.GetDebugName(under_left_close) +
" | urc: " +
Object.GetDebugName(under_right_close) +
" | ulf: " +
Object.GetDebugName(under_left_far) +
" | urf: " +
Object.GetDebugName(under_right_far));
759 conditions.Insert(under_left_close == null);
760 conditions.Insert(under_right_close == null);
761 conditions.Insert(under_left_far == null);
762 conditions.Insert(under_right_far == null);
764 int amountOfNull = 0;
765 if (!under_left_close)
767 if (!under_right_close)
771 if (!under_right_far)
774 if ( amountOfNull < 3 )
775 for (
int i = 0; i < conditions.Count(); ++i)
776 conditions[i] = !conditions[i];
778 DrawBaseSpheres(conditions);
785 #ifdef DIAG_DEVELOPER
790 int color = 0xFFFFFFFF;
798 void DrawSphere(vector pos,
bool condition)
802 int color = 0x01FFFFFF;
810 void DrawBaseSpheres(array<bool> conditions)
814 array<vector> positions =
new array<vector>();
820 for (
int i = 0; i < positions.Count(); ++i)
821 DrawSphere(positions[i], conditions[i]);
825 void DrawDebugArrow(
float start,
float dist,
int color = 0xFF1FFFFF)
829 vector from =
m_Player.GetPosition() + start * MiscGameplayFunctions.GetHeadingVector(
m_Player);
830 vector to =
m_Player.GetPosition() + dist * MiscGameplayFunctions.GetHeadingVector(
m_Player);
840 float slope_pos_left_close =
Math.
AbsFloat(projection_pos[1] - contact_pos_left_close[1]);
841 float slope_pos_right_close =
Math.
AbsFloat(projection_pos[1] - contact_pos_right_close[1]);
842 float slope_pos_left_far =
Math.
AbsFloat(projection_pos[1] - contact_pos_left_far[1]);
843 float slope_pos_right_far =
Math.
AbsFloat(projection_pos[1] - contact_pos_right_far[1]);
846 #ifdef DIAG_DEVELOPER
847 DebugLog(
"IsBaseFlat(must be true): ",
true, isTrue,
" (slope < slopeTolerance) | slopeTolerance: " +
m_SlopeTolerance +
" | lc: " + slope_pos_left_close +
" | rc: " + slope_pos_right_close +
" | lf: " + slope_pos_left_far +
" | rf: " + slope_pos_right_far);
848 DrawArrow(projection_pos, contact_pos_left_close, slope_pos_left_close <
m_SlopeTolerance);
849 DrawArrow(projection_pos, contact_pos_right_close, slope_pos_right_close <
m_SlopeTolerance);
850 DrawArrow(projection_pos, contact_pos_left_far, slope_pos_left_far <
m_SlopeTolerance);
851 DrawArrow(projection_pos, contact_pos_right_far, slope_pos_right_far <
m_SlopeTolerance);
865 #ifdef DIAG_DEVELOPER
866 DebugLog(
"IsPlacementPermitted(must be true): ",
true, isTrue,
" (Note: ItemBase::CanBePlaced() return value)");
880 float delta1 = playerpos[1] - projectionpos[1];
884 #ifdef DIAG_DEVELOPER
885 DebugLog(
"HeightPlacementCheck(must be true): ",
true,
false,
" | Height difference between item and player is larger than " +
DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF);
890 #ifdef DIAG_DEVELOPER
891 DebugLog(
"HeightPlacementCheck(must be true): ",
true,
true);
907 #ifdef DIAG_DEVELOPER
908 DebugLog(
"IsUnderwater: ",
false,
true,
" | Surface under object is water");
918 float maxSea =
g_Game.SurfaceGetSeaLevelMax() + 0.03;
919 bool belowMaxSea = left_close[1] < maxSea || right_close[1] < maxSea || left_far[1] < maxSea || right_far[1] < maxSea;
921 #ifdef DIAG_DEVELOPER
923 float lc =
g_Game.GetWaterDepth(left_close);
924 float rc =
g_Game.GetWaterDepth(right_close);
925 float lf =
g_Game.GetWaterDepth(left_far);
926 float rf =
g_Game.GetWaterDepth(right_far);
927 bool isTrue = (lc > 0 || rc > 0 || lf > 0 || rf > 0 || belowMaxSea);
928 DebugLog(
"IsUnderwater: ",
false, isTrue,
" belowMaxSea: " + belowMaxSea +
" | (all must be less than zero) | lc: " + lc +
" | rc: " + rc +
" | lf: " + lf +
" | rf: " + rf);
932 array<bool> conditions = {lc <= 0, rc <= 0, lf <= 0, rf <= 0};
933 DrawBaseSpheres(conditions);
937 return (belowMaxSea ||
g_Game.GetWaterDepth(left_close) > 0 ||
g_Game.GetWaterDepth(right_close) > 0 ||
g_Game.GetWaterDepth(left_far) > 0 ||
g_Game.GetWaterDepth(right_far) > 0);
944 vector fromHeightOffset =
"0 0.3 0";
945 vector toHeightOffset =
"0 1 0";
948 vector to_left_close_down = from_left_close + toHeightOffset;
951 vector to_right_close_down = from_right_close + toHeightOffset;
954 vector to_left_far_down = from_left_far + toHeightOffset;
957 vector to_right_far_down = from_right_far + toHeightOffset;
959 vector contact_pos_left_close;
960 vector contact_pos_right_close;
961 vector contact_pos_left_far;
962 vector contact_pos_right_far;
964 vector contact_dir_left_close;
965 vector contact_dir_right_close;
966 vector contact_dir_left_far;
967 vector contact_dir_right_far;
969 int contact_component_left_close;
970 int contact_component_right_close;
971 int contact_component_left_far;
972 int contact_component_right_far;
974 #ifdef DIAG_DEVELOPER
976 set<Object> lcO =
new set<Object>();
977 set<Object> rcO =
new set<Object>();
978 set<Object> lfO =
new set<Object>();
979 set<Object> rfO =
new set<Object>();
980 bool lc =
DayZPhysics.
RaycastRV( from_left_close, to_left_close_down, contact_pos_left_close, contact_dir_left_close, contact_component_left_close, lcO,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire );
981 bool rc =
DayZPhysics.
RaycastRV( from_right_close, to_right_close_down, contact_pos_right_close, contact_dir_right_close, contact_component_right_close, rcO,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire );
982 bool lf =
DayZPhysics.
RaycastRV( from_left_far, to_left_far_down, contact_pos_left_far, contact_dir_left_far, contact_component_left_far, lfO,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire );
983 bool rf =
DayZPhysics.
RaycastRV( from_right_far, to_right_far_down, contact_pos_right_far, contact_dir_right_far, contact_component_right_far, rfO,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire );
984 bool isTrue = ( lc || rc || lf || rf );
998 text +=
" | lcO: " + lcO[0];
1000 text +=
" | rcO: " + rcO[0];
1001 if (lfO.Count() > 0)
1002 text +=
" | lfO: " + lfO[0];
1003 if (rfO.Count() > 0)
1004 text +=
" | rfO: " + rfO[0];
1007 DrawBaseSpheres(conditions);
1009 DebugLog(
"IsInTerrain: ",
false, isTrue, text);
1012 if (
DayZPhysics.
RaycastRV( from_left_close, to_left_close_down, contact_pos_left_close, contact_dir_left_close, contact_component_left_close, NULL,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire ))
1015 if (
DayZPhysics.
RaycastRV( from_right_close, to_right_close_down, contact_pos_right_close, contact_dir_right_close, contact_component_right_close, NULL,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire ))
1018 if (
DayZPhysics.
RaycastRV( from_left_far, to_left_far_down, contact_pos_left_far, contact_dir_left_far, contact_component_left_far, NULL,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire ))
1021 if (
DayZPhysics.
RaycastRV( from_right_far, to_right_far_down, contact_pos_right_far, contact_dir_right_far, contact_component_right_far, NULL,
m_Projection,
m_Projection,
false,
true, ObjIntersectFire ))
1033 m_Parent.GetCompEM().UpdatePlugState();
1038 if (!
m_Parent.GetCompEM().IsPlugged())
1047 if (entity_for_placing.IsInherited(
TentBase) || entity_for_placing.IsBasebuildingKit() )
1049 return entity_for_placing;
1055 return entity_for_placing;
1064 return entity_for_placing;
1071 min_max[0] =
m_Projection.GetMemoryPointPos(
"box_placing_min" );
1072 min_max[1] =
m_Projection.GetMemoryPointPos(
"box_placing_max" );
1082 box_size[0] = min_max[1][0] - min_max[0][0];
1083 box_size[2] = min_max[1][2] - min_max[0][2];
1084 box_size[1] = min_max[1][1] - min_max[0][1];
1101 min_max[1][1] = min_max[0][1];
1102 min_max[1][2] = min_max[0][2];
1111 min_max[0][2] = min_max[1][2];
1120 min_max[1][1] = min_max[0][1];
1128 return g_Game.SurfaceIsSea( position[0], position[2] ) ||
g_Game.SurfaceIsPond( position[0], position[2] );
1133 return g_Game.SurfaceIsSea( position[0], position[2] );
1138 float minProjectionDistance;
1139 float maxProjectionDistance;
1143 float cameraToPlayerDistance =
vector.
Distance(
g_Game.GetCurrentCameraPosition(), player.GetPosition());
1152 minProjectionDistance = projectionRadius;
1153 maxProjectionDistance = projectionRadius * 2;
1158 vector to = from + (
g_Game.GetCurrentCameraDirection() * (maxProjectionDistance + cameraToPlayerDistance));
1160 set<Object> hitObjects =
new set<Object>();
1162 DayZPhysics.
RaycastRV(from, to, contactPosition,
m_ContactDir,
m_ContactComponent, hitObjects, player,
m_Projection,
false,
false, ObjIntersectFire);
1164 bool contactHitProcessed =
false;
1168 if (hitObjects.Count() > 0)
1170 if (hitObjects[0].IsInherited(Watchtower))
1172 contactHitProcessed =
true;
1176 if (!contactHitProcessed && hitObjects[0].IsInherited(
InventoryItem))
1177 contactPosition = hitObjects[0].GetPosition();
1181 static const float raycastOriginOffsetOnFail = 0.25;
1182 static const float minDistFromStart = 0.01;
1184 if ((hitObjects.Count() > 0) && (
vector.
DistanceSq(from, contactPosition) < minDistFromStart))
1186 from = contactPosition +
g_Game.GetCurrentCameraDirection() * raycastOriginOffsetOnFail;
1187 DayZPhysics.
RaycastRV(from, to, contactPosition,
m_ContactDir,
m_ContactComponent, hitObjects, player,
m_Projection,
false,
false, ObjIntersectFire);
1190 bool isFloating =
SetHologramPosition(player.GetPosition(), minProjectionDistance, maxProjectionDistance, contactPosition);
1193 #ifdef DIAG_DEVELOPER
1194 DrawDebugArrow(minProjectionDistance, maxProjectionDistance);
1203 return contactPosition;
1216 float playerToProjectionDistance =
vector.
Distance(startPosition, contactPosition);
1217 vector playerToProjection;
1219 #ifdef DIAG_DEVELOPER
1220 DebugLog(
"SetHologramPosition::startPosition: ",
false,
m_IsHidden,
string.Format(
" | %1", startPosition));
1221 DebugLog(
"SetHologramPosition::contactPosition [in]: ",
false,
m_IsHidden,
string.Format(
" | %1", contactPosition));
1222 DebugLog(
"SetHologramPosition::minProjectionDistance: ",
false,
m_IsHidden,
string.Format(
" | %1", minProjectionDistance));
1223 DebugLog(
"SetHologramPosition::maxProjectionDistance: ",
false,
m_IsHidden,
string.Format(
" | %1", maxProjectionDistance));
1224 DebugLog(
"SetHologramPosition::playerToProjectionDistance: ",
false,
m_IsHidden,
string.Format(
" | %1", playerToProjectionDistance));
1228 if (playerToProjectionDistance <= minProjectionDistance)
1230 playerToProjection = contactPosition - startPosition;
1235 contactPosition = startPosition + (playerToProjection * minProjectionDistance);
1237 #ifdef DIAG_DEVELOPER
1238 DebugLog(
"SetHologramPosition::contactPosition[out] (< minProjectDistance): ",
false,
m_IsHidden,
string.Format(
" | %1", contactPosition));
1244 else if (playerToProjectionDistance >= maxProjectionDistance)
1246 playerToProjection = contactPosition - startPosition;
1251 contactPosition = startPosition + (playerToProjection * maxProjectionDistance);
1253 #ifdef DIAG_DEVELOPER
1254 DebugLog(
"SetHologramPosition::contactPosition[out] (< maxProjectionDistance): ",
false,
m_IsHidden,
string.Format(
" | %1", contactPosition));
1272 contactPos[1] = hitObject.GetActionComponentPosition(contactComponent,
LOD.
NAME_VIEW)[1];
1292 diameter = diagonal.
Length();
1306 diameter = diagonal.
Length();
1307 radius = diameter / 2;
1344 #ifdef DIAG_DEVELOPER
1345 DebugLog(
"Is colliding: ",
false, is_colliding, m_CollisionDetails);
1367 #ifdef DIAG_DEVELOPER
1380 #ifdef DIAG_DEVELOPER
1390 #ifdef DIAG_DEVELOPER
1430 vector player_to_projection_vector;
1435 vector to = from + ground;
1445 for (
int i = 0; i < results.Count(); i++)
1447 res = results.Get(i);
1450 contact_pos = res.
pos;
1457 if (contact_pos !=
"0 0 0")
1461 int check_component = -1;
1462 set<Object> hit_object =
new set<Object>;
1464 to[1] = to[1] + 0.1;
1467 if (
DayZPhysics.
RaycastRV(from, to, check_pos, check_dir, check_component, hit_object, null,
m_Player,
false,
false, ObjIntersectFire))
1469 if ((hit_object.Count() > 0)&& (!hit_object[0].IsInherited(Watchtower) || (hit_object[0].IsInherited(Watchtower) && (
m_WatchtowerIgnoreComponentNames.Find(hit_object[0].GetActionComponentName(check_component,
LOD.
NAME_VIEW)) == -1))))
1471 contact_pos =
"0 0 0";
1525 int idx =
m_Projection.GetHiddenSelectionIndex(selection);
1542 foreach (
string s : selection)
1550 static const string textureName =
"#(argb,8,8,3)color(0.5,0.5,0.5,0.75,ca)";
1552 int hidden_selection = 0;
1553 string selection_to_refresh;
1554 string config_material =
string.Format(
"CfgVehicles %1 hologramMaterial",
m_Projection.GetType());
1555 string hologram_material =
g_Game.ConfigGetTextOut(config_material);
1556 string config_model =
string.Format(
"CfgVehicles %1 hologramMaterialPath",
m_Projection.GetType());
1557 string hologram_material_path =
string.Format(
"%1\\%2%3",
g_Game.ConfigGetTextOut(config_model), hologram_material,
CorrectMaterialPathName());
1563 m_Projection.SetObjectTexture(hidden_selection, textureName);
1564 m_Projection.SetObjectMaterial(hidden_selection, hologram_material_path);
1576 else if (
m_Parent.HasEnergyManager())
1579 string SEL_CORD_PLUGGED =
m_Parent.GetCompEM().SEL_CORD_PLUGGED;
1580 string SEL_CORD_FOLDED =
m_Parent.GetCompEM().SEL_CORD_FOLDED;
eBleedingSourceType GetType()
const int ECE_OBJECT_SWAP
const int ECE_PLACE_ON_SURFACE
const int ECE_CREATEPHYSICS
void DrawDebugCollisionBox(vector min_max[2], int color)
void DestroyDebugCollisionBox()
void DeployableContainer_Base()
proto native void SetParams(vector center, vector orientation, vector edgeLength, ObjIntersect primaryType, ObjIntersect secondaryType, bool fullComponentInfo)
Set the parameters.
Class that holds parameters to feed into CGame.IsBoxCollidingGeometryProxy.
static bool GetDisableIsInTerrainCheck()
static bool GetDisableIsClippingRoofCheck()
static bool GetDisableIsUnderwaterCheck()
static bool GetDisableIsCollidingBBoxCheck()
static bool GetDisableHeightPlacementCheck()
static bool GetDisableIsPlacementPermittedCheck()
static bool GetDisableIsCollidingPlayerCheck()
static bool GetDisableIsCollidingGPlotCheck()
static bool GetDisableIsCollidingAngleCheck()
static bool GetDisableIsBaseViableCheck()
Super root of all classes in Enforce script.
bool IsEnergySourceAtReach(vector from_position, float add_tolerance=0, vector override_source_position="-1 -1 -1")
Energy manager: Returns true if this device's virtual power cord can reach its energy source at the g...
bool IsPlugged()
Energy manager: Returns true if this device is plugged into some other device (even if they are OFF o...
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
vector m_DefaultOrientation
const string ANIMATION_PLACING
vector GetCollisionBoxSize(vector min_max[2])
string CorrectMaterialPathName()
void SetProjectionEntity(EntityAI projection)
bool IsBaseIntact(Object under_left_close, Object under_right_close, Object under_left_far, Object under_right_far)
string GetProjectionName(ItemBase item)
const string SELECTION_PLACING
const float LARGE_PROJECTION_DISTANCE_LIMIT
Deprecated.
void SetSelectionToRefresh(array< string > selection)
bool IsCollidingZeroPos()
void SetSelectionToRefresh(string selection)
void SetIsCollidingGPlot(bool is_colliding_gplot)
const string SUFFIX_MATERIAL_DEPLOYABLE
vector GetLeftFarProjectionVector()
const float PROJECTION_TRANSITION_MAX
void EvaluateCollision(ItemBase action_item=null)
vector m_YawPitchRollLimit
void SetUpdatePosition(bool state)
bool HeightPlacementCheck()
Checks height relative to player's position.
EntityAI GetParentEntity()
const float SMALL_PROJECTION_RADIUS
void Hologram(PlayerBase player, vector pos, ItemBase item)
void SetProjectionOrientation(vector orientation)
void AddProjectionRotation(float addition)
vector HideWhenClose(vector pos)
vector SetOnGround(vector position)
bool IsObjectStatic(Object obj)
const vector PLACEMENT_RC_START_OFFSET
bool IsCollidingGeometryProxy(ItemBase action_item=null)
void UpdateHologram(float timeslice)
ref array< string > m_WatchtowerBlockedComponentNames
vector GetRightFarProjectionVector()
void SetIsHidden(bool is_hidden)
string m_ProjectionTypename
const vector PLACEMENT_RC_END_OFFSET
ref set< string > m_SelectionsToRefresh
const float DISTANCE_SMALL_PROJECTION
bool IsPlacementPermitted()
Checks if the item can be legally placed (usually checked by action as well)
bool IsCollidingBBox(ItemBase action_item=null)
static bool DoesHaveProjection(ItemBase item)
DEPRECATED.
vector SmoothProjectionMovement(vector y_p_r, float timeslice)
bool IsSurfaceWater(vector position)
bool SetHologramPosition(vector startPosition, float minProjectionDistance, float maxProjectionDistance, inout vector contactPosition)
Sets hologram position based on player and projection distance.
vector GetLeftCloseProjectionVector()
void SetIsColliding(bool is_colliding)
vector GetProjectionOrientation()
bool IsSurfaceSea(vector position)
void SubtractProjectionRotation(float subtraction)
vector GetRightCloseProjectionVector()
int GetHiddenSelection(string selection)
const string SUFFIX_MATERIAL_UNDEPLOYABLE
vector AlignProjectionOnTerrain(float timeslice)
vector GetProjectionEntityPosition(PlayerBase player)
ProjectionTrigger m_ProjectionTrigger
bool IsFenceOrWatchtowerKit()
EntityAI GetProjectionEntity()
static const float DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF
bool IsBaseFlat(vector contact_pos_left_close, vector contact_pos_right_close, vector contact_pos_left_far, vector contact_pos_right_far)
void SetIsCollidingPlayer(bool is_colliding)
void SetIsFloating(bool is_floating)
const float SMALL_PROJECTION_GROUND
vector CorrectForWatchtower(int contactComponent, vector contactPos, PlayerBase player, Object hitObject)
float GetProjectionRadius()
vector GetProjectionRotation()
bool IsBehindObstacle()
DEPRECATED.
void GetProjectionCollisionBox(out vector min_max[2])
float GetProjectionDiameter()
const float LOOKING_TO_SKY
string ProjectionBasedOnParent()
ref array< string > m_WatchtowerIgnoreComponentNames
vector GetProjectionPosition()
void SetProjectionPosition(vector position)
vector GetDefaultOrientation()
const float PROJECTION_TRANSITION_MIN
const string SELECTION_INVENTORY
const string ANIMATION_INVENTORY
EntityAI PlaceEntity(EntityAI entity_for_placing)
bool IsBaseStatic(Object objectToCheck)
const string SUFFIX_MATERIAL_POWERED
bool IsRestrictedFromAdvancedPlacing()
override bool IsBasebuildingKit()
override bool CanMakeGardenplot()
override bool IsDeployable()
static const string NAME_VIEW
Object obj
object,that we collide with (NULL if none), If hierLevel > 0 object is the proxy object
bool entry
is false if begining point was TriggerInsider
vector pos
position of collision (in world coord)
Object parent
if hierLevel > 0 most parent of the proxy object
override bool IsPlaceableAtPosition(vector position)
override void OnLeave(Object obj)
override void OnEnter(Object obj)
void SetParentOwner(PlayerBase player)
void UpdateInsiders(int timeout)
void SetParentObject(Hologram projection)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
static proto native void ColoredText(int color, string label)
const float ROOF_CHECK_RAYCAST_DIST
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int LIQUID_GROUP_WATER
static proto vector MatrixToAngles(vector mat[3])
Returns angles of rotation matrix.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto void MatrixMultiply3(vector mat0[3], vector mat1[3], out vector res[3])
Transforms rotation matrix.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.