75 string baseStringBegin = Watchtower.BASE_VIEW_NAME;
76 string baseIgnoreStringEnd = Watchtower.BASE_WALL_NAME;
77 int floors = Watchtower.MAX_WATCHTOWER_FLOORS;
78 int walls = Watchtower.MAX_WATCHTOWER_WALLS;
81 for (
int i = 1; i < floors + 1; ++i)
83 compName = baseStringBegin + i.
ToString();
84 for (
int j = 1; j < walls + 1; ++j)
95 string configPathProjectionTypename =
string.Format(
"CfgVehicles %1 projectionTypename",
m_Parent.GetType());
96 if (
GetGame().ConfigIsExisting(configPathProjectionTypename))
105 projectionEntity.SetAllowDamage(
false);
112 if (projectionEntity == null)
124 if (
ItemBase.Cast(projectionEntity))
130 if (
GetGame().ConfigIsExisting(configPathSlope))
136 if (
GetGame().ConfigIsExisting(configPathAlign))
142 if (
GetGame().ConfigIsExisting(configPathOrientationLimit))
163 #ifdef DIAG_DEVELOPER
190 string cfg_access =
"CfgVehicles " +
m_Projection.GetType() +
" AnimationSources ";
192 if (
GetGame().ConfigIsExisting(cfg_access) )
194 int cfg_access_count =
g_Game.ConfigGetChildrenCount(cfg_access);
196 for (
int i = 0; i < cfg_access_count; ++i )
201 float anim_phase =
m_Parent.GetAnimationPhase(found_anim);
227 return "GardenPlotPlacing";
233 return item.GetType() +
"Placing";
236 return item.GetType();
268 #ifdef DIAG_DEVELOPER
308 angles[1] = angles[1] + 270;
310 angles[0] =
Math.
Clamp( angles[0], 0, 360 );
311 angles[1] =
Math.
Clamp( angles[1], 0, 360 );
312 angles[2] =
Math.
Clamp( angles[2], 0, 360 );
314 projection_orientation_angles[0] = projection_orientation_angles[0] + ( 360 - angles[0] );
326 if ( y_p_r[0] > 180 )
328 y_p_r[0] = y_p_r[0] - 360;
331 if ( y_p_r[0] < -180 )
333 y_p_r[0] = y_p_r[0] + 360;
388 #ifdef DIAG_DEVELOPER
389 void DebugText(
string header,
bool mustBeTrue =
false,
bool condition =
true,
string info =
"")
393 int color = 0xFFFFFFFF;
395 if (mustBeTrue && !condition || !mustBeTrue && condition)
398 string text = header + condition + info;
403 protected float m_PitchOverride;
404 protected float m_RollOverride;
405 void DebugConfigValues()
432 #ifdef DIAG_DEVELOPER
433 DebugText(
"Inherits from TrapSpawnBase, checking IsPlaceableAtposition",
true);
441 #ifdef DIAG_DEVELOPER
442 DebugText(
"Inherits from TrapBase, checking IsPlaceableAtposition",
true);
466 #ifdef DIAG_DEVELOPER
472 #ifdef DIAG_DEVELOPER
473 MiscGameplayFunctions.IsUnderRoofFromToCalculation(
m_Projection, from, to);
474 DrawArrow(from, to, !b2);
478 #ifdef DIAG_DEVELOPER
479 DebugText(
"IsClippingRoof: ",
false, b1,
" | (projection height) " +
m_Projection.GetPosition()[1] +
" > (camera height) " +
GetGame().GetCurrentCameraPosition()[1]);
480 DebugText(
"IsClippingRoof: ",
false, b2,
" | (DoPlacingHeightCheck) " +
m_Projection.DoPlacingHeightCheck() +
" && (IsUnderRoof) " + MiscGameplayFunctions.IsUnderRoof(
m_Projection) +
" | from: " + from[1] +
" | to: " + to[1]);
492 #ifdef DIAG_DEVELOPER
499 #ifdef DIAG_DEVELOPER
526 vector absoluteOffset =
"0 0.01 0";
534 relativeOffset[1] = (minMax[1][1] - minMax[0][1]) * 0.5;
535 center =
m_Projection.GetPosition() + relativeOffset + absoluteOffset;
541 excludedObjects.Insert(action_item);
545 bool isTrue =
GetGame().
IsBoxCollidingGeometry(center, orientation, edgeLength, ObjIntersectFire, ObjIntersectGeom, excludedObjects, collidedObjects);
546 #ifdef DIAG_DEVELOPER
550 foreach (
Object object: collidedObjects)
551 text +=
" | " +
Object.GetDebugName(
object);
553 DebugText(
"IsCollidingBBox: ",
false, isTrue, text);
555 int color = 0x01FFFFFF;
576 vector to_left_close_down = from_left_close +
"0 -1 0";
579 vector to_right_close_down = from_right_close +
"0 -1 0";
582 vector to_left_far_down = from_left_far +
"0 -1 0";
585 vector to_right_far_down = from_right_far +
"0 -1 0";
587 vector contact_pos_left_close;
588 vector contact_pos_right_close;
589 vector contact_pos_left_far;
590 vector contact_pos_right_far;
591 vector contact_dir_left_close;
592 vector contact_dir_right_close;
593 vector contact_dir_left_far;
594 vector contact_dir_right_far;
595 int contact_component_left_close;
596 int contact_component_right_close;
597 int contact_component_left_far;
598 int contact_component_right_far;
599 set<Object> results_left_close =
new set<Object>;
600 set<Object> results_right_close =
new set<Object>;
601 set<Object> results_left_far =
new set<Object>;
602 set<Object> results_right_far =
new set<Object>;
609 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 );
610 if (results_left_close.Count() > 0)
611 obj_left_close = results_left_close[results_left_close.Count() - 1];
613 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 );
614 if (results_right_close.Count() > 0)
615 obj_right_close = results_right_close[results_right_close.Count() - 1];
617 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 );
618 if (results_left_far.Count() > 0)
619 obj_left_far = results_left_far[results_left_far.Count() - 1];
621 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 );
622 if (results_right_far.Count() > 0)
623 obj_right_far = results_right_far[results_right_far.Count() - 1];
625 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 );
633 #ifdef DIAG_DEVELOPER
644 #ifdef DIAG_DEVELOPER
645 DebugText(
"IsCollidingZeroPos: ",
false, isTrue);
663 #ifdef DIAG_DEVELOPER
664 if (objectToCheck == null)
665 DebugText(
"IsBaseStatic(must be true): ",
true,
true,
" | objectToCheck is null (this is good)");
667 DebugText(
"IsBaseStatic(must be true): ",
true,
IsObjectStatic(objectToCheck));
679 bool isTrue = (under_left_close == under_right_close && under_right_close == under_left_far && under_left_far == under_right_far);
680 #ifdef DIAG_DEVELOPER
681 DebugText(
"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));
685 conditions.Insert(under_left_close == null);
686 conditions.Insert(under_right_close == null);
687 conditions.Insert(under_left_far == null);
688 conditions.Insert(under_right_far == null);
690 int amountOfNull = 0;
691 if (!under_left_close)
693 if (!under_right_close)
697 if (!under_right_far)
700 if ( amountOfNull < 3 )
701 for (
int i = 0; i < conditions.Count(); ++i)
702 conditions[i] = !conditions[i];
704 DrawBaseSpheres(conditions);
711 #ifdef DIAG_DEVELOPER
716 int color = 0xFFFFFFFF;
724 void DrawSphere(
vector pos,
bool condition)
728 int color = 0x01FFFFFF;
746 for (
int i = 0; i < positions.Count(); ++i)
747 DrawSphere(positions[i], conditions[i]);
751 void DrawDebugArrow(
float start,
float dist,
int color = 0xFF1FFFFF)
766 float slope_pos_left_close =
Math.
AbsFloat(projection_pos[1] - contact_pos_left_close[1]);
767 float slope_pos_right_close =
Math.
AbsFloat(projection_pos[1] - contact_pos_right_close[1]);
768 float slope_pos_left_far =
Math.
AbsFloat(projection_pos[1] - contact_pos_left_far[1]);
769 float slope_pos_right_far =
Math.
AbsFloat(projection_pos[1] - contact_pos_right_far[1]);
772 #ifdef DIAG_DEVELOPER
773 DebugText(
"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);
774 DrawArrow(projection_pos, contact_pos_left_close, slope_pos_left_close <
m_SlopeTolerance);
775 DrawArrow(projection_pos, contact_pos_right_close, slope_pos_right_close <
m_SlopeTolerance);
776 DrawArrow(projection_pos, contact_pos_left_far, slope_pos_left_far <
m_SlopeTolerance);
777 DrawArrow(projection_pos, contact_pos_right_far, slope_pos_right_far <
m_SlopeTolerance);
791 #ifdef DIAG_DEVELOPER
792 DebugText(
"IsPlacementPermitted(must be true): ",
true, isTrue,
" (Note: CanBePlaced function on item and projection type must be same as item type)");
806 float delta1 = playerpos[1] - projectionpos[1];
810 #ifdef DIAG_DEVELOPER
811 DebugText(
"HeightPlacementCheck(must be true): ",
true,
false,
" | Height difference between item and player is larger than " +
DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF);
816 #ifdef DIAG_DEVELOPER
817 DebugText(
"HeightPlacementCheck(must be true): ",
true,
true);
833 #ifdef DIAG_DEVELOPER
834 DebugText(
"IsUnderwater: ",
false,
true,
" | Surface under object is water");
846 #ifdef DIAG_DEVELOPER
848 float lc =
g_Game.GetWaterDepth(left_close);
849 float rc =
g_Game.GetWaterDepth(right_close);
850 float lf =
g_Game.GetWaterDepth(left_far);
851 float rf =
g_Game.GetWaterDepth(right_far);
852 bool isTrue = (lc > 0 || rc > 0 || lf > 0 || rf > 0 || surface_sea_water);
853 DebugText(
"IsUnderwater: ",
false, isTrue,
" surface_sea_water: " + surface_sea_water +
" | (all must be less than zero) | lc: " + lc +
" | rc: " + rc +
" | lf: " + lf +
" | rf: " + rf);
857 array<bool> conditions = {lc <= 0, rc <= 0, lf <= 0, rf <= 0};
858 DrawBaseSpheres(conditions);
862 return (surface_sea_water ||
g_Game.GetWaterDepth(left_close) > 0 ||
g_Game.GetWaterDepth(right_close) > 0 ||
g_Game.GetWaterDepth(left_far) > 0 ||
g_Game.GetWaterDepth(right_far) > 0);
869 vector fromHeightOffset =
"0 0.3 0";
870 vector toHeightOffset =
"0 1 0";
873 vector to_left_close_down = from_left_close + toHeightOffset;
876 vector to_right_close_down = from_right_close + toHeightOffset;
879 vector to_left_far_down = from_left_far + toHeightOffset;
882 vector to_right_far_down = from_right_far + toHeightOffset;
884 vector contact_pos_left_close;
885 vector contact_pos_right_close;
886 vector contact_pos_left_far;
887 vector contact_pos_right_far;
889 vector contact_dir_left_close;
890 vector contact_dir_right_close;
891 vector contact_dir_left_far;
892 vector contact_dir_right_far;
894 int contact_component_left_close;
895 int contact_component_right_close;
896 int contact_component_left_far;
897 int contact_component_right_far;
899 #ifdef DIAG_DEVELOPER
901 set<Object> lcO =
new set<Object>();
902 set<Object> rcO =
new set<Object>();
903 set<Object> lfO =
new set<Object>();
904 set<Object> rfO =
new set<Object>();
905 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 );
906 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 );
907 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 );
908 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 );
909 bool isTrue = ( lc || rc || lf || rf );
923 text +=
" | lcO: " + lcO[0];
925 text +=
" | rcO: " + rcO[0];
927 text +=
" | lfO: " + lfO[0];
929 text +=
" | rfO: " + rfO[0];
932 DrawBaseSpheres(conditions);
934 DebugText(
"IsInTerrain: ",
false, isTrue, text);
937 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 ))
940 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 ))
943 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 ))
946 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 ))
958 m_Parent.GetCompEM().UpdatePlugState();
963 if (!
m_Parent.GetCompEM().IsPlugged())
972 if (entity_for_placing.IsInherited(
TentBase) || entity_for_placing.IsBasebuildingKit() )
974 return entity_for_placing;
980 return entity_for_placing;
989 return entity_for_placing;
996 min_max[0] =
m_Projection.GetMemoryPointPos(
"box_placing_min" );
997 min_max[1] =
m_Projection.GetMemoryPointPos(
"box_placing_max" );
1007 box_size[0] = min_max[1][0] - min_max[0][0];
1008 box_size[2] = min_max[1][2] - min_max[0][2];
1009 box_size[1] = min_max[1][1] - min_max[0][1];
1026 min_max[1][1] = min_max[0][1];
1027 min_max[1][2] = min_max[0][2];
1036 min_max[0][2] = min_max[1][2];
1045 min_max[1][1] = min_max[0][1];
1065 float minProjectionDistance;
1066 float maxProjectionDistance;
1070 float cameraToPlayerDistance =
vector.
Distance(
GetGame().GetCurrentCameraPosition(), player.GetPosition());
1079 minProjectionDistance = projectionRadius;
1080 maxProjectionDistance = projectionRadius * 2;
1089 MiscGameplayFunctions.GetHeadBonePos(player,head_pos);
1096 set<Object> hitObjects =
new set<Object>();
1098 DayZPhysics.
RaycastRV(from, to, contactPosition,
m_ContactDir,
m_ContactComponent, hitObjects, player,
m_Projection,
false,
false, ObjIntersectFire);
1100 bool contactHitProcessed =
false;
1104 if (hitObjects.Count() > 0)
1106 if (hitObjects[0].IsInherited(Watchtower))
1108 contactHitProcessed =
true;
1112 if (!contactHitProcessed && hitObjects[0].IsInherited(
InventoryItem))
1113 contactPosition = hitObjects[0].GetPosition();
1117 static const float raycastOriginOffsetOnFail = 0.25;
1118 static const float minDistFromStart = 0.01;
1120 if ((hitObjects.Count() > 0) && (
vector.
DistanceSq(from, contactPosition) < minDistFromStart))
1123 DayZPhysics.
RaycastRV(from, to, contactPosition,
m_ContactDir,
m_ContactComponent, hitObjects, player,
m_Projection,
false,
false, ObjIntersectFire);
1126 bool isFloating =
SetHologramPosition(player.GetPosition(), minProjectionDistance, maxProjectionDistance, contactPosition);
1129 #ifdef DIAG_DEVELOPER
1130 DrawDebugArrow(minProjectionDistance, maxProjectionDistance);
1139 return contactPosition;
1152 float playerToProjectionDistance =
vector.
Distance(startPosition, contactPosition);
1153 vector playerToProjection;
1155 #ifdef DIAG_DEVELOPER
1156 DebugText(
"SetHologramPosition::startPosition: ",
false,
m_IsHidden,
string.Format(
" | %1", startPosition));
1157 DebugText(
"SetHologramPosition::contactPosition [in]: ",
false,
m_IsHidden,
string.Format(
" | %1", contactPosition));
1158 DebugText(
"SetHologramPosition::minProjectionDistance: ",
false,
m_IsHidden,
string.Format(
" | %1", minProjectionDistance));
1159 DebugText(
"SetHologramPosition::maxProjectionDistance: ",
false,
m_IsHidden,
string.Format(
" | %1", maxProjectionDistance));
1160 DebugText(
"SetHologramPosition::playerToProjectionDistance: ",
false,
m_IsHidden,
string.Format(
" | %1", playerToProjectionDistance));
1164 if (playerToProjectionDistance <= minProjectionDistance)
1166 playerToProjection = contactPosition - startPosition;
1171 contactPosition = startPosition + (playerToProjection * minProjectionDistance);
1173 #ifdef DIAG_DEVELOPER
1174 DebugText(
"SetHologramPosition::contactPosition[out] (< minProjectDistance): ",
false,
m_IsHidden,
string.Format(
" | %1", contactPosition));
1180 else if (playerToProjectionDistance >= maxProjectionDistance)
1182 playerToProjection = contactPosition - startPosition;
1187 contactPosition = startPosition + (playerToProjection * maxProjectionDistance);
1189 #ifdef DIAG_DEVELOPER
1190 DebugText(
"SetHologramPosition::contactPosition[out] (< maxProjectionDistance): ",
false,
m_IsHidden,
string.Format(
" | %1", contactPosition));
1208 contactPos[1] = hitObject.GetActionComponentPosition(contactComponent,
LOD.
NAME_VIEW)[1];
1228 diameter = diagonal.
Length();
1242 diameter = diagonal.
Length();
1243 radius = diameter / 2;
1280 #ifdef DIAG_DEVELOPER
1281 DebugText(
"Is colliding: ",
false, is_colliding);
1303 #ifdef DIAG_DEVELOPER
1316 #ifdef DIAG_DEVELOPER
1326 #ifdef DIAG_DEVELOPER
1366 vector player_to_projection_vector;
1371 vector to = from + ground;
1381 for (
int i = 0; i < results.Count(); i++)
1383 res = results.Get(i);
1386 contact_pos = res.
pos;
1393 if (contact_pos !=
"0 0 0")
1397 int check_component = -1;
1398 set<Object> hit_object =
new set<Object>;
1400 to[1] = to[1] + 0.1;
1403 if (
DayZPhysics.
RaycastRV(from, to, check_pos, check_dir, check_component, hit_object, null,
m_Player,
false,
false, ObjIntersectFire))
1405 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))))
1407 contact_pos =
"0 0 0";
1461 int idx =
m_Projection.GetHiddenSelectionIndex(selection);
1478 for (
int i = 0; i < selection.Count(); i++ )
1488 static const string textureName =
"#(argb,8,8,3)color(0.5,0.5,0.5,0.75,ca)";
1490 int hidden_selection = 0;
1491 string selection_to_refresh;
1492 string config_material =
string.Format(
"CfgVehicles %1 hologramMaterial",
m_Projection.GetType());
1494 string config_model =
string.
Format(
"CfgVehicles %1 hologramMaterialPath",
m_Projection.GetType());
1501 m_Projection.SetObjectTexture(hidden_selection, textureName);
1502 m_Projection.SetObjectMaterial(hidden_selection, hologram_material_path);
1514 else if (
m_Parent.HasEnergyManager())
1549 m_TriggerUpdateMs = 50;
1564 super.UpdateInsiders(m_TriggerUpdateMs);
eBleedingSourceType GetType()
const int ECE_OBJECT_SWAP
const int ECE_PLACE_ON_SURFACE
const int ECE_CREATEPHYSICS
protected void DrawDebugCollisionBox(vector min_max[2], int color)
protected void DestroyDebugCollisionBox()
protected Shape m_CollisionBox
void DeployableContainer_Base()
void DayZPlayerCamera3rdPerson(DayZPlayer pPlayer, HumanInputController pInput)
proto native void ObjectDelete(Object obj)
proto native bool SurfaceIsPond(float x, float z)
proto native vector GetCurrentCameraDirection()
proto native vector ConfigGetVector(string path)
Get vector value from config on path.
proto native vector SurfaceGetNormal(float x, float z)
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native bool SurfaceIsSea(float x, float z)
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native vector GetCurrentCameraPosition()
proto native bool IsBoxCollidingGeometry(vector center, vector orientation, vector edgeLength, int iPrimaryType, int iSecondaryType, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
Finds all objects with geometry iType that are in choosen oriented bounding box (OBB)
string ConfigGetTextOut(string path)
Get string value from config on path.
static bool GetDisableIsCollidingPlayerCheck()
static bool GetDisableIsClippingRoofCheck()
static bool GetDisableIsCollidingGPlotCheck()
static bool GetDisableIsCollidingBBoxCheck()
static bool GetDisableIsInTerrainCheck()
static bool GetDisableIsCollidingAngleCheck()
static bool GetDisableIsPlacementPermittedCheck()
static bool GetDisableHeightPlacementCheck()
static bool GetDisableIsBaseViableCheck()
static bool GetDisableIsUnderwaterCheck()
Super root of all classes in Enforce script.
bool IsPlugged()
Energy manager: Returns true if this device is plugged into some other device (even if they are OFF o...
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...
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
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 Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
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)
protected const string ANIMATION_INVENTORY
protected const float DISTANCE_SMALL_PROJECTION
protected const string SUFFIX_MATERIAL_UNDEPLOYABLE
protected const string SELECTION_PLACING
protected const float LARGE_PROJECTION_DISTANCE_LIMIT
Deprecated.
protected const string SELECTION_INVENTORY
vector GetProjectionRotation()
static const protected ref array< string > m_WatchtowerIgnoreComponentNames
protected bool m_UpdatePosition
void SetIsColliding(bool is_colliding)
protected vector m_DefaultOrientation
bool IsBehindObstacle()
DEPRECATED.
void SetIsCollidingGPlot(bool is_colliding_gplot)
protected const int SPAWN_FLAGS
string ProjectionBasedOnParent()
protected vector GetProjectionEntityPosition(PlayerBase player)
void SetProjectionPosition(vector position)
protected const float PROJECTION_TRANSITION_MIN
void SetIsHidden(bool is_hidden)
bool IsCollidingZeroPos()
protected bool m_AlignToTerrain
protected bool m_IsCollidingGPlot
vector GetProjectionOrientation()
static const float DEFAULT_MAX_PLACEMENT_HEIGHT_DIFF
protected vector m_ContactDir
protected const string ANIMATION_PLACING
EntityAI GetParentEntity()
protected vector GetCollisionBoxSize(vector min_max[2])
void EvaluateCollision(ItemBase action_item=null)
protected float m_SlopeTolerance
protected const float PROJECTION_TRANSITION_MAX
protected vector m_FromAdjusted
vector GetRightFarProjectionVector()
string CorrectMaterialPathName()
vector GetLeftCloseProjectionVector()
vector SmoothProjectionMovement(vector y_p_r, float timeslice)
void SetSelectionToRefresh(string selection)
EntityAI PlaceEntity(EntityAI entity_for_placing)
void SetUpdatePosition(bool state)
vector AlignProjectionOnTerrain(float timeslice)
void Hologram(PlayerBase player, vector pos, ItemBase item)
vector HideWhenClose(vector pos)
static bool DoesHaveProjection(ItemBase item)
DEPRECATED.
void SetIsCollidingPlayer(bool is_colliding)
protected vector m_YawPitchRollLimit
void SetIsFloating(bool is_floating)
protected int m_ContactComponent
bool IsBaseStatic(Object objectToCheck)
protected const string SUFFIX_MATERIAL_POWERED
int GetHiddenSelection(string selection)
protected bool m_IsFloating
protected PlayerBase m_Player
static const protected ref array< string > m_WatchtowerBlockedComponentNames
bool IsPlacementPermitted()
Checks if the item can be legally placed (usually checked by action as well)
protected const float SMALL_PROJECTION_RADIUS
protected vector m_y_p_r_previous
protected vector m_Rotation
protected const string SUFFIX_MATERIAL_DEPLOYABLE
bool HeightPlacementCheck()
Checks height relative to player's position.
bool IsSurfaceSea(vector position)
void SetProjectionEntity(EntityAI projection)
bool IsBaseFlat(vector contact_pos_left_close, vector contact_pos_right_close, vector contact_pos_left_far, vector contact_pos_right_far)
protected ProjectionTrigger m_ProjectionTrigger
vector CorrectForWatchtower(int contactComponent, vector contactPos, PlayerBase player, Object hitObject)
protected EntityAI m_Projection
bool IsCollidingBBox(ItemBase action_item=null)
bool IsSurfaceWater(vector position)
protected bool m_IsCollidingPlayer
protected const float SMALL_PROJECTION_GROUND
void SubtractProjectionRotation(float subtraction)
protected ref set< string > m_SelectionsToRefresh
float GetProjectionDiameter()
bool IsBaseIntact(Object under_left_close, Object under_right_close, Object under_left_far, Object under_right_far)
EntityAI GetProjectionEntity()
protected string m_ProjectionTypename
protected bool SetHologramPosition(vector startPosition, float minProjectionDistance, float maxProjectionDistance, inout vector contactPosition)
Sets hologram position based on player and projection distance.
vector SetOnGround(vector position)
bool IsFenceOrWatchtowerKit()
void SetProjectionOrientation(vector orientation)
protected void GetProjectionCollisionBox(out vector min_max[2])
void UpdateHologram(float timeslice)
protected bool m_IsHidden
protected bool m_IsColliding
vector GetDefaultOrientation()
vector GetProjectionPosition()
void SetSelectionToRefresh(array< string > selection)
protected const float LOOKING_TO_SKY
float GetProjectionRadius()
vector GetRightCloseProjectionVector()
protected ItemBase m_Parent
vector GetLeftFarProjectionVector()
bool IsObjectStatic(Object obj)
string GetProjectionName(ItemBase item)
void AddProjectionRotation(float addition)
static protected const string SEL_CORD_FOLDED
override bool CanMakeGardenplot()
override bool IsBasebuildingKit()
override bool CanBePlaced(Man player, vector position)
override bool IsDeployable()
static protected const string SEL_CORD_PLUGGED
static const string NAME_VIEW
vector pos
position of collision (in world coord)
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
Object parent
if hierLevel > 0 most parent of the proxy object
override bool IsPlaceableAtPosition(vector position)
protected int m_TriggerUpdateMs
void SetParentOwner(PlayerBase player)
protected Hologram m_ParentObj
protected PlayerBase m_Player
override void OnEnter(Object obj)
override void OnLeave(Object obj)
override protected void UpdateInsiders(int timeout)
void SetParentObject(Hologram projection)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto float Normalize()
Normalizes vector. Returns length.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto native float Length()
Returns length of vector (magnitude)
proto native CGame GetGame()
static proto void InputFloat(string txt, out float value, int pxWidth=150)
static proto native void ColoredText(int color, string label)
static proto native void SameLine()
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.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto vector MatrixToAngles(vector mat[3])
Returns angles of rotation matrix.
static proto void MatrixMultiply3(vector mat0[3], vector mat1[3], out vector res[3])
Transforms rotation matrix.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float Max(float x, float y)
Returns bigger of two given values.
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 Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.