11 [
Attribute(defvalue:
"10",
category:
"Virtual Area", uiwidget:
UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
EAreaMeshShape),
desc:
"Area shape. If Ellipse it will use Radius while Rectangle uses diameter (width and length) rather like ellipse using half the diameter)")]
17 [
Attribute(
"12",
desc:
"How many segments in the ellipse (ELLIPSE Shapes only as RECTANGLE has a set resolution of 4).", uiwidget:
UIWidgets.Slider,
params:
"4 60 1",
category:
"Virtual Area")]
20 [
Attribute(
desc:
"True to let the border copy terrain, creating a 'wall'.",
category:
"Virtual Area")]
23 [
Attribute(
desc:
"True to stretch the material along the whole circumference instead of mapping it on each segment.",
category:
"Virtual Area")]
26 [
Attribute(
desc:
"Material mapped on outside and inside of the mesh. Inside mapping is mirrored.", uiwidget:
UIWidgets.ResourcePickerThumbnail,
params:
"emat",
category:
"Virtual Area")]
29 [
Attribute(
"false",
desc:
"When enabled, the component will be active from init",
category:
"Virtual Area")]
32 [
Attribute(
"0",
desc:
"If true always hide the zone in workbench. This setting is ignored when playing even within workbench",
category:
"Workbench")]
105 dimensions[0] = width;
107 dimensions[2] = length;
140 if (dimensions[0] <= 0 || dimensions[1] <= 0 || dimensions[2] <= 0)
142 owner.SetObject(null,
"");
146 array<vector> positions = {};
152 float dirStep =
Math.PI2 / resolution;
155 for (
int v = 0; v < resolution; v++)
157 float dir = dirStep * v;
158 vector pos =
Vector((
Math.Sin(dir) * dimensions[0]) + offset[0], -dimensions[1], (
Math.Cos(dir) * dimensions[2]) + offset[2]);
159 positions.Insert(pos);
165 float width = dimensions[0] * 0.5;
166 float length = dimensions[2] * 0.5;
168 array<vector> corners =
170 { -width + offset[0], -dimensions[1], -length + offset[2] },
171 { width + offset[0], -dimensions[1], -length + offset[2] },
172 { width + offset[0], -dimensions[1], length + offset[2] },
173 { -width + offset[0], -dimensions[1], length + offset[2] }
177 for (
int i = 0; i < 4; i++)
179 vector start = corners[i];
180 vector end = corners[(i + 1) % 4];
182 for (
float s = 0; s < 4; s++)
185 positions.Insert(pos);
192 owner.SetObject(null,
"");
210 foreach (
int i,
vector pos: positions)
213 worldPos[1] =
Math.Max(world.GetSurfaceY(worldPos[0], worldPos[2]), 0);
219 MeshObject meshObject = res.GetResource().ToMeshObject();
222 owner.SetObject(meshObject,
"");
248 override void _WB_SetTransform(
IEntity owner, inout vector mat[4], IEntitySource src)
ref array< string > angles
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void DeactivateEveryFrame()
Deactivate the area.
bool m_bActiveEveryFrameOnInit
void GetDimensions3D(out vector dimensions)
void ActivateEveryFrame()
Activate the area so it could be updated every frame.
ResourceName GetMaterial()
Get material used for area mesh.
SCR_BaseAreaMeshComponentClass PREVIEW_RESOLUTION
EAreaMeshShape GetShape()
@ ELLIPSE
Ellipse using Radius and Resolution.
@ RECTANGLE
Rectangle shape that has a width and length.
void GetDimensions2D(out float width, out float length)
void GenerateAreaMesh()
Generate area mesh based on its settings.
vector GetMeshOffset(IEntity owner)
override void EOnFrame(IEntity owner, float timeSlice)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
enum EVehicleType IEntity
proto external vector GetAngles()
Same as GetYawPitchRoll(), but returns rotation vector around X, Y and Z axis.
proto external vector GetOrigin()
proto external void GetWorldTransform(out vector mat[])
See IEntity::GetTransform.
proto external BaseWorld GetWorld()
proto external bool SetWorldTransform(vector mat[4])
See IEntity::SetTransform. Returns false, if there is no change in transformation.
proto external vector CoordToParent(vector coord)
proto external vector CoordToLocal(vector coord)
Object holding reference to resource. In destructor release the resource.
IEntity GetOwner()
Owner entity of the fuel tank.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
proto native vector Vector(float x, float y, float z)