85 int floors = Watchtower.MAX_WATCHTOWER_FLOORS;
86 int walls = Watchtower.MAX_WATCHTOWER_WALLS;
212 if (
item.CanMakeGardenplot())
213 return "GardenPlotPlacing";
217 return item.GetType() +
"Placing";
219 return item.GetType();
225 return item && (
item.IsDeployable() ||
item.CanMakeGardenplot() ||
item.IsInherited(DeployableContainer_Base));
362 int color = 0xFFFFFFFF;
412 DebugText(
"Inherits from TrapSpawnBase, checking IsPlaceableAtposition",
true);
422 DebugText(
"Inherits from TrapBase, checking IsPlaceableAtposition",
true);
457 DebugText(
"IsClippingRoof: ",
false,
b1,
" | (projection height) " +
m_Projection.GetPosition()[1] +
" > (camera height) " +
GetGame().GetCurrentCameraPosition()[1]);
533 int color = 0x01FFFFFF;
587 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);
591 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);
595 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);
599 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);
643 DebugText(
"IsBaseStatic(must be true): ",
true,
true,
" | objectToCheck is null (this is good)");
694 int color = 0xFFFFFFFF;
706 int color = 0x01FFFFFF;
770 DebugText(
"IsPlacementPermitted(must be true): ",
true,
isTrue,
" (Note: ItemBase::CanBePlaced() return value)");
795 DebugText(
"HeightPlacementCheck(must be true): ",
true,
true);
812 DebugText(
"IsUnderwater: ",
false,
true,
" | Surface under object is water");
883 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);
884 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);
885 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);
886 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);
915 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))
918 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))
921 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))
924 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))
936 m_Parent.GetCompEM().UpdatePlugState();
941 if (!
m_Parent.GetCompEM().IsPlugged())
1072 DayZPhysics.
RaycastRV(
from,
to,
contactPosition,
m_ContactDir,
m_ContactComponent,
hitObjects,
player,
m_Projection,
false,
false,
ObjIntersectFire);
1097 DayZPhysics.
RaycastRV(
from,
to,
contactPosition,
m_ContactDir,
m_ContactComponent,
hitObjects,
player,
m_Projection,
false,
false,
ObjIntersectFire);
1103#ifdef DIAG_DEVELOPER
1127#ifdef DIAG_DEVELOPER
1145#ifdef DIAG_DEVELOPER
1161#ifdef DIAG_DEVELOPER
1252#ifdef DIAG_DEVELOPER
1275#ifdef DIAG_DEVELOPER
1288#ifdef DIAG_DEVELOPER
1298#ifdef DIAG_DEVELOPER
1354 if (
res.entry || (!
res.obj && !
res.parent))
1370 to[1] =
to[1] + 0.1;
1373 if (
DayZPhysics.
RaycastRV(
from,
to,
check_pos,
check_dir,
check_component,
hit_object,
null,
m_Player,
false,
false,
ObjIntersectFire))
1442 foreach (
string s : selection)
1450 static const string textureName =
"#(argb,8,8,3)color(0.5,0.5,0.5,0.75,ca)";
1474 else if (
m_Parent.HasEnergyManager())
1529 m_TriggerUpdateMs = 50;
1542 super.UpdateInsiders(m_TriggerUpdateMs);
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 DayZPlayerCamera3rdPerson(DayZPlayer pPlayer, HumanInputController pInput)
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.
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)
void UpdateHologram(float timeslice)
ref array< string > m_WatchtowerBlockedComponentNames
vector GetRightFarProjectionVector()
void SetIsHidden(bool is_hidden)
string m_ProjectionTypename
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()
const string SEL_CORD_PLUGGED
const string SEL_CORD_FOLDED
override bool CanBePlaced(Man player, vector position)
static const string NAME_VIEW
override void OnLeave(Object obj)
override void OnEnter(Object obj)
void SetParentOwner(PlayerBase player)
void UpdateInsiders(int timeout)
void SetParentObject(Hologram projection)
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)
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto void InputFloat(string txt, out float value, int pxWidth=150)
static proto native void SameLine()
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.
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.